[systemd-devel] Run cleanup service on stop

Kai Hendry hendry at webconverger.com
Mon Nov 2 22:21:59 PST 2015

Hi there guys,

I have a service where it's important that it cleans up *after* it's
run. In fact it's probably a good idea to make sure it's clean *before*
it's run too.

I got as far as:


But that does not seem to clean on stop (say if the machine is shutting
down). What am I missing?

My alternative approach which seems to work is to use:


But it looks a little ugly. Here is my source:

Be great to review/critique and suggestions for improvement. I would
like to get $HOME onto a private tmpfs going into the future, though I
am not sure how to achieve that with systemd. Are there any similar
examples I could study?

Many thanks,

More information about the systemd-devel mailing list