s6-svscan shutdown notification

From: Jan-willem De Bleser <jw_at_thescrapyard.org>
Date: Wed, 23 Feb 2022 17:27:19 -0800

Hi,

What's the cleanest way to wait on s6-svscan to shut down after issuing of
a SIGTERM (say s6 via-svscanctl -t)?

I'm using s6 to manage daemons in FreeBSD jails, and am trying to work out
the cleanest way to shut things down. I want to use the built-in 'jail'
command for this since it takes care of host operations like unmounting the
jail filesystems and recovering/freeing network interfaces, but in and of
itself it just issues a SIGKILL inside the jail. It can optionally run a
shutdown script, say one that calls "s6-svscanctl -t", but I need some way
to delay the ending of that script until the supervision tree has actually
shut down: some of the managed processes will need to flush data to disk.

Looking at the documentation, my only option appears to be to check if the
return code of s6-svscanctl is 100, or maybe to monitor for the existence
of .s6-svscan/control (not sure if it's removed on exit). Are there any
other ways to monitor s6-svscan?

Is the communication protocol between s6-svscanctl and s6-svscan via
.s6-svscan/control documented anywhere? These jails are service jails with
no shells installed, so if I have to check for a return code of exactly 100
then I'll have to write a specific tool for that, at which point it may be
better for me to write a 'scanwait' tool of some sort that just checks for
existence.

Cheers,
Jw
Received on Thu Feb 24 2022 - 02:27:19 CET

This archive was generated by hypermail 2.4.0 : Thu Feb 24 2022 - 02:28:03 CET