dependency-only .service

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have several programs A, B and C that, while they are running, require memcached.service to be running.
When none of A, B, or C is running, I want memcached.service to not run either.
A, B and C should share the same memcached instance.

How do I best express this?

I was thinking I would have a foo@.service, which would be started by A, B and C as foo@A, foo@B, and foo@C right when they come up, and stopped before they quit. This foo@.service would have a dependency on memcached.service, but otherwise not do anything.

1. There isn’t a Type=Noop, so having an ExecStart=/bin/true might be my best option?

2. How do I get memcached.service to stop automatically? A Requires= seems to keep it running even after all foo@.service have gone away.

Is there a better way of doing this?

Thanks,



Johannes.

_______________________________________________
systemd-devel mailing list
systemd-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/systemd-devel




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux