Created attachment 361802 [details, diff] Rewritten local initscript Hi, I have rewritten /etc/init.d/local, inspired by /etc/init.d/sysctl. The new initscript supports verbose mode (will telling and will output an error if the executable /etc/local.d/*.{start,stop} file will end with a non-zero exit status. Output example: Starting/stopping local with errors and rc_verbose="YES": # /etc/init.d/local restart * Stopping local ... * Executing "/etc/local.d/00will-stop.stop" ... [ ok ] * Executing "/etc/local.d/will-fail.stop" ... mount: can't find foo in /etc/fstab * Execution of "/etc/local.d/will-fail.stop" failed. [ !! ] * One or more executable "/etc/local.d/*.stop" file(s) failed with a non-zero exit status! [ !! ] * Starting local ... * Executing "/etc/local.d/00will-start.start" ... [ ok ] * Executing "/etc/local.d/will-fail.start" ... mount: can't find foo in /etc/fstab * Execution of "/etc/local.d/will-fail.start" failed. [ !! ] * One or more executable "/etc/local.d/*.start" file(s) failed with a non-zero exit status! [ !! ] When we don't find an executable *.{start,stop} file in /etc/local.d and rc_verbose="YES": # /etc/init.d/local stop * Stopping local ... * No executable "/etc/local.d/*.stop" file found! * This might be OK if you don't want to execute a file on local stop * or may indicate an configuration error. (We are using ewarn; This warning will only be shown when rc_verbose="YES") Starting/stopping local without errors and rc_verbose="YES": # /etc/init.d/local restart * Stopping local ... * Executing "/etc/local.d/00will-stop.stop" ... [ ok ] * Starting local ... * Executing "/etc/local.d/00will-start.start" ... [ ok ] Starting/stopping local without errors and rc_verbose="NO": # /etc/init.d/local restart * Stopping local ... [ ok ] * Starting local ... [ ok ] (This is unchanged) Starting/stopping local with errors and rc_verbose="NO": # /etc/init.d/local restart * Stopping local ... mount: can't find foo in /etc/fstab * Execution of "/etc/local.d/will-fail.stop" failed. [ !! ] * One or more executable "/etc/local.d/*.stop" file(s) failed with a non-zero exit status! [ !! ] * Starting local ... mount: can't find foo in /etc/fstab * Execution of "/etc/local.d/will-fail.start" failed. [ !! ] * One or more executable "/etc/local.d/*.start" file(s) failed with a non-zero exit status! [ !! ] I also adjusted the copyright line. Feel free to change.
Created attachment 362126 [details, diff] Rewritten local initscript (r2) Hi, before we forget I am attaching r2 of the rewritten local initscript, based on the discussion in #openrc from Thursday, 24th Oktober 2013.
I created a pull request for the OpenRC repository: https://github.com/OpenRC/openrc/pull/21
This is added in commit c1de8c0 and will be in OpenRC-0.13.