Skip to content
Snippets Groups Projects
Commit fab34800 authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

allow to specify the signal to send

parent 4af1f221
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,6 @@ extern int svc_scandir_ok (char const *dir) ;
extern int svc_scandir_send(char const *scandir,char const *signal) ;
extern int svc_send_wait(char const *const *list, unsigned int nservice, char **sig, unsigned int siglen, ssexec_t *info) ;
extern void svc_unsupervise(unsigned int *alist, unsigned int alen, graph_t *g, resolve_service_t *ares, unsigned int areslen) ;
extern void svc_send_fdholder(char const *socket) ;
extern void svc_send_fdholder(char const *socket, char const *signal) ;
#endif
......@@ -170,7 +170,7 @@ void sanitize_fdholder(resolve_service_t *res, uint32_t flag)
if (!openwritenclose_unsafe(file, list.s, list.len))
log_dieusys(LOG_EXIT_SYS, "write file: ", file) ;
svc_send_fdholder(socket) ;
svc_send_fdholder(socket, "twR") ;
stralloc_free(&list) ;
}
......
......@@ -15,14 +15,14 @@
#include <stdlib.h>
#include <oblibs/log.h>
#include <oblibs/string.h>
#include <skalibs/types.h>
#include <skalibs/djbunix.h>
#include <66/svc.h>
void svc_send_fdholder(char const *socket)
void svc_send_fdholder(char const *socket, char const *signal)
{
log_flow() ;
......@@ -33,16 +33,18 @@ void svc_send_fdholder(char const *socket)
char const *newargv[8] ;
unsigned int m = 0 ;
char sig[1 + strlen(signal) + 1] ;
auto_strings(sig, "-", signal) ;
newargv[m++] = "s6-svc" ;
newargv[m++] = "-twR" ;
newargv[m++] = sig ;
newargv[m++] = "-T" ;
newargv[m++] = tfmt ;
newargv[m++] = "--" ;
newargv[m++] = socket ;
newargv[m++] = 0 ;
log_trace("sending -twR signal to: ", socket) ;
log_trace("sending -", signal, " signal to: ", socket) ;
pid = child_spawn0(newargv[0], newargv, (char const *const *) environ) ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment