[systemd-devel] after=user.slice not enforced

Cédric BRINER cedric.briner at unige.ch
Tue Nov 22 15:53:34 UTC 2016


Hi,

sapRunning service contains a "After=user.slice". But at the shutdown, a
process (write-sysv-test.pl) running in user.slice is killed before the
end of the sapRunning's stop.

# cat sapRunning.service
[Unit]
Description=SAP Service to ensure stopsap during shutdown
After=local-fs.target network-online.target remote-fs.target user.slice
ora_lsnr_DEV.service

[Service]
ExecStart=/usr/local/bin/sapRunning
ExecStop=/usr/local/bin/stop-sapRunning
Restart=no
TimeoutStopSec=5min

[Install]
WantedBy=multi-user.target

# systemctl status
 CGroup: /
           ├─1 /usr/lib/systemd/systemd --switched-root --system
--deserialize 2
           ├─user.slice
           │ ├─user-0.slice
           │ │ └─session-2.scope
           │ │   ├─15483 sshd: root at pts/0
           │ │   ├─15485 -bash
           │ │   ├─15783 /usr/bin/perl /usr/local/bin/write-sysv-test.pl
           │ │   ├─15800 systemctl status
           │ │   └─15801 less


# systemctl status sysv-test.service
● sysv-test.service - sysv-test
   Loaded: loaded (/etc/systemd/system/sysv-test.service; enabled;
vendor preset: disabled)
   Active: active (exited) since Tue 2016-11-22 10:18:39 CET; 12min ago
  Process: 13688 ExecStart=/usr/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 13688 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/sysv-test.service

Nov 22 10:18:39 spinelle1 systemd[1]: Started sysv-test.
Nov 22 10:18:39 spinelle1 systemd[1]: Starting sysv-test...


So what did we missed so that the verb stop of sapRunning.service can
not see this write-sysv-test.pl anymore ?

Regards.


cED
-- 
Cédric BRINER, Ing. EPFL & HES
+41 (0)22 / 379 71 83


More information about the systemd-devel mailing list