Created attachment 347500 [details]
Patch to add extra plugin hook states
Currently OpenRC executes any plugins with hooks for runlevel and service start and stop (in and out).
The attached patch adds two new hook states:
1) RC_HOOK_SYSTEM_START_FINISHED which fires once after system start has completed. It should not fire on any other event (such as switching runlevel, etc).
2) RC_HOOK_SYSTEM_STOP_INITIATED which fires once when the shutdown runlevel is selected by init (after a shutdown command or a three-finger-salute, etc).
This addition makes writing plugins which are only interested in these states possible.
This patch should apply cleanly to most recent versions although the line numbers assume that the patches I supplied in bug 467368 and bug 468736 have already been applied.