[systemd-devel] SYSTEMD_WANTS and oneshot services

Lennart Poettering lennart at poettering.net
Wed Aug 24 05:04:56 PDT 2011


On Wed, 24.08.11 13:26, Albert Strasheim (fullung at gmail.com) wrote:

> When reloading the module, there is no transaction in the debug log.
> 
> When I strace systemd, I can see that epoll returns and that systemd
> calls recvmsg twice for the netlink messages about the two network
> ports. systemd doesn't do anything else after that.
> 
> At this point, a systemctl daemon-reload followed by a systemctl
> status still yields an active (exited) service. Reloading the module
> after the systemctl daemon-reload still does not rerun the service.

"active (exited)" suggests that you set RemainAfterExit=yes?

> I must then do systemctl stop foo-net-em1.service.

So it apparently did run. So everything is in order?

> 
> Then systemctl status says:
> 
> foo-net-em1.service
>           Loaded: loaded (/etc/systemd/system/foo-net-em1.service)
>           Active: inactive (dead)
>           CGroup: name=systemd:/system/foo-net-em1.service
> 
> If I then load the module again, I get the transaction as expected and
> the service is started again.
> 
> Maybe the service should have a Requisite= on the
> sys-subsystem...device so that it is stopped when the device
> disappears? I tried this, but the subsystem alias still doesn't seem
> to work, even with the fixed udev rules.

You need BindTo=, not Requires= for that.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list