[arch-general] rc.local.shutdown equivalent in systemd

Genes MailLists lists at sapience.com
Mon Jul 23 22:07:02 EDT 2012


On 07/23/2012 09:10 PM, Manolo Martínez wrote:

>
> Hence my question: what's the systemd native way to do stuff (in my
> case, remove a module) before shutdown?
>


  You might try something like this (untested as I am not currently 
using systemd)- I'm not sure if you need the Before= since your "stuff" 
is in ExecStop ... I'm also not sure how to guarantee system logging is 
still active when your program runs ... but perhaps there are experts 
here who can help.

[unit]
      Before=shutdown.target
      ...

[Service]
      Type=oneshot
      RemainAfterExit=true
       ExecStart=/bin/true
      ExecStop=<your stuff>

Gene/


More information about the arch-general mailing list