Bug 684807 - service sshd status show sfailed state after successful stop
Summary: service sshd status show sfailed state after successful stop
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: openssh
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan F. Chadima
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-14 14:58 UTC by Petr Lautrbach
Modified: 2011-03-17 07:41 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-17 07:41:36 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Petr Lautrbach 2011-03-14 14:58:03 UTC
# service sshd start
Starting sshd (via systemctl):                             [  OK  ]

# service sshd status
sshd.service - LSB: Start up the OpenSSH server daemon
          Loaded: loaded (/etc/rc.d/init.d/sshd)
          Active: active (running) since Mon, 14 Mar 2011 15:56:13 +0100; 2s ago
         Process: 7377 ExecStop=/etc/rc.d/init.d/sshd stop (code=exited, status=0/SUCCESS)
         Process: 7404 ExecStart=/etc/rc.d/init.d/sshd start (code=exited, status=0/SUCCESS)
        Main PID: 7411 (sshd)
          CGroup: name=systemd:/system/sshd.service
                  └ 7411 /usr/sbin/sshd

# service sshd stop
Stopping sshd (via systemctl):                             [  OK  ]

[ 7427.106976] systemd[1]: Accepted connection on private bus.
[ 7427.110327] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Manager.StopUnit() on /org/freedesktop/systemd1
[ 7427.112074] systemd[1]: Trying to enqueue job sshd.service/stop/replace
[ 7427.113234] systemd[1]: Installed new job sshd.service/stop as 935
[ 7427.114340] systemd[1]: Enqueued job sshd.service/stop as 935
[ 7427.119137] systemd[1]: About to execute: /etc/rc.d/init.d/sshd stop
[ 7427.132695] systemd[1]: Forked /etc/rc.d/init.d/sshd as 7447
[ 7427.133760] systemd[1]: sshd.service changed running -> stop
[ 7427.138136] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Manager.GetUnit() on /org/freedesktop/systemd1
[ 7427.140835] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Properties.Get() on /org/freedesktop/systemd1/unit/sshd_2eservice
Stopping sshd: [ 7427.179917] systemd[1]: Received SIGCHLD
[ 7427.180997] systemd[1]: Got SIGCHLD for process 7411 (sshd)
[ 7427.181999] systemd[1]: Child 7411 died (code=exited, status=255/n/a)
[ 7427.183122] systemd[1]: Child 7411 belongs to sshd.service
[ 7427.184102] systemd[1]: sshd.service: main process exited, code=exited, status=255
[  OK  ]
[ 7427.254310] systemd[1]: Received SIGCHLD
[ 7427.256613] systemd[1]: Got SIGCHLD for process 7447 (sshd)
[ 7427.257659] systemd[1]: Child 7447 died (code=exited, status=0/SUCCESS)
[ 7427.258796] systemd[1]: Child 7447 belongs to sshd.service
[ 7427.259872] systemd[1]: sshd.service: control process exited, code=exited status=0
[ 7427.265092] systemd[1]: sshd.service got final SIGCHLD for state stop
[ 7427.266281] systemd[1]: sshd.service changed stop -> failed
[ 7427.267414] systemd[1]: Job sshd.service/stop finished, result=done
[ 7427.272333] systemd[1]: Unit sshd.service entered failed state.
[ 7427.274689] systemd[1]: Accepted connection on private bus.
[ 7427.275881] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local
[ 7427.278272] systemd[1]: Got D-Bus request: org.freedesktop.systemd1.Agent.Released() on /org/freedesktop/systemd1/agent
[ 7427.280134] systemd[1]: sshd.service: cgroup is empty
[ 7427.281498] systemd[1]: Got D-Bus request: org.freedesktop.DBus.Local.Disconnected() on /org/freedesktop/DBus/Local


# service sshd status
sshd.service - LSB: Start up the OpenSSH server daemon
          Loaded: loaded (/etc/rc.d/init.d/sshd)
          Active: failed since Mon, 14 Mar 2011 15:56:38 +0100; 14s ago
         Process: 7447 ExecStop=/etc/rc.d/init.d/sshd stop (code=exited, status=0/SUCCESS)
         Process: 7404 ExecStart=/etc/rc.d/init.d/sshd start (code=exited, status=0/SUCCESS)
        Main PID: 7411 (code=exited, status=255)
          CGroup: name=systemd:/system/sshd.service

Comment 1 Petr Lautrbach 2011-03-14 14:58:25 UTC
systemd-20-1.fc15.x86_64
openssh-server-5.6p1-30.fc15.x86_64

Comment 2 Jóhann B. Guðmundsson 2011-03-14 15:09:11 UTC
What happens if you start the sshd from cli

usr/sbin/sshd -f /etc/ssh/sshd_config 

Does it run then if not try starting it with the tests switch to see if it does not spew out something useful on why it's failing to start..

usr/sbin/sshd -t -f /etc/ssh/sshd_confi

usr/sbin/sshd -T -f /etc/ssh/sshd_confi

Comment 3 Petr Lautrbach 2011-03-14 15:30:04 UTC
It's not failing to start. It's not even failing to stop. It says that sshd.service is in failed state after successful stop.

Comment 4 Jóhann B. Guðmundsson 2011-03-14 15:37:17 UTC
Ahh so you expect to see "Active: stopped" instead of "Active: failed" when service has been stopped and systemctl status $foo.service is run.

Makes sense.

Comment 5 Petr Lautrbach 2011-03-14 15:46:41 UTC
more likely 'inactive (dead)', see httpd.service:

# service httpd stop
Stopping httpd (via systemctl):                            [  OK  ]

# service httpd status
httpd.service - LSB: start and stop Apache HTTP Server
          Loaded: loaded (/etc/rc.d/init.d/httpd)
          Active: inactive (dead) since Mon, 14 Mar 2011 16:44:31 +0100; 2s ago

Comment 6 Jóhann B. Guðmundsson 2011-03-14 16:04:48 UTC
Makes more sense to me that it would say "Active: Stopped" or "Active: inactive (stopped)" if the service had been successfully stopped both failed and/or dead indicate that the service was not successfully stopped at least that's how I perceive it but yes it should be consistent.

Comment 7 Michal Schmidt 2011-03-14 16:18:27 UTC
Arguably sshd's main process should exit with code 0, not 255, when asked to stop peacefully.

Comment 8 Lennart Poettering 2011-03-15 02:10:20 UTC
Yes, it appears that sshd is returning exit code 255 here, which indicates failure and systemd just records that and shows that by putting the service in "failed" state. If sshd manages to shut down cleanly it should just exit with exit code 0.

Comment 9 Jan F. Chadima 2011-03-17 07:41:36 UTC
repaired in rawhide


Note You need to log in before you can comment on or make changes to this bug.