/etc/init.d/ssh seems to work, but actually upstart is used.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openssh (Ubuntu) |
Fix Released
|
Medium
|
Clint Byrum | ||
Lucid |
Fix Released
|
Medium
|
Clint Byrum | ||
Maverick |
Fix Released
|
Medium
|
Clint Byrum |
Bug Description
While trying to get x-forwarding on Lucid to work, I edited /etc/default/ssh to add the -4 flag, as offered as a work-around in various bugreports. When trying to restart ssh using /etc/init.d/ssh, all seems to work but my flags around passed to sshd.
It seems that ssh is actually managed by upstart, which is great, but you cannot really tell. For other services, there are symlinks to /lib/init, for ssh there isn't. So I assumed that ssh is still managed using /etc/init.d/
Please clarify the use of upstart (for ssh) for users, so they don't spend hours trying to debug what shouldn't be debugged. :)
== SRU Justification ==
Impact: this bug causes quite a bit of confusion for users, which is particularly troubling considering SSH is often the only way headless systems can be accessed post-installation. The change will avoid the half-in half-out situation that some people are dealing with where they mix /etc/init.d/ssh with using the 'service' command or upstart start/stop/initctl commands.
Dev fix: A check has been added to the included init.d script which checks to see if it is being run in a chroot, and if not, it runs /lib/init/
TEST CASE:
1. start a system with openssh-server installed
2. run 'sudo status ssh' to verify that ssh has been started by upstart.
3. run 'sudo stop ssh' to stop the upstart job.
4. run 'sudo /etc/init.d/ssh start'. It should start sshd without upstart.
5. run 'sudo status ssh' to verify that the ssh upstart job is not running
6. run 'sudo /etc/int.d/ssh stop' to stop the incorrectly managed sshd.
7. install new package with patched init.d script
8. repeat steps 2 through 4. now it should display a disclaimer like this:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service ssh start
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start ssh
Regression Potential:
There may be users who are expecting this script to work outside of chroots. They would have to achieve this by modifying the start on or removing the /etc/init/ssh.conf. The latter case is handled directly in the code by checking for its existence. The former will also be handled on reboot, but not on upgrades. The upgrade will cause the script to be unable to stop any sshd that is running via the old method.
Related branches
- Colin Watson: Approve
- Ubuntu Sponsors: Pending requested
-
Diff: 44 lines (+26/-0)2 files modifieddebian/changelog (+9/-0)
debian/openssh-server.ssh.init (+17/-0)
- Colin Watson: Pending requested
-
Diff: 49 lines (+31/-0)2 files modifieddebian/changelog (+14/-0)
debian/openssh-server.ssh.init (+17/-0)
- Colin Watson: Pending requested
-
Diff: 49 lines (+31/-0)2 files modifieddebian/changelog (+14/-0)
debian/openssh-server.init (+17/-0)
Changed in openssh (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Triaged |
tags: | added: patch |
summary: |
- [LUCID] /etc/init.d/ssh seems to work, but actually upstart is used. + /etc/init.d/ssh seems to work, but actually upstart is used. |
Changed in openssh (Ubuntu): | |
assignee: | nobody → Clint Byrum (clint-fewbar) |
status: | Triaged → In Progress |
Changed in openssh (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in openssh (Ubuntu Lucid): | |
status: | New → Triaged |
Changed in openssh (Ubuntu Maverick): | |
status: | New → Triaged |
Changed in openssh (Ubuntu Lucid): | |
importance: | Undecided → Medium |
Changed in openssh (Ubuntu Maverick): | |
importance: | Undecided → Medium |
Changed in openssh (Ubuntu Lucid): | |
assignee: | nobody → Clint Byrum (clint-fewbar) |
Changed in openssh (Ubuntu Maverick): | |
assignee: | nobody → Clint Byrum (clint-fewbar) |
description: | updated |
So how does one start and stop ssh? I used to use the /etc/init.d script to start and stop sshd, which no longer works. If I kill the sshd process a new one starts up.