[systemd-devel] mount-on-demand for backups; hooks for indicating success/failure
Jonathan Dowland
jon+systemd-devel at alcopop.org
Wed Apr 5 12:39:29 UTC 2017
On Fri, Mar 31, 2017 at 12:01:11PM +0200, Lennart Poettering wrote:
> On recent systemd versions you can plug in a script in ExecStop= of
> your backup service, and check the $SERVICE_RESULT env var which tells
> you the success state of the service, which you can then use to set
> any LEDs you like.
This looks very useful, thanks - but the issue here is that I don't
think systemd provides a guarantee that if my backup service Requires
a mount unit, and that mount unit is marked StopWhenUnneeded=true, that
the this script will fire after the unmount has finished (and
succeeded).
I think Michal's solution of having a separate service for the LEDs
might work, perhaps with After=media-ipod.mount, but I need to
experiment some more.
--
Jonathan Dowland
More information about the systemd-devel
mailing list