Upstart command line tools behave differently if used with sudo than as root
Bug #1481967 reported by
Jure Sah
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.
To post a comment you must log in.
$ env|grep UPST SESSION= unix:abstract= /com/ubuntu/ upstart- session/ 1000/21059 EVENTS= xsession started
UPSTART_
UPSTART_INSTANCE=
UPSTART_
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 -'.