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=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2000 invoked from network); 3 Nov 2020 11:48:34 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 3 Nov 2020 11:48:34 -0000 Received: (qmail 6415 invoked by uid 89); 3 Nov 2020 11:48:56 -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 6401 invoked from network); 3 Nov 2020 11:48:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aFafzG02cFsZ1RyK/X85w4wsqPPqjMH+2HjrJMo3GbI=; b=QjhRFz+F7ApowS0CaP4pJjbHX18PAvrQYm0vp+m5k3fzi2mfNfFlzV+AVAE5Dp6vcz BhGQT6v+Ph6Hhu2p3jz8s8KLv8j9u6HtddKVR4Zsom370IGBAUBxBn6ZT70ybCvJHRN4 UjT+Q5JXkUHf7jk34C7Rl2mjx0KU08qkNThbJVrrvuSVO5mA06wuhpHFum5aEv8AlccY Ccjse4ZYFI3apUBdEYl8plyiRGZLXlPoFdpf26bujCoSv6kebH63jncH/kUAtgSFVpPJ u5f3BDUYrPkWZDPhn2M308koQiniZ2iVXHuwFKC16zN2U7BXvRRcvo3gp+zmj7TNBm8u 4hYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aFafzG02cFsZ1RyK/X85w4wsqPPqjMH+2HjrJMo3GbI=; b=NkC3Db1Y3Vm6rX+TQ1OedzVPtHPb4NOO+BiLvYVJi/Y23LcVzarS+BbOKaYI7dxygN lo9KemmmDGJo4+rfxwU0kOT/EmPPq/RqEDVuQyAOB4vRGy1AI0yZziqmGRE3PYQGkkKH TeuMDEgRG2X8W+M1WKGBas+lpeq2FohVtBHRpjatFPZkAAp7Ftxp1hRdcZO47NBA+hNd DjcTpz4km0OP9MDwYhjVJkVcrb6HU8ozMpncplxIZlUJCXNMkCm4Oj4/GWnRwHmZjvUZ h3e+ix8B2VP+pSw8iGCiCqjUKKnOPQbGaTx5DSM9AbXzFCjJP4QgI+3YCGupP4xZnlbX KxmA== X-Gm-Message-State: AOAM531/jDoDs/pWH7E5RkaLL0NGFL9gOe9mOrIPJQDZBLkxeTn0j/8t nwFjqLoyDqUVBKpKBn80gE3z7j3BLuzoCqNSTIg= X-Google-Smtp-Source: ABdhPJwgTReHv+K/0C6yts5gNwtiILQgkajWOKve7N5lOVEzlhLY+kR9aE0qB5Z2QBZkJ9aqMZqwZe+P2ZBsb7RFM+U= X-Received: by 2002:a02:65cf:: with SMTP id u198mr15134306jab.24.1604404107347; Tue, 03 Nov 2020 03:48:27 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: billa chaitanya Date: Tue, 3 Nov 2020 17:18:16 +0530 Message-ID: Subject: Re: writing s6 services To: Laurent Bercot Cc: supervision@list.skarnet.org Content-Type: multipart/alternative; boundary="000000000000e50a5205b3327066" --000000000000e50a5205b3327066 Content-Type: text/plain; charset="UTF-8" On Wed, Oct 28, 2020 at 7:31 PM Laurent Bercot wrote: > >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 > always > remembers the pid of its child. You don't need a pidfile or anything of > the sort. > So, Is there any variable we can use inside run or finish > script of a service equivalent to the pid of the process started inside > run script? > -- > Laurent > > --000000000000e50a5205b3327066--