Upstart command line tools behave differently if used with sudo than as root

Bug #1481967 reported by Jure Sah
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
upstart
Invalid
Undecided
Unassigned

Bug Description

Upstart command line tools such as "service", "start" and "stop" behave differently if used as root, or if used with sudo.

For example:
$ sudo service network-manager status
network-manager start/running, process 27764

However:

$ su
# service network-manager status
status: Unknown job: network-manager

Furthermore, bewilderingly:

$ sudo -i
# service network-manager status
network-manager start/running, process 27764

The command should not behave differently depending on the way in which the administrator enters root privileges.

Revision history for this message
Steve Langasek (vorlon) wrote :

$ env|grep UPST
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/21059
UPSTART_INSTANCE=
UPSTART_EVENTS=xsession started
UPSTART_JOB=unity7
$

It behaves differently based on the process environment - as many programs do. If you want to query the status of system-level jobs, you can use 'status --system' to bypass the per-user session.

And if you want the behavior of 'su' to not be tainted by your user environment, run 'su -'.

Changed in upstart:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.