Re: rc.local.shutdown equivalent in systemd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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/


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux