[systemd-devel] Processes running after a service has stopped

Ross Lagerwall rosslagerwall at gmail.com
Fri Nov 28 12:03:23 PST 2014


On Fri, Nov 28, 2014 at 07:53:33PM +0100, Lennart Poettering wrote:
> On Fri, 28.11.14 13:42, Ross Lagerwall (rosslagerwall at gmail.com) wrote:
> 
> > The handling of a service with KillMode set to something other than cgroup
> > is a bit confusing (as of systemd 208).
> 
> Hmm, could you test this with newer systemd please? 208 is already
> quite old.
> 
> Where (in terms of: "which cgroup"?) does "systemd-cgls" show the left-over processes?

In it's own cgroup, as would normally be the case:

│ ├─tester.service
│ │ └─24709 /home/ross/Downloads/tester start

> 
> We should show the cgroup contents regardless of the state of a
> service actually, nothing should be hidden there. If things are hidden
> just because of the service state then this would be a bug. If you can
> reproduce it with 217 or so that would be great!
> 

The same behavior seems to occur with 217 (on Arch):
# systemctl start tester.service
# systemctl status tester.service
● tester.service - Tester service
   Loaded: loaded (/etc/systemd/system/tester.service; static)
   Active: active (running) since Fri 2014-11-28 19:46:21 GMT; 4s ago
 Main PID: 25067 (tester)
   CGroup: /system.slice/tester.service
           ├─25067 /home/ross/Downloads/tester start
           └─25068 /home/ross/Downloads/tester start
# systemctl stop tester
# systemctl status tester.service
● tester.service - Tester service
   Loaded: loaded (/etc/systemd/system/tester.service; static)
   Active: inactive (dead)

# ps aux | grep tester
root     25068  0.0  0.0   4048    76 ?        S    19:46   0:00 /home/ross/Downloads/tester start

# systemctl start tester.service
# systemctl status tester.service
● tester.service - Tester service
   Loaded: loaded (/etc/systemd/system/tester.service; static)
   Active: active (running) since Fri 2014-11-28 19:50:58 GMT; 2s ago
 Main PID: 25148 (tester)
   CGroup: /system.slice/tester.service
           ├─25068 /home/ross/Downloads/tester start <-- the left over process!
           ├─25148 /home/ross/Downloads/tester start
           └─25149 /home/ross/Downloads/tester start

With 217, running "systemctl kill --kill-who=all -s KILL tester.service"
doesn't fail, but it doesn't seem to do anything either.

Thanks,
-- 
Ross Lagerwall


More information about the systemd-devel mailing list