aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure23
-rw-r--r--package/configure-snippets/configure_case_lines3
-rw-r--r--package/configure-snippets/configure_expand_dirs2
-rw-r--r--package/configure-snippets/configure_generate_configh7
-rw-r--r--package/configure-snippets/configure_generate_make5
-rw-r--r--package/configure-snippets/configure_help_install3
-rw-r--r--package/configure-snippets/configure_init_vars3
-rw-r--r--package/deps.mak5
-rw-r--r--src/include-local/s6f.h19
-rw-r--r--src/libs6f/deps-exe/s6f1
-rw-r--r--src/libs6f/s6f_user_get_confdirs.c77
-rw-r--r--src/s6/process.c12
-rw-r--r--src/s6/process_kill.c4
-rw-r--r--src/s6/process_status.c4
-rw-r--r--src/s6/s6-internal.h22
-rw-r--r--src/s6/s6.c22
-rw-r--r--src/s6/service_start.c1
17 files changed, 156 insertions, 57 deletions
diff --git a/configure b/configure
index 51474bb..e8d1c16 100755
--- a/configure
+++ b/configure
@@ -29,8 +29,7 @@ Fine tuning of the installation directories:
--livedir=DIR run s6-rc live directory in DIR [s6-rc default|/run/s6-rc]
--repodir=DIR s6-frontend working base [/var/lib/s6-frontend/repository]
--bootdir=DIR location of the bootable s6-rc compiled db [/etc/s6-rc]
- --syspkgdir=DIR location of service files for distro packages [/usr/lib/s6-frontend/s6-rc/source]
- --localpkgdir=DIR location of service files for local packages [/etc/s6-frontend/s6-rc/source]
+ --with-def-path=PATH path to service files [LIBDIR/s6-frontend/s6-rc/source:SYSCONFDIR/s6-frontend/s6-rc/source]
If no --prefix option is given, by default libdir (but not dynlibdir) will be
/usr/lib, and includedir will be /usr/include.
@@ -183,8 +182,7 @@ scandir=
livedir=
repodir=/var/lib/s6-frontend/s6-rc/repository
bootdir=/etc/s6-rc
-syspkgdir=/usr/lib/s6-frontend/s6-rc/source
-localpkgdir=/etc/s6-frontend/s6-rc/source
+defpath='$libdir/s6-frontend/s6-rc/source:$sysconfdir/s6-frontend/s6-rc/source'
usensss=false
uses6li=true
useutillinux=false
@@ -232,8 +230,7 @@ for arg ; do
--livedir=*) livedir=${arg#*=} ;;
--repodir=*) repodir=${arg#*=} ;;
--bootdir=*) bootdir=${arg#*=} ;;
- --syspkgdir=*) syspkgdir=${arg#*=} ;;
- --localpkgdir=*) localpkgdir=${arg#*=} ;;
+ --with-def-path=*) defpath=${arg#*=} ;;
--enable-nsss|--enable-nsss=yes) usensss=true ;;
--disable-nsss|--enable-nsss=no) usensss=false ;;
--enable-s6li|--enable-s6li=yes) uses6li=true ;;
@@ -274,7 +271,7 @@ fi
# Expand installation directories
stripdir prefix
-for i in exec_prefix dynlibdir libexecdir bindir libdir includedir sysconfdir pkgconfdir sysdeps sproot ; do
+for i in exec_prefix dynlibdir libexecdir bindir libdir includedir sysconfdir pkgconfdir sysdeps sproot defpath ; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
@@ -559,12 +556,9 @@ else
echo "MAYBEPTHREAD_LIB :="
fi
-echo "SCANDIR := $scandir"
-echo "LIVEDIR := $livedir"
echo "REPODIR := $repodir"
echo "BOOTDIR := $bootdir"
-echo "SYSPKGDIR := $syspkgdir"
-echo "LOCALPKGDIR := $localpkgdir"
+echo "DEFPATH := $defpath"
if $adaemontools ; then
echo "WRAP_DAEMONTOOLS := 1"
@@ -647,11 +641,8 @@ echo "#define ${package_macro_name}_REPODIR \"$repodir\""
echo "#undef ${package_macro_name}_BOOTDIR"
echo "#define ${package_macro_name}_BOOTDIR \"$bootdir\""
-echo "#undef ${package_macro_name}_SYSPKGDIR"
-echo "#define ${package_macro_name}_SYSPKGDIR \"$syspkgdir\""
-
-echo "#undef ${package_macro_name}_LOCALPKGDIR"
-echo "#define ${package_macro_name}_LOCALPKGDIR \"$localpkgdir\""
+echo "#undef ${package_macro_name}_DEFPATH"
+echo "#define ${package_macro_name}_DEFPATH \"$defpath\""
echo "#undef ${package_macro_name}_WRAP_DAEMONTOOLS"
if $adaemontools ; then
diff --git a/package/configure-snippets/configure_case_lines b/package/configure-snippets/configure_case_lines
index 3d94ecc..5d002b8 100644
--- a/package/configure-snippets/configure_case_lines
+++ b/package/configure-snippets/configure_case_lines
@@ -2,8 +2,7 @@
--livedir=*) livedir=${arg#*=} ;;
--repodir=*) repodir=${arg#*=} ;;
--bootdir=*) bootdir=${arg#*=} ;;
- --syspkgdir=*) syspkgdir=${arg#*=} ;;
- --localpkgdir=*) localpkgdir=${arg#*=} ;;
+ --with-def-path=*) defpath=${arg#*=} ;;
--enable-nsss|--enable-nsss=yes) usensss=true ;;
--disable-nsss|--enable-nsss=no) usensss=false ;;
--enable-s6li|--enable-s6li=yes) uses6li=true ;;
diff --git a/package/configure-snippets/configure_expand_dirs b/package/configure-snippets/configure_expand_dirs
index 8b13789..045c83c 100644
--- a/package/configure-snippets/configure_expand_dirs
+++ b/package/configure-snippets/configure_expand_dirs
@@ -1 +1 @@
-
+defpath
diff --git a/package/configure-snippets/configure_generate_configh b/package/configure-snippets/configure_generate_configh
index 70f56a6..14b46d5 100644
--- a/package/configure-snippets/configure_generate_configh
+++ b/package/configure-snippets/configure_generate_configh
@@ -33,11 +33,8 @@ echo "#define ${package_macro_name}_REPODIR \"$repodir\""
echo "#undef ${package_macro_name}_BOOTDIR"
echo "#define ${package_macro_name}_BOOTDIR \"$bootdir\""
-echo "#undef ${package_macro_name}_SYSPKGDIR"
-echo "#define ${package_macro_name}_SYSPKGDIR \"$syspkgdir\""
-
-echo "#undef ${package_macro_name}_LOCALPKGDIR"
-echo "#define ${package_macro_name}_LOCALPKGDIR \"$localpkgdir\""
+echo "#undef ${package_macro_name}_DEFPATH"
+echo "#define ${package_macro_name}_DEFPATH \"$defpath\""
echo "#undef ${package_macro_name}_WRAP_DAEMONTOOLS"
if $adaemontools ; then
diff --git a/package/configure-snippets/configure_generate_make b/package/configure-snippets/configure_generate_make
index ddacd4a..ba6a6d6 100644
--- a/package/configure-snippets/configure_generate_make
+++ b/package/configure-snippets/configure_generate_make
@@ -6,12 +6,9 @@ else
echo "MAYBEPTHREAD_LIB :="
fi
-echo "SCANDIR := $scandir"
-echo "LIVEDIR := $livedir"
echo "REPODIR := $repodir"
echo "BOOTDIR := $bootdir"
-echo "SYSPKGDIR := $syspkgdir"
-echo "LOCALPKGDIR := $localpkgdir"
+echo "DEFPATH := $defpath"
if $adaemontools ; then
echo "WRAP_DAEMONTOOLS := 1"
diff --git a/package/configure-snippets/configure_help_install b/package/configure-snippets/configure_help_install
index 73e2a96..a443a69 100644
--- a/package/configure-snippets/configure_help_install
+++ b/package/configure-snippets/configure_help_install
@@ -2,5 +2,4 @@
--livedir=DIR run s6-rc live directory in DIR [s6-rc default|/run/s6-rc]
--repodir=DIR s6-frontend working base [/var/lib/s6-frontend/repository]
--bootdir=DIR location of the bootable s6-rc compiled db [/etc/s6-rc]
- --syspkgdir=DIR location of service files for distro packages [/usr/lib/s6-frontend/s6-rc/source]
- --localpkgdir=DIR location of service files for local packages [/etc/s6-frontend/s6-rc/source]
+ --with-def-path=PATH path to service files [LIBDIR/s6-frontend/s6-rc/source:SYSCONFDIR/s6-frontend/s6-rc/source]
diff --git a/package/configure-snippets/configure_init_vars b/package/configure-snippets/configure_init_vars
index 03ee8b6..36c8e65 100644
--- a/package/configure-snippets/configure_init_vars
+++ b/package/configure-snippets/configure_init_vars
@@ -2,8 +2,7 @@ scandir=
livedir=
repodir=/var/lib/s6-frontend/s6-rc/repository
bootdir=/etc/s6-rc
-syspkgdir=/usr/lib/s6-frontend/s6-rc/source
-localpkgdir=/etc/s6-frontend/s6-rc/source
+defpath='$libdir/s6-frontend/s6-rc/source:$sysconfdir/s6-frontend/s6-rc/source'
usensss=false
uses6li=true
useutillinux=false
diff --git a/package/deps.mak b/package/deps.mak
index 35933be..be5493e 100644
--- a/package/deps.mak
+++ b/package/deps.mak
@@ -2,11 +2,12 @@
# This file has been generated by tools/gen-deps.sh
#
-src/s6/s6-internal.h: src/include/s6-frontend/config.h
+src/s6/s6-internal.h: src/include/s6-frontend/config.h src/include-local/s6f.h
src/alias/s6-frontend-alias-chpst.o src/alias/s6-frontend-alias-chpst.lo: src/alias/s6-frontend-alias-chpst.c
src/alias/s6-frontend-alias-sv.o src/alias/s6-frontend-alias-sv.lo: src/alias/s6-frontend-alias-sv.c
src/alias/s6-frontend-alias.o src/alias/s6-frontend-alias.lo: src/alias/s6-frontend-alias.c src/include/s6-frontend/config.h
src/config/s6-frontend-config-preprocess.o src/config/s6-frontend-config-preprocess.lo: src/config/s6-frontend-config-preprocess.c
+src/libs6f/s6f_user_get_confdirs.o src/libs6f/s6f_user_get_confdirs.lo: src/libs6f/s6f_user_get_confdirs.c src/include-local/s6-internal.h
src/s6/help.o src/s6/help.lo: src/s6/help.c src/s6/s6-internal.h
src/s6/process.o src/s6/process.lo: src/s6/process.c src/s6/s6-internal.h
src/s6/process_kill.o src/s6/process_kill.lo: src/s6/process_kill.c src/s6/s6-internal.h
@@ -29,6 +30,8 @@ s6-frontend-alias-sv: EXTRA_LIBS := ${SPAWN_LIB}
s6-frontend-alias-sv: src/alias/s6-frontend-alias-sv.o -ls6 -lskarnet
s6-frontend-config-preprocess: EXTRA_LIBS :=
s6-frontend-config-preprocess: src/config/s6-frontend-config-preprocess.o -lskarnet
+s6f: EXTRA_LIBS :=
+s6f: src/libs6f/s6f.o src/libs6f/s6f_user_get_confdirs.o
s6: EXTRA_LIBS :=
s6: src/s6/s6.o src/s6/help.o src/s6/util.o src/s6/process.o src/s6/process_kill.o src/s6/process_restart.o src/s6/process_start.o src/s6/process_status.o src/s6/process_stop.o src/s6/service.o src/s6/service_start.o src/s6/service_status.o src/s6/service_stop.o -ls6 -lskarnet
INTERNAL_LIBS :=
diff --git a/src/include-local/s6f.h b/src/include-local/s6f.h
new file mode 100644
index 0000000..4879536
--- /dev/null
+++ b/src/include-local/s6f.h
@@ -0,0 +1,19 @@
+/* ISC license. */
+
+#ifndef S6F_H
+#define S6F_H
+
+#include <skalibs/stralloc.h>
+
+typedef struct s6f_confdirs_s s6f_confdirs, *s6f_confdirs_ref ;
+struct s6f_confdirs_s
+{
+ char const *scan ; /* $XDG_RUNTIME_DIR/service */
+ char const *live ; /* $XDG_RUNTIME_DIR/s6-rc */
+ char const *repo ; /* $XDG_DATA_HOME/s6-frontend/repository */
+ char const *boot ; /* $XDG_CONFIG_HOME/s6-rc */
+} ;
+
+extern void s6f_user_get_confdirs (s6f_confdirs *, stralloc *) ;
+
+#endif
diff --git a/src/libs6f/deps-exe/s6f b/src/libs6f/deps-exe/s6f
new file mode 100644
index 0000000..e77c0cc
--- /dev/null
+++ b/src/libs6f/deps-exe/s6f
@@ -0,0 +1 @@
+s6f_user_get_confdirs.o
diff --git a/src/libs6f/s6f_user_get_confdirs.c b/src/libs6f/s6f_user_get_confdirs.c
new file mode 100644
index 0000000..57e6451
--- /dev/null
+++ b/src/libs6f/s6f_user_get_confdirs.c
@@ -0,0 +1,77 @@
+/* ISC license. */
+
+#include <pwd.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include <skalibs/types.h>
+#include <skalibs/strerr.h>
+#include <skalibs/stralloc.h>
+
+#include "s6-internal.h"
+
+#define dienomem() strerr_diefu1sys(111, "allocate memory")
+
+void s6f_user_get_confdirs (s6f_confdirs *dirs, stralloc *storage)
+{
+ size_t scanpos, livepos, repopos, bootpos ;
+ size_t homelen = 0 ;
+ struct passwd *pw = 0 ;
+ char const *home = 0 ;
+ char const *datahome = getenv("XDG_DATA_HOME") ;
+ char const *confighome = getenv("XDG_DATA_HOME") ;
+ char const *runtime = getenv("XDG_RUNTIME_DIR") ;
+ if (!runtime) strerr_dienotset(100, "XDG_RUNTIME_DIR") ;
+
+ if (!datahome || !confighome)
+ {
+ *home = getenv("HOME") ;
+ if (!home)
+ {
+ errno = 0 ;
+ pw = getpwuid(uid) ;
+ if (!pw)
+ {
+ char fmt[UID_FMT] ;
+ fmt[uid_fmt(fmt, uid)] = 0 ;
+ if (errno) strerr_diefu2sys(111, "getpwuid for user ", fmt) ;
+ else strerr_diefu3x(100, "getpwuid for user ", fmt, ": uid not found in passwd database") ;
+ }
+ homelen = strlen(pw->pw_dir) ;
+ }
+ }
+ char homeinstack[homelen + 1] ;
+ if (homelen)
+ {
+ memcpy(homeinstack, pw->pw_dir, homelen) ;
+ homestack[homelen] = 0 ;
+ home = homeinstack ;
+ }
+
+ scanpos = storage->len ;
+ if (!stralloc_cats(storage, runtime)
+ || !stralloc_cats(storage, "/service")
+ || !stralloc_0(storage)) dienomem() ;
+
+ livepos = storage->len ;
+ if (!stralloc_cats(storage, runtime)
+ || !stralloc_cats(storage, "/s6-rc")
+ || !stralloc_0(storage)) dienomem() ;
+
+ repopos = storage.len ;
+ if (!(datahome ? stralloc_cats(storage, datahome) : stralloc_cats(storage, home) && stralloc_cats(storage, "/.local/share"))
+ || !stralloc_cats(storage, "/s6-frontend/repository")
+ || !stralloc_0(storage)) dienomem ;
+
+ bootpos = storage.len ;
+ if (!(confighome ? stralloc_cats(storage, confighome) : stralloc_cats(storage, home) && stralloc_cats(storage, "/.config"))
+ || !stralloc_cats(storage, "/s6-rc")
+ || !stralloc_0(storage)) dienomem ;
+
+ /* Don't add to storage past this point */
+
+ dirs->scan = storage.s + scanpos ;
+
+}
diff --git a/src/s6/process.c b/src/s6/process.c
index 6f8586c..1dca89d 100644
--- a/src/s6/process.c
+++ b/src/s6/process.c
@@ -22,7 +22,7 @@ static int check_service (char const *name, size_t scandirlen)
struct stat st ;
size_t namelen = strlen(name) ;
char path[scandirlen + namelen + 2] ;
- memcpy(path, g->scandir, scandirlen) ;
+ memcpy(path, g->dirs.scan, scandirlen) ;
path[scandirlen] = '/' ;
memcpy(path + scandirlen + 1, name, namelen) ;
path[scandirlen + 1 + namelen] = 0 ;
@@ -31,21 +31,21 @@ static int check_service (char const *name, size_t scandirlen)
void process_check_services (char const *const *argv, size_t argc)
{
- size_t scandirlen = strlen(g->scandir) ;
+ size_t scandirlen = strlen(g->dirs.scan) ;
for (size_t i = 0 ; i < argc ; i++)
{
int r = check_service(argv[i], scandirlen) ;
if (r == -1)
- strerr_diefu4sys(111, "stat ", g->scandir, "/", argv[i]) ;
+ strerr_diefu4sys(111, "stat ", g->dirs.scan, "/", argv[i]) ;
else if (!r)
- strerr_dief3x(100, argv[i], "is not registered as a supervised service in ", g->scandir) ;
+ strerr_dief3x(100, argv[i], "is not registered as a supervised service in ", g->dirs.scan) ;
}
}
int process_send_svc (char const *svcopt, char const *const *argv, size_t argc)
{
char const *newargv[5] = { S6_EXTBINPREFIX "s6-svc", svcopt, "--", 0, 0 } ;
- size_t scandirlen = strlen(g->scandir) ;
+ size_t scandirlen = strlen(g->dirs.scan) ;
int wstat ;
pid_t pids[argc] ;
@@ -53,7 +53,7 @@ int process_send_svc (char const *svcopt, char const *const *argv, size_t argc)
{
size_t arglen = strlen(argv[i]) ;
char path[scandirlen + arglen + 2] ;
- memcpy(path, g->scandir, scandirlen) ;
+ memcpy(path, g->dirs.scan, scandirlen) ;
path[scandirlen] = '/' ;
memcpy(path + scandirlen + 1, argv[i], arglen) ;
path[scandirlen + 1 + arglen] = 0 ;
diff --git a/src/s6/process_kill.c b/src/s6/process_kill.c
index fdad688..e33b47f 100644
--- a/src/s6/process_kill.c
+++ b/src/s6/process_kill.c
@@ -21,7 +21,7 @@
static int process_kill_hack_kill (int sig, char const *const *argv)
{
- size_t scandirlen = strlen(g->scandir) ;
+ size_t scandirlen = strlen(g->dirs.scan) ;
if (g->verbosity)
{
char fmt[INT_FMT] ;
@@ -34,7 +34,7 @@ static int process_kill_hack_kill (int sig, char const *const *argv)
s6_svstatus_t status ;
size_t arglen = strlen(*argv) ;
char path[scandirlen + arglen + 2] ;
- memcpy(path, g->scandir, scandirlen) ;
+ memcpy(path, g->dirs.scan, scandirlen) ;
path[scandirlen] = '/' ;
memcpy(path + scandirlen + 1, *argv, arglen) ;
path[scandirlen + 1 + arglen] = 0 ;
diff --git a/src/s6/process_status.c b/src/s6/process_status.c
index 2240c85..96eb84b 100644
--- a/src/s6/process_status.c
+++ b/src/s6/process_status.c
@@ -87,7 +87,7 @@ static gol_bool const process_status_golb[1] =
int process_status (char const *const *argv)
{
- size_t scandirlen = strlen(g->scandir) ;
+ size_t scandirlen = strlen(g->dirs.scan) ;
uint64_t golb = 0 ;
int e = 0 ;
PROG = "s6 process status" ;
@@ -99,7 +99,7 @@ int process_status (char const *const *argv)
{
size_t len = strlen(*argv) ;
char path[scandirlen + len + 2] ;
- memcpy(path, g->scandir, scandirlen) ;
+ memcpy(path, g->dirs.scan, scandirlen) ;
path[scandirlen] = '/' ;
memcpy(path + scandirlen + 1, *argv, len+1) ;
if (do_status(path, !!(golb & 1 << PROCESS_STATUS_GOLB_WITHLOGS))) e = 1 ;
diff --git a/src/s6/s6-internal.h b/src/s6/s6-internal.h
index 6616c87..34a9c16 100644
--- a/src/s6/s6-internal.h
+++ b/src/s6/s6-internal.h
@@ -8,8 +8,10 @@
#include <stdlib.h>
#include <skalibs/functypes.h>
-#include <s6-frontend/config.h>
+#include <skalibs/stralloc.h>
+#include <s6-frontend/config.h>
+#include "s6f.h"
/* util */
@@ -53,18 +55,24 @@ extern int service (char const *const *) ;
struct global_s
{
unsigned int verbosity ;
- char const *scandir ;
- char const *livedir ;
- char const *repodir ;
+ s6f_confdirs dirs ;
+ stralloc userstorage ;
+ uint8_t isuser : 1 ;
uint8_t istty : 1 ;
uint8_t color : 1 ;
} ;
#define GLOBAL_ZERO \
{ \
.verbosity = 1, \
- .scandir = S6_FRONTEND_SCANDIR, \
- .livedir = S6_FRONTEND_LIVEDIR, \
- .repodir = S6_FRONTEND_REPODIR, \
+ .dirs = \
+ { \
+ .scan = S6_FRONTEND_SCANDIR, \
+ .live = S6_FRONTEND_LIVEDIR, \
+ .repo = S6_FRONTEND_REPODIR, \
+ .boot = S6_FRONTEND_BOOTDIR, \
+ }, \
+ .userstorage = STRALLOC_ZERO, \
+ .isuser = 0, \
.istty = 0, \
.color = 0 \
}
diff --git a/src/s6/s6.c b/src/s6/s6.c
index 9b6b88a..8d5295c 100644
--- a/src/s6/s6.c
+++ b/src/s6/s6.c
@@ -32,6 +32,7 @@ enum main_golb_e
{
MAIN_GOLB_HELP,
MAIN_GOLB_VERSION,
+ MAIN_GOLB_USER,
MAIN_GOLB_N
} ;
@@ -40,6 +41,7 @@ enum main_gola_e
MAIN_GOLA_SCANDIR,
MAIN_GOLA_LIVEDIR,
MAIN_GOLA_REPODIR,
+ MAIN_GOLA_BOOTDIR,
MAIN_GOLA_VERBOSITY,
MAIN_GOLA_COLOR,
MAIN_GOLA_N
@@ -48,7 +50,8 @@ enum main_gola_e
static gol_bool const main_golb[MAIN_GOLB_N] =
{
{ .so = 'h', .lo = "help", .set = 1, .mask = 1 << MAIN_GOLB_HELP },
- { .so = 'V', .lo = "version", .set = 1, .mask = 1 << MAIN_GOLB_VERSION }
+ { .so = 'V', .lo = "version", .set = 1, .mask = 1 << MAIN_GOLB_VERSION },
+ { .so = 0, .lo = "user", .set = 1, .mask = 1 << MAIN_GOLB_USER }
} ;
static gol_arg const main_gola[MAIN_GOLA_N] =
@@ -56,6 +59,7 @@ static gol_arg const main_gola[MAIN_GOLA_N] =
{ .so = 's', .lo = "scandir", .i = MAIN_GOLA_SCANDIR },
{ .so = 'l', .lo = "livedir", .i = MAIN_GOLA_LIVEDIR },
{ .so = 'r', .lo = "repodir", .i = MAIN_GOLA_REPODIR },
+ { .so = 'b', .lo = "bootdir", .i = MAIN_GOLA_BOOTDIR },
{ .so = 'v', .lo = "verbosity", .i = MAIN_GOLA_VERBOSITY },
{ .so = 0, .lo = "color", .i = MAIN_GOLA_COLOR }
} ;
@@ -86,13 +90,14 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (gola[MAIN_GOLA_VERBOSITY] && !uint0_scan(gola[MAIN_GOLA_VERBOSITY], &g->verbosity))
strerr_dief1x(100, "verbosity must be an unsigned integer") ;
- if (golb & (1 << MAIN_GOLB_VERSION)) version(argv) ;
- if (golb & (1 << MAIN_GOLB_HELP)) help(argv) ;
- if (golb & ((1 << MAIN_GOLB_VERSION) | (1 << MAIN_GOLB_HELP))) return 0 ;
+ if (golb & 1 << MAIN_GOLB_VERSION) version(argv) ;
+ if (golb & 1 << MAIN_GOLB_HELP) help(argv) ;
+ if (golb & (1 << MAIN_GOLB_VERSION | 1 << MAIN_GOLB_HELP)) return 0 ;
- if (gola[MAIN_GOLA_SCANDIR]) g->scandir = gola[MAIN_GOLA_SCANDIR] ;
- if (gola[MAIN_GOLA_LIVEDIR]) g->livedir = gola[MAIN_GOLA_LIVEDIR] ;
- if (gola[MAIN_GOLA_REPODIR]) g->repodir = gola[MAIN_GOLA_REPODIR] ;
+ if (gola[MAIN_GOLA_SCANDIR]) g->dirs.scan = gola[MAIN_GOLA_SCANDIR] ;
+ if (gola[MAIN_GOLA_LIVEDIR]) g->dirs.live = gola[MAIN_GOLA_LIVEDIR] ;
+ if (gola[MAIN_GOLA_REPODIR]) g->dirs.repo = gola[MAIN_GOLA_REPODIR] ;
+ if (gola[MAIN_GOLA_BOOTDIR]) g->dirs.boot = gola[MAIN_GOLA_BOOTDIR] ;
{
int force_color = 0 ;
@@ -115,6 +120,9 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (!force_color) g->color = g->istty ;
}
+ g->isuser = !!(golb & 1 << MAIN_GOLB_USER) ;
+ if (g->isuser) s6f_user_get_confdirs(&g->dirs, &g->userstorage) ;
+
if (!*argv) dieusage() ;
cmd = BSEARCH(struct command_s, *argv, main_commands) ;
if (!cmd) dieusage() ;
diff --git a/src/s6/service_start.c b/src/s6/service_start.c
index 4b8c3a6..8e876ea 100644
--- a/src/s6/service_start.c
+++ b/src/s6/service_start.c
@@ -49,6 +49,7 @@ int service_start (char const *const *argv)
newargv[m++] = "-n" ;
newargv[m++] = "1" ;
}
+ newargv[m++] = "--" ;
}
return 0 ;
}