Wednesday, 13 January 2016

Re: Is it possible to query systemd target?

On Wed, Jan 13, 2016 at 06:06:01PM +0100, Stefan Bader wrote:
> >> Right now (at least Wily+Xenial) there is a non fatal but annoying problem with
> >> Xen. On shutdown/reboot systemd tries to unmount several file systems. One of
> >> which is /proc/xen. Right now Xen still uses /etc/init.d/xen for start/stop. The
> >> same script is also called via invoke-rc.d from *.prerm/*.postinst (which might
> >> be another place to modernize at some point). And because of that there is one
> >> daemon (xenstored) that must be kept running on stop (otherwise state info on
> >> guests running during the upgrade is lost).

> > I'm a bit lost here -- what does the xen init.d script have to do with
> > cleaning up mounts during shutdown? When you say "systemd tries to
> > unmount several file systems", that's happening very late after every
> > service has stopped and it basically does the equivalent of "umount -a",
> > right? (This is "umount.target", see man systemd.special.)

> Right so something (likely the umount.target) does the umount late on
> shutdown after all services stopped. xen currently is not a service but
> sysV script. It was called but does not stop that one daemon (because the
> same script is called on pkg upgrade). And because the daemon keeps the
> mount busy umount -a fails.

This sounds to me like a correct solution is to split your init script into
multiple scripts, and use the correct dh_installinit options for each in
debian/rules (i.e., dh_installinit --no-restart-on-upgrade).

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
[email protected] [email protected]