From 1cdd470038332a0355d7923483fc7b23cd7e8b7a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 9 Jul 2015 13:02:52 +0000 Subject: Silence s6-svc when no notification-fd and verbosity < 2 --- src/s6-rc/s6-rc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/s6-rc/s6-rc.c b/src/s6-rc/s6-rc.c index 720295d..eaaf036 100644 --- a/src/s6-rc/s6-rc.c +++ b/src/s6-rc/s6-rc.c @@ -112,11 +112,21 @@ static pid_t start_longrun (unsigned int i, int h) unsigned int m = 0 ; char fmt[UINT32_FMT] ; char vfmt[UINT_FMT] ; - char servicefn[livelen + svdlen + 19] ; + char servicefn[livelen + svdlen + 30] ; char const *newargv[7 + !!dryrun[0] * 6] ; byte_copy(servicefn, livelen, live) ; byte_copy(servicefn + livelen, 13, "/servicedirs/") ; byte_copy(servicefn + livelen + 13, svdlen, db->string + db->services[i].x.longrun.servicedir) ; + if (h && verbosity < 2) + { + byte_copy(servicefn + livelen + 13 + svdlen, 17, "/notification-fd") ; + if (access(servicefn, F_OK) < 0) + { + h = 2 ; + if (verbosity && errno == ENOENT) + strerr_warnwu2sys("access ", servicefn) ; + } + } byte_copy(servicefn + livelen + 13 + svdlen, 6, "/down") ; fmt[uint32_fmt(fmt, db->services[i].timeout[h])] = 0 ; vfmt[uint_fmt(vfmt, verbosity)] = 0 ; @@ -130,7 +140,7 @@ static pid_t start_longrun (unsigned int i, int h) newargv[m++] = "--" ; } newargv[m++] = S6_EXTBINPREFIX "s6-svc" ; - newargv[m++] = h ? "-Uu" : "-Dd" ; + newargv[m++] = h ? h == 2 ? "-u" : "-Uu" : "-Dd" ; newargv[m++] = "-T" ; newargv[m++] = fmt ; newargv[m++] = "--" ; -- cgit v1.2.3