On Thu, Sep 12, 2013 at 06:51:49PM +0200, Lennart Poettering wrote: > On Fri, 19.07.13 09:17, Lukáš Nykrýn ([email protected]) wrote: > > > Hi, > > when service has StopWhenUnneeded=yes and it is requested by forking > > service, which fails during initialization, the first unit is not > > stopped.
Hi Lennart, > > I have added this to the TODO list for now, so that we don't > forget. I'll look into it after the next release. > Thank you for taking the time to look into this. > (Sorry for the delay) No worries. :) > > > > > Reproducer: > > > > -bash-4.2# more /etc/systemd/system/test* > > :::::::::::::: > > /etc/systemd/system/test.service > > :::::::::::::: > > [Unit] > > Description=aaa > > Requires=testb.service > > > > [Service] > > Type=forking > > ExecStart=/bin/sleep 50 > > TimeoutStartSec=3 > > > > :::::::::::::: > > /etc/systemd/system/testb.service > > :::::::::::::: > > [Unit] > > Description=aaa > > StopWhenUnneeded=yes > > > > [Service] > > Type=oneshot > > RemainAfterExit=yes > > ExecStart=/bin/echo hej > > ExecStop=/bin/echo hou > > > > -bash-4.2# systemctl status testb test > > testb.service - aaa > > Loaded: loaded (/etc/systemd/system/testb.service; static) > > Active: inactive (dead) > > > > > > test.service - aaa > > Loaded: loaded (/etc/systemd/system/test.service; static) > > Active: inactive (dead) > > > > -bash-4.2# systemctl start test > > Job for test.service failed. See 'systemctl status test.service' and > > 'journalctl -xn' for details. > > > > -bash-4.2# systemctl status testb test > > testb.service - aaa > > Loaded: loaded (/etc/systemd/system/testb.service; static) > > Active: active (exited) since Thu 2013-07-18 15:34:34 CEST; 7s ago > > Process: 45 ExecStart=/bin/echo hej (code=exited, status=0/SUCCESS) > > > > Jul 18 15:34:34 mycontainer systemd[1]: Starting aaa... > > Jul 18 15:34:34 mycontainer systemd[1]: Started aaa. > > > > test.service - aaa > > Loaded: loaded (/etc/systemd/system/test.service; static) > > Active: failed (Result: timeout) since Thu 2013-07-18 15:34:37 > > CEST; 4s ago > > Process: 46 ExecStart=/bin/sleep 50 (code=killed, signal=TERM) > > > > Jul 18 15:34:34 mycontainer systemd[1]: Starting aaa... > > Jul 18 15:34:37 mycontainer systemd[1]: test.service operation timed > > out. Terminating. > > Jul 18 15:34:37 mycontainer systemd[1]: Failed to start aaa. > > Jul 18 15:34:37 mycontainer systemd[1]: Unit test.service entered > > failed state. > > > Lennart > > -- > Lennart Poettering - Red Hat, Inc. _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
