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

Bug #1367214 reported by Ivan Voras on 2014-09-09
This bug affects 11 people
Affects Status Importance Assigned to Milestone
upstart (Ubuntu)

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

# 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.

Ivan Voras (ivoras) wrote :

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

# ls /etc/init/*ssh*

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

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)
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).

Launchpad Janitor (janitor) wrote :

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

Changed in upstart (Ubuntu):
status: New → Confirmed
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.

kay (kay-diam) wrote :

Have the same bug on fresh ubuntu 14.04 LTS.

--system helped

kay (kay-diam) wrote :

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

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.

OkropNick (okropnick) wrote :

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

Shawn Poquette (kickit2) wrote :

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

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?

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  Edit
Everyone can see this information.

Other bug subscribers