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.3 required=5.0 tests=LOCALPART_IN_SUBJECT, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18214 invoked from network); 29 Jan 2021 08:18:50 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 29 Jan 2021 08:18:50 -0000 Received: (qmail 29357 invoked by uid 89); 29 Jan 2021 08:19:09 -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 29350 invoked from network); 29 Jan 2021 08:19:09 -0000 Date: Fri, 29 Jan 2021 08:18:41 +0000 From: Colin Booth To: supervision@list.skarnet.org Subject: Re: s6 supervision Message-ID: <20210129081841.GB28923@cathexis.xen.prgmr.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) On Fri, Jan 29, 2021 at 11:17:00AM +0530, billa chaitanya wrote: > Hi Team, > > Is there an API/ command in s6 code to get the information of a process and > its pid by giving the service name that has started the process? > I might be misreading your question but s6-svstat /path/to/servicedir I believe answers your question, at least as far as reading what s6-supervise knows about (pid, status, time in status, a few other details). If you're on a system with a functional procfs you can then use the pid to query most information from /proc/$pid. > > And does s6-svscan/s6-supervise have the knowledge of service-name& > process name & process pid so that it can be fetched to another process > using IPC? > s6-supervise knows the process id of its primary child and as I mentioned above you can ask it for that information via s6-svstat. It does not know anything else about the process because it doesn't need to. However, there are several options to s6-svstat that make output information in easy-to-parse formats which make follow-on queries to /proc trivial. -- Colin Booth