From 15e3e402c59089514f590bab8804f0ed60f0fee3 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 7 May 2024 22:06:36 +0000 Subject: Add process group support to s6-supervise Signed-off-by: Laurent Bercot --- NEWS | 6 +++- doc/index.html | 2 +- doc/s6-svc.html | 10 ++++-- doc/s6-svstat.html | 5 ++- doc/servicedir.html | 11 +++++-- doc/upgrade.html | 9 +++++- package/info | 2 +- src/include/s6/supervise.h | 4 ++- src/libs6/s6_svstatus_pack.c | 5 +-- src/libs6/s6_svstatus_unpack.c | 12 +++++--- src/supervision/s6-supervise.c | 69 +++++++++++++++++++++++++++++++----------- src/supervision/s6-svc.c | 7 +++-- src/supervision/s6-svstat.c | 58 +++++++++++++++++++++++------------ 13 files changed, 142 insertions(+), 58 deletions(-) diff --git a/NEWS b/NEWS index 9a65dda..fcd95a9 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,13 @@ Changelog for s6. -In 2.12.0.5 +In 2.13.0.0 ----------- - Bugfixes. + - s6-svstat -o pgid (or -g) prints the service's pgid + - s6-supervise now passes the service's pgid to ./finish + - New s6-svc -P/-C/-K sends SIGSTOP, SIGCONT or SIGKILL to +the service's process group. In 2.12.0.4 diff --git a/doc/index.html b/doc/index.html index f5afce2..b3bb158 100644 --- a/doc/index.html +++ b/doc/index.html @@ -115,7 +115,7 @@ want nsswitch-like functionality:

Download


+

+

Usage examples

diff --git a/doc/s6-svstat.html b/doc/s6-svstat.html index ba62dbb..20a966a 100644 --- a/doc/s6-svstat.html +++ b/doc/s6-svstat.html @@ -27,7 +27,7 @@ summary of the state of a process monitored by

Interface

-     s6-svstat [ -uwNrpest | -o up,wantedup,normallyup,ready,paused,pid,exitcode,signal,signum,updownsince,readysince,updownfor,readyfor ] [ -n ] servicedir
+     s6-svstat [ -uwNrpest | -o up,wantedup,normallyup,ready,paused,pid,pgid,exitcode,signal,signum,updownsince,readysince,updownfor,readyfor ] [ -n ] servicedir
 

@@ -97,6 +97,8 @@ currently stopped) and false if it is not. It is a rare flag, you shoul need to use this option.

  • pid: print the pid of the supervised process. If the service is currently down, -1 is printed instead.
  • +
  • pgid: print the process group of the supervised process. If the service is +currently down, print the process group of the last living instance of the service.
  • exitcode: print the exit code of the last execution of ./run. If the service is currently up, or the last ./run process was killed by a signal, -1 is printed instead.
  • @@ -123,6 +125,7 @@ service last became ready (or ready to be started if it's currently not up and r
  • -N: equivalent to -o normallyup.
  • -r: equivalent to -o ready.
  • -p: equivalent to -o pid.
  • +
  • -g: equivalent to -o pgid.
  • -e: equivalent to -o exitcode.
  • -s: equivalent to -o signal.
  • -t: equivalent to -o updownfor.
  • diff --git a/doc/servicedir.html b/doc/servicedir.html index a49a38d..f08c3a4 100644 --- a/doc/servicedir.html +++ b/doc/servicedir.html @@ -46,7 +46,7 @@ but most of the time it will be a script, called run script. This file is the most important one in your service directory: it contains the commands that will setup and run your foo service.