Bug 26894 - daemon() in initscripts functions runs "su" incorrectly
daemon() in initscripts functions runs "su" incorrectly
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
i386 Linux
low Severity low
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-02-09 18:30 EST by Jeremy Portzer
Modified: 2014-03-16 22:18 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-02-12 09:53:05 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jeremy Portzer 2001-02-09 18:30:23 EST
The daemon() function in /etc/rc.d/init.d/functions takes a "--user" option
which tries to run the daemon as that user:

nice -n $nicelevel initlog $INITLOG_ARGS -c "su $daemon_user -c \"$*\"" &&
success "$base startup" || failure "$base startup"

However this causes problems if the daemon makes assumptions about its
environment, for example $HOME remains set to /root, not the homedir of
$daemon_user.   Obviously smart daemons make provisions for this type of
thing in their configuration, but I've encountered some third-party stuff
(namely Blackboard Courseinfo) that relies on the daemon user's

This can easily be fixed by running su as "su - $daemon_user ..." to run
the daemon in a "login" shell.  It would probably reduce headaches if this
were the default behavior.
Comment 1 Bill Nottingham 2001-02-16 14:17:59 EST
Will be fixed in 5.65-1 or so. Thanks!

Note You need to log in before you can comment on or make changes to this bug.