Bug 101408 - daemon --user option does not work from cron (su: standard in must be a tty)
daemon --user option does not work from cron (su: standard in must be a tty)
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2003-07-31 14:48 EDT by Vilius Puidokas
Modified: 2014-03-16 22:37 EDT (History)
1 user (show)

See Also:
Fixed In Version: FC4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-30 15:11:55 EDT
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 Vilius Puidokas 2003-07-31 14:48:07 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4b)
Gecko/20030516 Mozilla Firebird/0.6

Description of problem:
i was working on a startup script for our homegrown daemon and realized that
--user option seems to get broken if script is invoked from crond.

looks like it's su which doesn't like non tty stdin. any ideas how can this be
fixed? i assume 'su' has a valid reason here.

 workaround: make daemon change uid.

Jul 30 23:55:01 xxx draft-robot: draft-robot shutdown succeeded
Jul 30 23:55:01 xxx su: standard in must be a tty
Jul 30 23:55:01 xxx draft-robot: baseball startup failed

and cronjob output:
Starting up draft-robot [baseball]standard in must be a tty

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. call from cron: daemon --user=foo "sleep 60 &"

Additional info:
Comment 1 Vilius Puidokas 2003-07-31 17:32:29 EDT
source of trouble seems to be /sbin/initlog;

also, enhanced logic might be acceptable in daemon():

iam=`id -un`
if [ -z "$user" -o "$iam" = "$user" ]; then
Comment 2 Bill Nottingham 2005-09-30 15:11:55 EDT
Closing bugs on older, no longer supported, releases. Apologies for any lack of

Current releases, such as FC4 a) use 'runuser' b) don't use 'initlog'.

Ergo, this should be solved.

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