[systemd-devel] How to prevent sleep during running oneshot units

Andrey Borzenkov arvidjaar at gmail.com
Tue Feb 11 18:55:38 PST 2014


В Wed, 12 Feb 2014 02:12:15 +0100
Kai Krakow <hurikhan77 at gmail.com> пишет:

> > See systemd-inhibit(1).
> 
> Yeah, I've read that of course. Maybe I didn't get the complete picture but 
> from the man page it's supposed to work by running systemd-inhibit on the 
> command line. This in turn means, I'd need to place ExecStartPre and 
> ExecPostStop hooks in the unit file.

No, you need to wrap your command with it. I.e. instead of

ExecStart=/path/to/backup-command ...

you use

ExecStart=/usr/bin/systemd-inhibit /path/to/backup-command ...


More information about the systemd-devel mailing list