Re: writing s6 services

From: Laurent Bercot <>
Date: Wed, 28 Oct 2020 14:01:52 +0000

>1) Is there a possibility to add an ENV variable dynamically?
>I have a shell script which fills out some variables like
>IPADDRESS, SERVER etc .. which I need to use in starting a process later
>as part of starting a service/stopping a service.

  You can do whatever you want in a run script, as long as by the end
of it, the pid of the long-running daemon is the pid your run script
was started as.
  If your run script is a shell script, you can absolutely source the
script that fills out your environment variables. It is not the most
idiomatic or safe way to do it, but it will absolutely work.

>2) Does s6-supervise has the intelligence of findingout $MAINPID as the
>systemd does?(

  Yes, that is the point of a process supervisor.
  You don't need a variable such as $MAINPID because the supervisor
remembers the pid of its child. You don't need a pidfile or anything of
the sort.

Received on Wed Oct 28 2020 - 14:01:52 UTC

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