Newly installed openssh-server and upstart: status: Unknown job: ssh

Bug #1367214 reported by Ivan Voras
62
This bug affects 11 people
Affects Status Importance Assigned to Milestone
upstart (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Just after installing openssh-server, there is no ssh service in the initctl's list. Consequently, the SSH server cannot be started:

# initctl start ssh
initctl: Unknown job: ssh

# dpkg -l | grep ssh
ii openssh-client 1:6.6p1-2ubuntu2 i386 secure shell (SSH) client, for secure access to remote machines
ii openssh-server 1:6.6p1-2ubuntu2 i386 secure shell (SSH) server, for secure access from remote machines

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"

# initctl reload-configuration
# initctl list | grep ssh
ssh-agent start/running

# ps axuw | grep ssh
ivoras 1578 0.0 0.0 4216 200 ? Ss Sep08 0:00 ssh-agent -s
root 11810 0.0 0.0 6168 852 pts/2 S+ 11:26 0:00 grep ssh

# initctl start ssh
initctl: Unknown job: ssh

Running "/etc/init.d/ssh" does not do anything since the script exits, AFAIK in the upstart check.
Running "service ssh restart" results in:

# service ssh restart
stop: Unknown job: ssh
start: Unknown job: ssh

After rebooting the machine, sshd is started (!), but still not visible in "initctl list" (!!) and running /etc/init.d/ssh still doesn't do anything (!!!), as well as the "service" command returning the same "Unknown job: ssh" error.

Exactly the same problem happens with the php5-fpm service. I've also installed nginx and while it can be controlled by using /etc/init.d/nginx , it is not visible in "initctl list".

The question is - how do I control the services in Ubuntu 14.04? This is a fresh install, the ssh service was the first service installed.

Revision history for this message
Ivan Voras (ivoras) wrote :

As an update, the ssh.conf file exists in /etc/init :

# ls /etc/init/*ssh*
/etc/init/ssh.conf

and it looks correct (I haven't modified any files in /etc/init).

Revision history for this message
Ivan Voras (ivoras) wrote :
Revision history for this message
Seth Arnold (seth-arnold) wrote :

I believe this is an upstart issue, the tools appear to be selecting user tasks rather than system tasks. Try adding --system to your various commands:

sarnold@hunt:~$ initctl --system status ssh
ssh start/running, process 1352
sarnold@hunt:~$ initctl status ssh
initctl: Unknown job: ssh

affects: openssh (Ubuntu) → upstart (Ubuntu)
Revision history for this message
Ivan Voras (ivoras) wrote :

Thanks, adding --system apparently helps.

The verbosity is awful / nonexistent, I can only guess the command did anything by seeing the PID changing:

# initctl --system restart ssh
ssh start/running, process 22389
# initctl --system restart ssh
ssh start/running, process 22394

Adding "-v" (the "verbose" switch) apparently doesn't do anything in any of the common initctl commands I've tried (list, start, stop, restart).

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in upstart (Ubuntu):
status: New → Confirmed
Revision history for this message
Psykotik (linux-ikiru) wrote :

This issue also affects mysql package.

$ sudo service mysql restart
stop: unknown job: mysql
start: unknown job: mysql

In other words, both mysql and ssh cannot be restarted.

I have recently upgraded from 12.04 to 14.04, then this bug started affecting mysql and ssh.

Revision history for this message
kay (kay-diam) wrote :

Have the same bug on fresh ubuntu 14.04 LTS.

--system helped

Revision history for this message
kay (kay-diam) wrote :

P.S. "initctl reload-configuration" didn't help

Revision history for this message
Jens Elkner (jelmd) wrote :

Probably because this piece of junk (upstart) just silently discards any *.conf file with errors/unknown directives in it instead of reporting/logging the problem.

Revision history for this message
OkropNick (okropnick) wrote :

I have exactly the same problem after fresh installation of Ubuntu 14.04 (64bit).

Revision history for this message
Shawn Poquette (kickit2) wrote :

Also confirmed after upgrade from functional 12.04 system to 14.04 (both 64 bit). --System flag makes it work

Revision history for this message
Sebastian Wagner (sebix) wrote :

I also have this problem on a client's machine. This leads to failing chef-scripts, that's very annoying.

Does anyone have a solution or workaround, except the --system flag?

Revision history for this message
Sebastian Wagner (sebix) wrote :
Revision history for this message
Anthony Jewell (tjewell) wrote :

Still an issue with a fresh install of Ubuntu 14.04:
$ su
# apt-get install openssh-server
....
initctl: Unknown job: ssh
....
# initctl status ssh
initctl: Unknown job: ssh
# initctl --system status ssh
ssh stop/waiting

But run the su as a login shell:
$ su -
# apt-get install openssh-server
.... (No "Unknown job: ssh) ...
# initctl status ssh
ssh start/running, process 18012

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.