Re: svctl ?

From: Oliver Schad <oliver.schad_at_automatic-server.com>
Date: Wed, 21 Oct 2020 11:40:47 +0200

On Wed, 21 Oct 2020 11:16:56 +0200
Guillaume Perréal <gperreal_at_free.fr> wrote:

> Le 20/10/2020 à 14:30, Laurent Bercot a écrit :
> >   Yes, it is expected: it is how s6-rc-update (called by the
> > "svctl update" script) operates.
> Wait, there is a "svctl" script ? Where does it come from and what
> does it do ? Google could find no reference to it on
> https://skarnet.org/ ?
>
> Guillaume.
>
> Sorry for hijacking the thread.

svctl is an internal tool here, which implements a nice(r) s6
frontend. It implements a policy, because there are concrete file
system pathes inside for several helper scripts and pathes of s6. On
the other side it gives you something you know from service or
systemctl command.

So it's no problem to open that, however, don't know exactly how useful
it is for others. It was developed for usage in a ubuntu distribution,
which already has a init system and we wanted to be able to have partial
(shared) s6 usage or a exclusive s6 usage. So we needed several s6
policies and the s6-svctl has to know that, what you can see in a
snippet below:

------------- snippet --------------

# cat /usr/lib/s6-policy-common/bin/svctl-apply
#!/bin/sh -e

policy=$(readlink /lib/s6-rc/policy/current)
if test x"$policy" = x"exclusive" ; then
  top="top"
elif test x"$policy" = x"shared" ; then
  top="runlevel_2"
else
  echo "svctl-apply: fatal: /lib/s6-rc/policy/current should be a relative symlink to either shared or exclusive" 1>&2
  exit 100
fi

/usr/lib/s6-policy-common/bin/svctl-update
exec s6-rc -p change "$top"

----------------------------------------

Laurent helped us to develop that, so that is the reason why he didn't
asked questions about that here ;-)

So because I've offered informations, Laurent can add something, if he
likes. ;-)

Best Regards
Oli

-- 
Automatic-Server AG •••••
Oliver Schad
Geschäftsführer
Turnerstrasse 2
9000 St. Gallen | Schweiz
www.automatic-server.com | oliver.schad_at_automatic-server.com
Tel: +41 71 511 31 11 | Mobile: +41 76 330 03 47



Received on Wed Oct 21 2020 - 09:40:47 UTC

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