[systemd-devel] Scheduling emptyings of specific directories

Lennart Poettering lennart at poettering.net
Fri Jun 3 15:44:01 UTC 2016


On Fri, 03.06.16 18:40, Andrei Borzenkov (arvidjaar at gmail.com) wrote:

> 03.06.2016 16:06, One Infinite Loop пишет:
> > It would be great if I could empty directories (creating a .conf file
> > in /etc/tmpfiles.d) but not at boot time, but before shutting
> > down/rebooting the pc. I am using systemd 229. Thanks in advance.
> 
> Just create a oneshot, RemainAfterExit service with empty ExecStart and
> put your call to systemd-tmpfiles into ExecStop (or probablyl ExecStopPost).

Yes, i think this would be the best option. Note that you can invoke
"systemd-tmpfiles" from the command line and specify any configuration
file you rlike.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list