Bug 5735

Summary: systemd - start/stop service - fails to stop the service
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ionut Chisanovici <ionutx.chisanovici>
Component: coreAssignee: Saul Wold <sgw>
Status: VERIFIED FIXED QA Contact: Ionut Chisanovici <ionutx.chisanovici>
Severity: normal    
Priority: Undecided CC: bogdanx.a.voiculescu, meta.mr.watcher, meta.watcher, sstncr
Version: 1.6   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ionut Chisanovici 2014-01-17 08:48:59 UTC
STATUS: RUNNING
BUILD: 1.6_M2_RC1: e4c23f7bcb79072ea6028fbdf8f3f0dc17a63371
ENVIRONMENT: Multiple environments
STEPS TO REPRODUCE: 
  
Prepare a core-image-minimal image with systemd support and launch it. 
     Refer to TC-549 in order how to build it.
Show status of a service
    # systemctl show syslog.socket
Stop a running service:
    # systemctl stop syslog.socket
Start a stopped service:
    # systemctl start syslog.socket
Restart a stopped service:
    # systemctl restart syslog.socket


EXPECTED OUTCOME: 2. Information should be displayed for the service
3. The service stops
4. The service starts

Actual outcome:

Systemctl doesn't stop the service:

root@qemux86:~# systemctl stop syslog.socket
root@qemux86:~# systemctl status syslog.socket
syslog.socket - Syslog Socket
   Active: inactive (dead) since Fri 2014-01-17 08:42:36 UTC; 6min ago
     Docs: man:systemd.special(7)
           http://www.freedesktop.org/wiki/Software/systemd/syslog
   Listen: /run/systemd/journal/syslog (Datagram)

Jan 17 08:42:36 qemux86 systemd[1]: Stopping Syslog Socket.
Jan 17 08:42:36 qemux86 systemd[1]: Closed Syslog Socket.
Jan 17 08:49:02 qemux86 systemd[1]: Closed Syslog Socket.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
root@qemux86:~# ps | grep syslog
  100 root      2480 S    /sbin/syslogd -n -C
  134 root      2420 S    grep syslog
root@qemux86:~# systemctl start syslog.socket
Job for syslog.socket failed. See 'systemctl status syslog.socket' and 'journalctl -xn' for details.
root@qemux86:~# systemctl status syslog.socket
syslog.socket - Syslog Socket
   Loaded: loaded (/lib/systemd/system/syslog.socket; static)
   Active: inactive (dead) since Fri 2014-01-17 08:42:36 UTC; 6min ago
     Docs: man:systemd.special(7)
           http://www.freedesktop.org/wiki/Software/systemd/syslog
   Listen: /run/systemd/journal/syslog (Datagram)

Jan 17 08:42:36 qemux86 systemd[1]: Stopping Syslog Socket.
Jan 17 08:42:36 qemux86 systemd[1]: Closed Syslog Socket.
Jan 17 08:49:02 qemux86 systemd[1]: Closed Syslog Socket.
Jan 17 08:49:27 qemux86 systemd[1]: Starting Syslog Socket.
Jan 17 08:49:27 qemux86 systemd[1]: Socket service busybox-syslog.service a...g.
Jan 17 08:49:27 qemux86 systemd[1]: Failed to listen on Syslog Socket.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
Hint: Some lines were ellipsized, use -l to show in full.
root@qemux86:~# /etc/init.d/syslog stop
Stopping syslogd/klogd: stopped syslogd (pid 100)
stopped klogd (pid 99)
done
root@qemux86:~# systemctl status syslog.socket
syslog.socket - Syslog Socket
   Loaded: loaded (/lib/systemd/system/syslog.socket; static)
   Active: inactive (dead) since Fri 2014-01-17 08:42:36 UTC; 7min ago
     Docs: man:systemd.special(7)
           http://www.freedesktop.org/wiki/Software/systemd/syslog
   Listen: /run/systemd/journal/syslog (Datagram)

Jan 17 08:42:36 qemux86 systemd[1]: Stopping Syslog Socket.
Jan 17 08:42:36 qemux86 systemd[1]: Closed Syslog Socket.
Jan 17 08:49:02 qemux86 systemd[1]: Closed Syslog Socket.
Jan 17 08:49:27 qemux86 systemd[1]: Starting Syslog Socket.
Jan 17 08:49:27 qemux86 systemd[1]: Socket service busybox-syslog.service a...g.
Jan 17 08:49:27 qemux86 systemd[1]: Failed to listen on Syslog Socket.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
Hint: Some lines were ellipsized, use -l to show in full.
root@qemux86:~# systemctl start syslog.socket
root@qemux86:~# systemctl status syslog.socket
syslog.socket - Syslog Socket
   Loaded: loaded (/lib/systemd/system/syslog.socket; static)
   Active: active (running) since Fri 2014-01-17 08:49:48 UTC; 2s ago
     Docs: man:systemd.special(7)
           http://www.freedesktop.org/wiki/Software/systemd/syslog
   Listen: /run/systemd/journal/syslog (Datagram)

Jan 17 08:49:48 qemux86 systemd[1]: Starting Syslog Socket.
Jan 17 08:49:48 qemux86 systemd[1]: Listening on Syslog Socket.

Cheers,
Ionut C
Comment 1 Stefan Stanacar 2014-01-20 18:38:15 UTC
This isn't a bug, it's intended behaviour. You should stop/start the .service file for syslog (be it busybox-syslog or whatever is in that image). systemd here restarts the socket that's why it's still running (because it's required by the service file).
I've updated the TC to use avahi-daemon.service
Comment 2 Ionut Chisanovici 2014-01-21 08:53:38 UTC
Ok, this will be closed.
Verified.

Ionut C