[systemd-devel] Run cleanup service on stop
Kai Hendry
hendry at webconverger.com
Wed Nov 4 19:17:54 PST 2015
On Wed, 4 Nov 2015, at 05:41 PM, Andrei Borzenkov wrote:
> Why? It sounds like exact use case for Pre/Post commands.
Well, with long lines like:
ExecStartPre=/bin/bash -c 'grep -q noclean /etc/webc/cmdline || for d in
~/{.mozilla,.cache,.adobe,.macromedia,Downloads}; do rm -vrf $d; done'
ExecStopPost=/bin/bash -c 'grep -q noclean /etc/webc/cmdline || for d in
~/{.mozilla,.cache,.adobe,.macromedia,Downloads}; do rm -vrf $d; done'
It looks a little ugly, no? I do realise it could be in a separate shell
script.
Anyway, I'm keen to learn for completeness sake what I am missing, to
trigger a "clean up" service file to execute when stopping my main
service. :}
Thank you,
More information about the systemd-devel
mailing list