s6

Mirror/fork of https://skarnet.org/software/s6/
git clone https://ccx.te2000.cz/git/s6
Log | Files | Refs | README | LICENSE

commit f958b41a6e7a3124e95d48fe72bbf87fce0e2fce
parent d9488baa63351cafd237f5af15018ea5898ec0bc
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date:   Tue,  7 Sep 2021 12:15:41 +0000

 svlink bugfix

Signed-off-by: Laurent Bercot <ska@appnovation.com>

Diffstat:
Mdoc/s6-svlink.html | 4++++
Mdoc/s6-svunlink.html | 5+++++
Msrc/supervision/s6-svlink.c | 2+-
3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/doc/s6-svlink.html b/doc/s6-svlink.html @@ -105,6 +105,10 @@ supervisors one at a time, can be used instead. </li> <li> If <em>servicedir</em> is logged, i.e. <em>servicedir</em><tt>/log</tt> is also a valid service directory, then <tt>s6-svlink</tt> will wait until supervisors have been spawned for both the service and its logger. </li> + <li> <tt>s6-svlink</tt> sends a <a href="s6-svscanctl.html">s6-svscanctl -a</a> +command to <em>scandir</em>, which means that the system's view of services +will be refreshed. Depending on what links exist in <em>scandir</em>, other +services than <em>servicedir</em> may also appear. </li> <li> The symmetrical program to <tt>s6-svlink</tt> is named <a href="s6-svunlink.html">s6-svunlink</a>. </li> </ul> diff --git a/doc/s6-svunlink.html b/doc/s6-svunlink.html @@ -84,6 +84,11 @@ situations that are nominal failures. For instance, it returns 0 even if its timeout expires; the rationale is that there is no sensible action for the user to do if this error is reported. <tt>s6-svunlink</tt> only reports errors when they uncover a deeper problem in the system. </li> + <li> <tt>s6-svunlink</tt> sends a <a href="s6-svscanctl.html">s6-svscanctl -an</a> +command to <em>scandir</em>, which means that the system's view of services +will be refreshed and inactive services will be killed and unsupervised. +Depending on what links exist in <em>scandir</em>, new +services may appear, and other services than <em>name</em> may disappear. </li> </ul> </body> diff --git a/src/supervision/s6-svlink.c b/src/supervision/s6-svlink.c @@ -42,7 +42,7 @@ static inline void checkservicedir (char const *s) size_t len = strlen(s) ; char fn[len + 9] ; memcpy(fn, s, len) ; - memcpy(fn + len, "/run", 4) ; + memcpy(fn + len, "/run", 5) ; if (stat(fn, &st) == -1) strerr_diefu2sys(111, "stat ", fn) ; if (!(st.st_mode & S_IXUSR)) strerr_dief2x(100, fn, " is not executable") ; r = s6_svc_ok(s) ;