Bug 26894 - daemon() in initscripts functions runs "su" incorrectly
Summary: daemon() in initscripts functions runs "su" incorrectly
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.0
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-02-09 23:30 UTC by Jeremy Portzer
Modified: 2014-03-17 02:18 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-02-12 14:53:05 UTC
Embargoed:


Attachments (Terms of Use)

Description Jeremy Portzer 2001-02-09 23:30:23 UTC
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
environment.  

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 19:17:59 UTC
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.