Please add --system to initctl calls from service
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sysvinit (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Description of the problem:
If the user is using the service command they are almost certainly trying to control system daemons but can wind up looking at only user session daemons.
Steps to reproduce:
1. Install KUbuntu 14.04.
2. Graphically log in as a regular user.
3. Run
service ufw status
Expected result:
To be told whether the ufw service is running.
Actual result:
status: Unknown job: ufw
How reproducible is this problem:
It happens every time.
Additional information:
The issue arises because UPSTART_SESSION is set which makes initctl think it should use a user session. If UPSTART_SESSION is cleared away (which happens when using sudo) then this problem isn't encountered when using the service command. However, if the user just uses su then the UPSTART_SESSION can be inherited and even though the user is root they can't find the services they are expecting. One way round this would be to make the service command always use the system session because it's highly unlikely someone is using it to access user sessions.
This is related to bug #1318679 and there are reports of this problem scattered over the place (see bug #1367214 , http://
Version information:
Ubuntu 14.04.3 LTS
sysvinit-utils 2.88dsf-41ubuntu6.3
tags: | added: trusty |
Adding patch that always uses the system upstart session.