Re: Inteligent service restart with s6

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Mon, 25 Jul 2016 15:11:14 +0200

On 25/07/2016 14:55, Jan Olszak wrote:
> Oh, I didn't know about ./finish. Thanks!

  http://skarnet.org/software/s6/s6-supervise.html tells you how to get
./run's exit code and crash signal in ./finish.


> The idea with a separate watchdog is tempting..
>
> Is it possible to use variables stored in the /env directory for this
> purpose or are they overwritten by s6 on every service start?

  s6 itself doesn't overwrite anything, so if you have a fixed service
directory, you can store information into it. However, I generally
recommend *copying* the service directories at boot time, and run the
supervision tree on the copies; in that case, modifications to the current
service directory will only last until the next reboot.
  If you're using s6-rc, this is what happens internally: the compiled
database contains service directories which are copied to the livedir
by s6-rc-init.

  To store permanent, persistent information without having to wonder what
your exact setup is, just use another directory somewhere else in the
filesystem. :)

-- 
  Laurent
Received on Mon Jul 25 2016 - 13:11:14 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC