Red Hat Bugzilla – Bug 203010
RFE: allow daemon() in /etc/init.d/functions to pass -m to /sbin/runuser
Last modified: 2014-03-16 23:01:28 EDT
Description of problem:
When running the daemon() function from an initscript and using the "--user"
option, daemon will run "/sbin/runuser" to execute. This command clears the
environment by default unless the -m or -p arguments are given. This can create
a problem because some initscripts set environment variables for their
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Export a variable in an initscript which sources /etc/init.d/functions
2. call a program using the "daemon --user BLAH program" syntax
The variable you exported will not be present in the program's environment.
That the variable would be available, yo, regardless of the fact that we're
*** Bug 203011 has been marked as a duplicate of this bug. ***
This is identical to Bug 123032, which was closed.
Adding FutureFeature keyword to RFE's.
Any thoughts on this bug/feature? Given the lack of documentation, it seems like a simple declaration that daemon() no longer clears the environment would be sufficient; then add '-m' to the relevant line.
if [ -z "$user" ]; then
$nice /bin/bash -c "$corelimit >/dev/null 2>&1 ; $*"
$nice runuser -s /bin/bash - $user -c "$corelimit >/dev/null 2>&1 ; $*"
Wow, apologies. I let this sit a long time.
Will be in future rawhide releases, and F13.
mdadm-3.1.2-9.fc13,initscripts-9.09-1.fc13 has been submitted as an update for Fedora 13.
initscripts-9.09-1.fc13, mdadm-3.1.2-10.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.