Hi, 1) touch "/etc/my test.cfg" 2) Create "/etc/init.d/test-space" with the following content #!/sbin/runscript description="Test runscript for testing required_files with spaces" command="/bin/true" required_files="${TESTCFG}" stop() { return 0 } 3) Create "/etc/conf.d/test-space" with the following content TESTCFG="/etc/my test.cfg" 4) Now try to start your "test-space" service: # /etc/init.d/test-space start * test-space: `/etc/my' is not readable * ERROR: test-space failed to start You can try to double quote, e.g. required_files="\"${TESTCFG}\"" but this doesn't solve the problem. Tested with openrc-0.17.
This is fixed in commit 29f7e33 which will also be backported to openrc-0.18.1.
Are you sure this is working? $ cat config.sh TESTCFG="/etc/my test.cfg" $ cat test.sh #!/bin/sh source ./config.sh required_files="${TESTCFG}" eval "printf '%s\n' $required_files" | while read _f; do if [ ! -r "$_f" ]; then echo "\`$_f' is not readable" exit 1 fi done unset _f $ ./test.sh `/etc/my' is not readable Expecting `/etc/my test.cfg' is not readable or no error when "/etc/my test.cfg" exists.
OK, works for me. required_files now needs double quoting: required_files="\"${TESTCFG}\"" Thanks! FYI: Expansion doesn't work (i.e. you cannot use something link 'required_files="~/foo.cfg"' but I am not sure if this was ever supported or should be supported).
Uh, now I think I found a big problem with the commit: When required_files isn't set (=empty) than every runscript is failing now.
I get this when starting/stopping nginx f.e.: nginx # /etc/init.d/nginx start * nginx: `' is not a directory * nginx: `' is not readable
This was fixed a while ago in 0.18.2, and is these commits on the master branch: 7da72ce fc777ae. Thanks. William
*** Bug 581436 has been marked as a duplicate of this bug. ***