[systemd-devel] howto handle one time shutdown programs

Andrei Borzenkov arvidjaar at gmail.com
Fri Jun 26 00:31:18 PDT 2015


В Thu, 25 Jun 2015 11:09:22 -0700
Johannes Ernst <johannes.ernst at gmail.com> пишет:

> Hallo Andreas,
> 
> > On Jun 25, 2015, at 7:57, Andreas Buschmann <buschman at tech.net.de> wrote:
> > 
> > Hello,
> > 
> > I am writing a systemd .service file to handle NVDIMMs.
> > 
> > - start
> > - stop
> > - reload
> > all work
> > 
> > The problem child is "restart".
> > Restart is internally implemented as stop followed by start.
> > 
> > The problem is, that stop calls a program which does something to the
> > NVDIMM hardware.
> > After that no further access to the NVDIMMs is possible before the next
> > reboot of the server.
> > 
> > How should I handle that sort of logic with systemd?
> 
> How is that different from the user executing:
> 
> systemctl start your.service
> systemctl stop your.service
> systemctl start your.service
> 
> without reboot?
> 

Those initscripts I am aware of avoided this issue by not stopping
anything on restart. This made it possible to do "service foo restart"
without losing its state. Converting such services to systemd unit
breaks things.

Such restarts happen without user explicit intervention e.g. during
package updates.


More information about the systemd-devel mailing list