Thursday 14 January 2016

Re: Is it possible to query systemd target?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBCgAGBQJWl2XKAAoJEOhnXe7L7s6jEMoQAJ17IFdrStxud+FFdIsPWPzB
w15M/6W0Ned9nouedjFbzgra3OSn0Nk++ASvkiPcQgMZSg2qar11vdyo7J2isGNj
52t7yNiGa2KQPLYB0tt/PPcljmilJp0EPJHllPl3S5l8V5x6K85e4Rl8M4x2MlWm
IDFKNYeSdoW6EOkhAo4ONRB6/2HS1GH3uwqGRZeOWVZHJevH5/xExkDIg1AOD+qH
lO+b+6hx4r0ed1SuXm8ppxwLkcacuRfXwfTdf/s5z/+eV5RenxwvjS0CpnfblBN3
IVTzIztkyyNvGtPNzgfz3mTJb9LU6fsjuGMagdc75QIvQewkc5Oee2SAbwi09Kpp
yNoeEEv0ZWYc8hGZPVwH8m3MMySlAoqu8YDOIdPSzjaOzIBpaG+mMpwRBEg8+sZu
YgnX3TAJr/l+jh2aabjtrk7RY3Vi1rtuqZwzjAFljbC917ksyk0mOW4B/TQHRfHS
TMTrL6LcD/MBmPalML38EcYBh104HFSC2jH7ovpO6IKfj8Jcvm3tUY/aTFBbYIt2
ivY7PX5scmO619x6pDzX+yCmOYo/0wt/9KiU7cMEyuCWBWw3QmRPGaYycxGXWCXf
eVSEWXxzfM5kt3Xvr4Gh1fgsU4zAl0o6vgOLrohaWq/cmXA3W508DqSWMCq6AyPA
5nZLSUTusaquM9tY9wlz
=HvLg
-----END PGP SIGNATURE-----
On 13.01.2016 18:50, Steve Langasek wrote:
> 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).
>

Indeed this sounds like a good idea. At minimum split the current "xen" into
"xenstore(d)" and "xen". So the former is not restarted on upgrade and the
latter will be. Might be something that even Debian could "like".

-Stefan