Running initctl as root broken
Bug #1318679 reported by
Robin McCorkell
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
New
|
Undecided
|
Unassigned |
Bug Description
Running initctl with the UPSTART_SESSION environment variable set causes the --user option to be implicitly set. This fails when the user is logged in as root, as any calls to initctl that affect system services (such as start, stop, restart) fail with 'Unknown job'. Unsetting UPSTART_SESSION restores functionality. This does not affect running initctl under sudo as sudo removes all environment variables.
Alternative to unsetting UPSTART_SESSION one can use "--system" to operate against system init. (Even as a normal user, e.g. to query status of system jobs)
Upstart version 1.12.1-0ubuntu4 on Ubuntu 14.04 amd64
description: | updated |
To post a comment you must log in.
This implies you are logging into a graphical session as root. In which case, you will be running upstart as a Session Init to manage that root graphical session. So, to switch to managing the system instead, yes you will need to unset UPSTART_SESSION.
As you say, sudo does not suffer from the issue, neither does logging in as root via a console (as would commonly be done on server systems) since no Session Init is started.
As outlined in the Trusty Release notes [1], you can also specify --system to the initctl command as an alternative to unsetting UPSTART_SESSION.
[1] - https:/ /wiki.ubuntu. com/TrustyTahr/ ReleaseNotes/ TechnicalOvervi ewUpstart.