From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7945 invoked from network); 28 Oct 2020 14:01:56 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 28 Oct 2020 14:01:56 -0000 Received: (qmail 8650 invoked by uid 89); 28 Oct 2020 14:02:19 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 8643 invoked from network); 28 Oct 2020 14:02:19 -0000 From: "Laurent Bercot" To: "billa chaitanya" , supervision@list.skarnet.org Subject: Re: writing s6 services Date: Wed, 28 Oct 2020 14:01:52 +0000 Message-Id: In-Reply-To: References: Reply-To: "Laurent Bercot" User-Agent: eM_Client/8.0.3385.0 Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedujedrledugdehjecutefuodetggdotffvucfrrhhofhhilhgvmecupfgfoffgtffkveetuefngfdpqfgfvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhhrfgggtgfgsehtqhertddtreejnecuhfhrohhmpedfnfgruhhrvghnthcuuegvrhgtohhtfdcuoehskhgrqdhsuhhpvghrvhhishhiohhnsehskhgrrhhnvghtrdhorhhgqeenucggtffrrghtthgvrhhnpeeffeeuteekjeelteffheeljeehgfeuhfetkeeghfevgfetjedtgeevieevhfevheenucffohhmrghinhepnhgrrhhkihhvvgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht >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?( >https://systemd-devel.freedesktop.narkive.com/dpY7US7K/a-little-help-with-= mainpid-please Yes, that is the point of a process supervisor. You don't need a variable such as $MAINPID because the supervisor=20 always remembers the pid of its child. You don't need a pidfile or anything of the sort. -- Laurent