xubuntu 14.04 service start,stop, does not work in terminal emulation
Bug #1303769 reported by
awol
This bug affects 8 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
xubuntu from installer-
e.g.
> service smbd restart
stop: Unknown job: smbd
start: Unknown job: smbd
however on tty1 this works as expected. i.e. the smbd is stopped then started again with a process number given in output.
affects: | ubuntu → upstart (Ubuntu) |
Changed in upstart (Ubuntu): | |
assignee: | Ahmad Bin Musa (ahmadbinmusa) → nobody |
To post a comment you must log in.
After much banging my head and googling, I've found a post (http:// unix.stackexcha nge.com/ questions/ 120050/ sudo-service- vsftpd- returns- unknown- job-vsftpd) showing that
"sudo service xxxx start" (or stop, or restart)
works, while
"service xxxx start" (in a su session)
does not work.
So the culprit was clearly the environment: If you go root with "su" instead of "sudo su" or "su -", "service" does not to work correctly either, as "su" will carry most of your normal user environment to the root session.
After some testings, I found that the culprit is the UPSTART_SESSION environment variable, which comes set when you "su", but not set when you "sudo su" or "su -". Here are some test results:
-- does not work /home/jsveiga# service smbd restart
jsveiga@dell:~$ su
Password:
root@dell:
stop: Unknown job: smbd
start: Unknown job: smbd
-- works even from a su session /home/jsveiga# sudo service smbd restart
root@dell:
smbd stop/waiting
smbd start/running, process 3823
-- works /home/jsveiga# exit /home/jsveiga# service smbd restart
root@dell:
jsveiga@dell:~$ sudo su
root@dell:
smbd stop/waiting
smbd start/running, process 3862
-- works /home/jsveiga# exit
root@dell:
jsveiga@dell:~$ su -
Password:
root@dell:~# service smbd restart
smbd stop/waiting
smbd start/running, process 3905
-- going su then unsetting the UPSTART_SESSION works /home/jsveiga# exit /home/jsveiga# service smbd restart /home/jsveiga# unset UPSTART_SESSION /home/jsveiga# service smbd restart
root@dell:
jsveiga@dell:~$ su
Password:
root@dell:
stop: Unknown job: smbd
start: Unknown job: smbd
root@dell:
root@dell:
smbd stop/waiting
smbd start/running, process 4244
So the start/stop scripts are failing somehow simply by the presence of the UPSTART_SESSION environment variable.
BR,
Joao S Veiga