diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2015-07-09 13:02:52 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2015-07-09 13:02:52 +0000 |
commit | 1cdd470038332a0355d7923483fc7b23cd7e8b7a (patch) | |
tree | e35bdceed30400ca47d2d83aa1146064a9446067 | |
parent | fe5c71fe704dc77f9f324039cdd736ed74c54d86 (diff) | |
download | s6-rc-1cdd470038332a0355d7923483fc7b23cd7e8b7a.tar.xz |
Silence s6-svc when no notification-fd and verbosity < 2
-rw-r--r-- | src/s6-rc/s6-rc.c | 14 |
1 files changed, 12 insertions, 2 deletions
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++] = "--" ; |