[systemd-devel] Combination of Requisite/After works weird

Michal Vyskocil mvyskocil at suse.cz
Wed May 25 01:21:13 PDT 2011


Hi,

I found the weird behavior of combination of Requisite and After. Having
following two units

# cat x.service
[Unit]
Description=unit %n
Requisite=y.service

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/bin/echo "unit %n started"
ExecStop=-/bin/echo "unit %n stopped"
StandardOutput=syslog

#cat y.service
[Unit]
Description=unit %n
After=x.service

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=-/bin/echo "unit %n started"
ExecStop=-/bin/echo "unit %n stopped"
StandardOutput=syslog

I'm able to start x.service, even if y.service is not active. But I'd
expect the dependency fail here, because you cannot start the Requisite
unit after.

# systemctl show --property=ActiveState y.service
ActiveState=inactive
# systemctl start x.service
# systemctl show --property=ActiveState x.service
ActiveState=active
# systemctl show --property=ActiveState y.service
ActiveState=inactive

When I remove the After=x.service, or use Before= (which has not effect
in this case) from y.service, everythings works well, x.service refuse
to start if y.service is not active.

I use systemd-27.

Regards
Michal Vyskocil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20110525/2daeaa6d/attachment.pgp>


More information about the systemd-devel mailing list