Re: s6-rc:

From: Guillaume Perréal <gperreal_at_free.fr>
Date: Fri, 27 Jan 2017 14:13:12 +0100

Thank you. I used a simplfied version, since I have no logging concerns:

   # Precreate the control FIFO
   s6-mkfifo -m 0600 $S6_SCANDIR/.s6-svcan/control

   background {
         if {
             # Block until s6-svscan starts reading its control FIFO
             redir -w 8 $S6_SCANDIR/.s6-svcan/control
             # Do not leak the fd
             fdclose 8
             s6-rc-init -c $S6_RC_COMPILED -l $S6_RC_LIVE $S6_SCANDIR
         }
         s6-rc $VERBOSE -l $S6_RC_LIVE -u change session
     }

     s6-svscan -st 0 $S6_SCANDIR

This is a bit "dirty" because it depends on s6-svscan internal, i.e. it
creates a FIFO named "control" in its .s6-svscan directory.

-- 
Guillaume.
Le 27/01/2017 à 11:41, Casper Ti. Vector a écrit :
> Using the fifo trick [1]?  As a side note, though the s6 documentation
> considers it "dirty", similar methods [2] are widely used for process
> synchronisation in CSP-style concurrency.
>
> [1] <http://skarnet.org/software/s6/s6-svscan-1.html#log>.
Received on Fri Jan 27 2017 - 13:13:12 UTC

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