Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 489274 - sys-apps/openrc - Rewritten local initscript for verbose output and error checking
Summary: sys-apps/openrc - Rewritten local initscript for verbose output and error che...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 481182
  Show dependency tree
 
Reported: 2013-10-24 16:38 UTC by Thomas Deutschmann (RETIRED)
Modified: 2014-07-09 20:57 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Rewritten local initscript (Verbose-local-initscript.patch,4.55 KB, patch)
2013-10-24 16:38 UTC, Thomas Deutschmann (RETIRED)
Details | Diff
Rewritten local initscript (r2) (verbose-local-initscript-r2.patch,2.75 KB, patch)
2013-10-28 11:29 UTC, Thomas Deutschmann (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2013-10-24 16:38:59 UTC
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.
Comment 1 Thomas Deutschmann (RETIRED) gentoo-dev 2013-10-28 11:29:19 UTC
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.
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2014-06-10 13:41:15 UTC
I created a pull request for the OpenRC repository:
https://github.com/OpenRC/openrc/pull/21
Comment 3 William Hubbs gentoo-dev 2014-07-09 20:57:42 UTC
This is added in commit c1de8c0 and will be in OpenRC-0.13.