Re: How to add system-shutdown processing commands in OpenSolaris/Solaris11E/OI
Hello Alan, thanks for the reply, but I think your reply is about "normal" shutdown scripts used to
terminate a service properly.
Would this also work for scripts which change the shutdown logic of the OS itself? I mean not shutting down a
specific service and ending my script afterwards - I need to insert a sleeping watchdog loop which makes
sure that the system forcedly reboots in certain circumstances (explained in my original forum web-post
and reiterated below) - and I don't want this loop killed by "killall -9" lookalike which used to be in
/etc/rc0 and may now be in svc.startd or elsewhere. This logic must keep running until the OS uptime ends
one way or another.
Back in Solaris 8/9/10, the /etc/rc0 script was THE logic which led to system halt or reboot (sans the
reboot/halt/uadmin commands themselves). On the way it called the shutdown scripts, issued killall for
the leftover processes, and unmounted the filesystems, and reported 'The system is down.' And in my case -
after all that it spawned the watchdog loop, immune to killall because there were no killalls after that.
In OpenSolaris and later /etc/rc0 only calls the legacy shutdown scripts, while the later half of the logic
is gone elsewhere (and I'm trying to discover - where).
Here's the pre-history of my question after all - for those who don't like to follow links (I had little hope
for that anyway ;) :
===
Hello all,
A long while ago I made a package for NUT (Network UPS Tools) used in some of our projects since Solaris 8. Part
of this packaging involved changes to "/etc/rc0" scripts, with variants for Solaris 8 and 9, and for
Solaris 10 with SMF, example of the patch changes is attached below.
Currently on another occasion I want to add a watchdog cycle to force rebooting/halting with "uadmin" if
the pool export-on-shutdown hangs, as happens on my home test box too often.
(Continue reading)