From f958b41a6e7a3124e95d48fe72bbf87fce0e2fce Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 7 Sep 2021 12:15:41 +0000 Subject: svlink bugfix Signed-off-by: Laurent Bercot --- doc/s6-svlink.html | 4 ++++ doc/s6-svunlink.html | 5 +++++ src/supervision/s6-svlink.c | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/s6-svlink.html b/doc/s6-svlink.html index 7682e37..c1b9e94 100644 --- a/doc/s6-svlink.html +++ b/doc/s6-svlink.html @@ -105,6 +105,10 @@ supervisors one at a time, can be used instead.
  • If servicedir is logged, i.e. servicedir/log is also a valid service directory, then s6-svlink will wait until supervisors have been spawned for both the service and its logger.
  • +
  • s6-svlink sends a s6-svscanctl -a +command to scandir, which means that the system's view of services +will be refreshed. Depending on what links exist in scandir, other +services than servicedir may also appear.
  • The symmetrical program to s6-svlink is named s6-svunlink.
  • diff --git a/doc/s6-svunlink.html b/doc/s6-svunlink.html index f3642be..371f5bd 100644 --- 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. s6-svunlink only reports errors when they uncover a deeper problem in the system. +
  • s6-svunlink sends a s6-svscanctl -an +command to scandir, 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 scandir, new +services may appear, and other services than name may disappear.
  • diff --git a/src/supervision/s6-svlink.c b/src/supervision/s6-svlink.c index d36ceab..4f36f3d 100644 --- 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) ; -- cgit v1.2.3