Description of problem: I was writing an initscript for the mazu-buildmonitor service, and its start() function included the line: daemon --pidfile=${pidfile} $PROG This caused a complaint when I ran "service start mazu-buildmonitor: /etc/init.d/functions: line 144: ${$1#--pidfile=}: bad substitution Version-Release number of selected component (if applicable): 8.31.1-1 How reproducible: Try to use "daemon --pidfile=" out of /etc/init.d/functions. Steps to Reproduce: 1. Start a root shell: ~ # sh 2. Run the following commands: sh-3.1# . /etc/init.d/functions sh-3.1# PROG=/bin/true sh-3.1# pidfile=/tmp/true.pid sh-3.1# daemon --pidfile=${pidfile} $PROG Actual results: Saw the error: sh: ${$1#--pidfile=}: bad substitution And the function returned with status 1 Expected results: The output: [ OK ] and the function returning with status 0. Additional info: I have a fix for this. See the attached patch. It's a single-character patch.
Created attachment 130924 [details] Patch to /etc/init.d/functions
Created attachment 130925 [details] The actual mazu-buildmonitor startup script, as installed as /etc/init.d/mazu-buildmonitor . This is here if you want to see the bug in its natural, wild state :).
Thanks for the patch! You can use (daemon --pidfile file ...) as a workaround.
Fixed in 8.36-1.