[systemd-devel] Requires too weak, BindTo too strong

Lennart Poettering lennart at poettering.net
Wed Feb 1 11:07:36 PST 2012


On Wed, 01.02.12 18:54, Chris Paulson-Ellis (chris at edesix.com) wrote:

> I've got a client service (client.service) that requires a server
> service (server.service). They are weakly coupled by a polling http
> protocol, but the client needs to restart when server does or it can
> get into trouble in it's state machine (and can't easily be re-coded
> to cope).
> 
> If I use Requires=server.service in client.service, then the client
> correctly restarts when systemctl is used to restart server.service.
> However, if the server crashes and is restarted (Restart=always in
> server.service), then client is left running.
> 
> If I change Requires=server.service to BindTo=server.service in
> client.service, then the client is stopped when the server crashes,
> but it is not restarted.
> 
> Is there some way to get the client to always restart when server
> restarts, for whatever reason?

No, there isn't. But what you describe is something I consider a bug,
and to fix this has been on the TODO list for a while. i.e. a server
dying and being restarted should still cause all services depending on
it to restart.

Hence: expect this to be fixed for you soon, so that BindTo works as
expected.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list