[OpenIndiana-discuss] auto-scrub and its result

Jim Klimov jimklimov at cos.ru
Sat Dec 29 19:47:54 UTC 2012


On 2012-12-29 14:38, Edward Ned Harvey (openindiana) wrote:
>> From: Jim Klimov [mailto:jimklimov at cos.ru]
>>
>> Note however that halt, poweroff and reboot commands are binaries (and
>> hardlinks of one program), and they can be ungraceful and fast.
>
> Up till now, whenever I want to completely reboot (with bios and bootloader, not just fastreboot which reloads kernel) I always used "reboot -p" and it does gracefully shutdown services and kill processes and unmount filesystems, etc etc.  However, as a result of your email above, I went looking deeper into this, and found ...

I did look into loader and halter procedures back in sol8-sol9,
when they were /etc/rc[012345] scripts. In particular, this was
where I put extra logic needed for proper UPS shutdowns with NUT.

And those scripted routines invoked by init took care of service
stopping, FS sync and umounts, etc., and ended in a call to halt,
reboot or poweroff depending on requested init level. I think in
some versions these /etc/rc[056] were links to one script, and
only diverged in this final action according to `basename $0`.

Now that the shutdown routine since sol10/opensolaris is done
by bootadm binary, there is no simple place to hack into and add
the shutdown logic I needed (as I did by packaging the patch-file
and applying it during NUT installation), other than coding it in
C and replacing bootadm - not very practical (especially not for
proprietary Solaris, and just for regular OS upgrades which would
replace bootadm with the stock one).

In particular, the UPS-related routine must survive the shutdown
routine's "killall" call, and there are not many choices on where
to hack it into. I went into more detail on this a year ago or so
on the list.

So, I digress, my knowledge of the matter may be outdated now...

//Jim




More information about the OpenIndiana-discuss mailing list