systemd questions

Bill Nottingham notting at redhat.com
Thu May 19 19:55:39 UTC 2011


Simo Sorce (ssorce at redhat.com) said: 
> > > What race are we talking about exactly ?
> > 
> > Host requests power down from UPS in 30s. Host then continues shut
> > down. If the host now ends up taking more time then expected for
> > shutting down it might still be busy at the time of the power going
> > away. It's a race between "UPS powering off" and "system finishing
> > shutdown". It's a bet that your system is faster than 30s when
> > unmounting the remaining file systems, syncing the MD/DM metadata to
> > disk, syncing ATA and so on (i.e. all the stuff the kernel does when you
> > invoke the reboot() syscall).
> 
> You do realize that it is a race to get it done before the UPS runs out
> of battery anyway ?
> 
> It's not perfect, but sysadmins are capable of assessing how much time
> each of their server needs to shut down and make the UPS wait long
> enough (battery permitting of course).

Well, now at least you're agreeing a bit on terms.

In short:

UPS hooks in shutdown are inherently racy as currently implemented. It
doesn't mean they can't be done in systemd. It just means you're accepting
that race as a fact of life (not claiming that they don't exist!).  

So, either:

a) drop a binary in /lib/systemd/system-shutdown
b) create a service that hooks into shutdown.target
c) create a priority-99 SysV service

In parallel, work on fixing the late shutdown process so we can
fix the UPSes we do support to be less racy.

Now, can we work on doing that, instead of shouting at each other?

Bill


More information about the devel mailing list