OpenSolaris

Printable Version Enter a New Search
Bug ID 6805730
Synopsis some simple changes would make 'init 5' much faster
State 10-Fix Delivered (Fix available in build)
Category:Subcategory utility:smf
Keywords smf
Responsible Engineer Daniel Price
Reported Against s10_50
Duplicate Of
Introduced In solaris_10
Commit to Fix snv_110
Fixed In snv_110
Release Fixed solaris_nevada(snv_110)
Related Bugs 6809492 , 6813144 , 6814131 , 6860676 , 6866831 , 4967733
Submit Date 15-February-2009
Last Update Date 11-March-2009
Description
I've spotted a couple of problems which waste a lot of time during "gentle" system shutdown, at least on fast systems.  This does not pertain to the amount of time it takes to do "poweroff" or "reboot", but rather "shutdown" or "init [056]"

1) The function smf_kill_contract() in /lib/svc/share/smf_include.sh is miscoded, and will always sleep for at least 5 seconds, regardless of how quickly the contract empties (in my tests, the contract is nearly always empty within 100ms of the kill).  This introduces long idle periods into the shutdown process, at least on fast systems.  On a stock system, three such periods happen during every shutdown.

2) startd spends fully 15 seconds waiting for /usr/sbin/killall(1m), including 10 seconds waiting for the results of killall -9 to complete.  This is too long, and happens on all systems.  killall isn't nearly as impactful as the name might sound: it merely looks through /etc/utmpx for LOGIN_PROCESS and USER_PROCESS entries, and kills those.

3) The ppp shutdown script (a legacy RC script) sleeps for one second every time it runs.  Since all legacy scripts run before any other stop methods, this induces a delay on all systems, regardless of whether ppp is in use.

4) shutdown(1m) calls sync(1m) at the start of shutdown (curiously, it calls sync before the grace period even begins!)

5) rc0/rc5/rc6 calls sync; sync; sync even though it's run near the beginning of shutdown, rather than at the end.

Fixing these problems reduced the amount of time reduced the amount of time to shutdown on my desktop from 50 seconds to 8.
Work Around
N/A
Comments
N/A