diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/s6-frontend/deps-exe/s6 | 1 | ||||
| -rw-r--r-- | src/s6-frontend/deps-exe/s6-frontend (renamed from src/s6/deps-exe/s6) | 3 | ||||
| -rw-r--r-- | src/s6-frontend/help.c (renamed from src/s6/help.c) | 0 | ||||
| -rw-r--r-- | src/s6-frontend/process.c (renamed from src/s6/process.c) | 0 | ||||
| -rw-r--r-- | src/s6-frontend/process_kill.c (renamed from src/s6/process_kill.c) | 0 | ||||
| -rw-r--r-- | src/s6-frontend/process_restart.c (renamed from src/s6/process_restart.c) | 0 | ||||
| -rw-r--r-- | src/s6-frontend/process_startstop.c (renamed from src/s6/process_startstop.c) | 0 | ||||
| -rw-r--r-- | src/s6-frontend/process_status.c (renamed from src/s6/process_status.c) | 0 | ||||
| -rw-r--r-- | src/s6-frontend/s6-frontend.c (renamed from src/s6/s6.c) | 15 | ||||
| -rw-r--r-- | src/s6-frontend/s6-internal.h (renamed from src/s6/s6-internal.h) | 0 | ||||
| -rw-r--r-- | src/s6-frontend/s6.c | 31 | ||||
| -rw-r--r-- | src/s6-frontend/service.c (renamed from src/s6/service.c) | 0 | ||||
| -rw-r--r-- | src/s6-frontend/service_startstop.c (renamed from src/s6/service_startstop.c) | 0 | ||||
| -rw-r--r-- | src/s6-frontend/service_status.c (renamed from src/s6/service_status.c) | 0 | ||||
| -rw-r--r-- | src/s6-frontend/util.c (renamed from src/s6/util.c) | 0 |
15 files changed, 46 insertions, 4 deletions
diff --git a/src/s6-frontend/deps-exe/s6 b/src/s6-frontend/deps-exe/s6 new file mode 100644 index 0000000..e7187fe --- /dev/null +++ b/src/s6-frontend/deps-exe/s6 @@ -0,0 +1 @@ +-lskarnet diff --git a/src/s6/deps-exe/s6 b/src/s6-frontend/deps-exe/s6-frontend index ad88372..e87e35a 100644 --- a/src/s6/deps-exe/s6 +++ b/src/s6-frontend/deps-exe/s6-frontend @@ -9,7 +9,8 @@ service.o service_startstop.o service_status.o libs6f.a.xyzzy +${LIBNSSS} -ls6rc -ls6 -${LIBNSSS} -lskarnet +${MAYBEPTHREAD_LIB} diff --git a/src/s6/help.c b/src/s6-frontend/help.c index ac2205c..ac2205c 100644 --- a/src/s6/help.c +++ b/src/s6-frontend/help.c diff --git a/src/s6/process.c b/src/s6-frontend/process.c index 1dca89d..1dca89d 100644 --- a/src/s6/process.c +++ b/src/s6-frontend/process.c diff --git a/src/s6/process_kill.c b/src/s6-frontend/process_kill.c index 64f7ffb..64f7ffb 100644 --- a/src/s6/process_kill.c +++ b/src/s6-frontend/process_kill.c diff --git a/src/s6/process_restart.c b/src/s6-frontend/process_restart.c index 73e66f3..73e66f3 100644 --- a/src/s6/process_restart.c +++ b/src/s6-frontend/process_restart.c diff --git a/src/s6/process_startstop.c b/src/s6-frontend/process_startstop.c index 8a5089e..8a5089e 100644 --- a/src/s6/process_startstop.c +++ b/src/s6-frontend/process_startstop.c diff --git a/src/s6/process_status.c b/src/s6-frontend/process_status.c index a13938d..a13938d 100644 --- a/src/s6/process_status.c +++ b/src/s6-frontend/process_status.c diff --git a/src/s6/s6.c b/src/s6-frontend/s6-frontend.c index e7ecd6f..ad55e8d 100644 --- a/src/s6/s6.c +++ b/src/s6-frontend/s6-frontend.c @@ -16,7 +16,7 @@ #include <s6-frontend/config.h> #include "s6-internal.h" -#define USAGE "s6 [ generic options ] command [ command options ] command_arguments... Type \"s6 help\" for details." +#define USAGE "s6-frontend [ generic options ] command [ command options ] command_arguments... Type \"s6 help\" for details." #define dieusage() strerr_dieusage(100, USAGE) @@ -79,11 +79,20 @@ static struct command_s const commands[] = int main (int argc, char const *const *argv, char const *const *envp) { struct global_s globals_in_the_stack = GLOBAL_ZERO ; - char const *wgola[GOLA_N] = { 0 } ; uint64_t wgolb = 0 ; unsigned int golc ; struct command_s *cmd ; - PROG = "s6" ; + char const *wgola[GOLA_N] = + { + [GOLA_SCANDIR] = getenv("scandir"), + [GOLA_LIVEDIR] = getenv("livedir"), + [GOLA_REPODIR] = getenv("repodir"), + [GOLA_BOOTDIR] = getenv("bootdir"), + [GOLA_STMPDIR] = getenv("stmpdir"), + [GOLA_VERBOSITY] = 0, + [GOLA_COLOR] = 0 + } ; + PROG = "s6-frontend" ; g = &globals_in_the_stack ; golc = gol_main(argc, argv, rgolb, GOLB_N, rgola, GOLA_N, &wgolb, wgola) ; diff --git a/src/s6/s6-internal.h b/src/s6-frontend/s6-internal.h index 6ee3939..6ee3939 100644 --- a/src/s6/s6-internal.h +++ b/src/s6-frontend/s6-internal.h diff --git a/src/s6-frontend/s6.c b/src/s6-frontend/s6.c new file mode 100644 index 0000000..9c9de9c --- /dev/null +++ b/src/s6-frontend/s6.c @@ -0,0 +1,31 @@ +/* ISC license. */ + +#include <stdlib.h> + +#include <skalibs/prog.h> +#include <skalibs/strerr.h> +#include <skalibs/exec.h> + +#include <execline/config.h> + +#include <s6-frontend/config.h> + +int main (int argc, char const *const *argv) +{ + char const *conffile = getenv("S6_FRONTEND_CONFFILE") ; + PROG = "s6 service" ; + if (!conffile) conffile = S6_FRONTEND_CONFFILE ; + if (!argc--) strerr_dief1x(103, "invalid argc/argv") ; + argv++ ; + + unsigned int m = 0 ; + char const *newargv[6 + argc] ; + newargv[m++] = EXECLINE_EXTBINPREFIX "envfile" ; + newargv[m++] = "-I" ; + newargv[m++] = "--" ; + newargv[m++] = conffile ; + newargv[m++] = S6_FRONTEND_BINPREFIX "s6-frontend" ; + while (argc--) newargv[m++] = *argv++ ; + newargv[m++] = 0 ; + xexec(newargv) ; +} diff --git a/src/s6/service.c b/src/s6-frontend/service.c index 5ac453b..5ac453b 100644 --- a/src/s6/service.c +++ b/src/s6-frontend/service.c diff --git a/src/s6/service_startstop.c b/src/s6-frontend/service_startstop.c index c4946fc..c4946fc 100644 --- a/src/s6/service_startstop.c +++ b/src/s6-frontend/service_startstop.c diff --git a/src/s6/service_status.c b/src/s6-frontend/service_status.c index 5bf71b5..5bf71b5 100644 --- a/src/s6/service_status.c +++ b/src/s6-frontend/service_status.c diff --git a/src/s6/util.c b/src/s6-frontend/util.c index 699f976..699f976 100644 --- a/src/s6/util.c +++ b/src/s6-frontend/util.c |
