summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/s6-rc/s6-rc.c14
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++] = "--" ;