diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2026-01-20 07:37:51 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2026-01-20 07:37:51 +0000 |
| commit | 0b3887df63a64ec469b32b368f5cddadecae90ea (patch) | |
| tree | 89b3e50397d59288171713c6f5b88b4b891444b7 | |
| parent | d9436b64e8e63b2648da26814c0e58e539948bdd (diff) | |
| download | s6-frontend-0b3887df63a64ec469b32b368f5cddadecae90ea.tar.gz | |
hmmm, what's happening with live_startstop?
| -rw-r--r-- | package/deps.mak | 5 | ||||
| -rw-r--r-- | src/include-local/s6f.h | 1 | ||||
| -rw-r--r-- | src/libs6f/deps-lib/s6f | 1 | ||||
| -rw-r--r-- | src/libs6f/s6f_lock.c | 20 | ||||
| -rw-r--r-- | src/s6-frontend/live_startstop.c | 16 |
5 files changed, 8 insertions, 35 deletions
diff --git a/package/deps.mak b/package/deps.mak index 3ea6480..0509291 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -7,7 +7,6 @@ src/helpers/s6-frontend-helper-echo.o src/helpers/s6-frontend-helper-echo.lo: sr src/helpers/s6-frontend-helper-kill.o src/helpers/s6-frontend-helper-kill.lo: src/helpers/s6-frontend-helper-kill.c src/libs6f/s6f_confdir_open.o src/libs6f/s6f_confdir_open.lo: src/libs6f/s6f_confdir_open.c src/include-local/s6f.h src/libs6f/s6f_equote.o src/libs6f/s6f_equote.lo: src/libs6f/s6f_equote.c src/include-local/s6f.h -src/libs6f/s6f_lock.o src/libs6f/s6f_lock.lo: src/libs6f/s6f_lock.c src/include-local/s6f.h src/libs6f/s6f_report_state_change.o src/libs6f/s6f_report_state_change.lo: src/libs6f/s6f_report_state_change.c src/include-local/s6f.h src/libs6f/s6f_user_get_confdirs.o src/libs6f/s6f_user_get_confdirs.lo: src/libs6f/s6f_user_get_confdirs.c src/include-local/s6f.h src/s6-frontend/live.o src/s6-frontend/live.lo: src/s6-frontend/live.c src/s6-frontend/s6-frontend-internal.h @@ -45,9 +44,9 @@ s6-frontend-helper-echo: src/helpers/s6-frontend-helper-echo.o -lskarnet s6-frontend-helper-kill: EXTRA_LIBS := s6-frontend-helper-kill: src/helpers/s6-frontend-helper-kill.o -lskarnet ifeq ($(strip $(STATIC_LIBS_ARE_PIC)),) -libs6f.a.xyzzy: src/libs6f/s6f_confdir_open.o src/libs6f/s6f_equote.o src/libs6f/s6f_lock.o src/libs6f/s6f_report_state_change.o src/libs6f/s6f_user_get_confdirs.o +libs6f.a.xyzzy: src/libs6f/s6f_confdir_open.o src/libs6f/s6f_equote.o src/libs6f/s6f_report_state_change.o src/libs6f/s6f_user_get_confdirs.o else -libs6f.a.xyzzy:src/libs6f/s6f_confdir_open.lo src/libs6f/s6f_equote.lo src/libs6f/s6f_lock.lo src/libs6f/s6f_report_state_change.lo src/libs6f/s6f_user_get_confdirs.lo +libs6f.a.xyzzy:src/libs6f/s6f_confdir_open.lo src/libs6f/s6f_equote.lo src/libs6f/s6f_report_state_change.lo src/libs6f/s6f_user_get_confdirs.lo endif s6: EXTRA_LIBS := s6: src/s6-frontend/s6.o -lskarnet diff --git a/src/include-local/s6f.h b/src/include-local/s6f.h index 90d7565..7a64361 100644 --- a/src/include-local/s6f.h +++ b/src/include-local/s6f.h @@ -19,7 +19,6 @@ struct s6f_confdirs_s } ; extern int s6f_confdir_open (char const *, int) ; -extern int s6f_lock (char const *, int) ; extern void s6f_report_state_change (uint32_t, unsigned char const *, unsigned char const *, char const *, int) ; diff --git a/src/libs6f/deps-lib/s6f b/src/libs6f/deps-lib/s6f index b1d1ddb..80844f6 100644 --- a/src/libs6f/deps-lib/s6f +++ b/src/libs6f/deps-lib/s6f @@ -1,6 +1,5 @@ s6f_confdir_open.o s6f_equote.o -s6f_lock.o s6f_report_state_change.o s6f_user_get_confdirs.o ${LIBNSSS} diff --git a/src/libs6f/s6f_lock.c b/src/libs6f/s6f_lock.c deleted file mode 100644 index 1ef1718..0000000 --- a/src/libs6f/s6f_lock.c +++ /dev/null @@ -1,20 +0,0 @@ -/* ISC license. */ - -#include <string.h> - -#include <skalibs/strerr.h> -#include <skalibs/djbunix.h> -#include <skalibs/unix-transactional.h> - -#include "s6f.h" - -int s6f_lock (char const *stmpdir, int w) -{ - int fdstmp = s6f_confdir_open(stmpdir, 1) ; - int fd = openc_truncat(fdstmp, "lock") ; - if (fd == -1) strerr_diefu4sys(111, "open ", stmpdir, "/lock", " for writing") ; - fd_close(fdstmp) ; - if (fd_lock(fd, w, 0) < 1) - strerr_diefu3sys(111, "lock ", stmpdir, "/lock") ; - return fd ; -} diff --git a/src/s6-frontend/live_startstop.c b/src/s6-frontend/live_startstop.c index 52fea93..ea66ba0 100644 --- a/src/s6-frontend/live_startstop.c +++ b/src/s6-frontend/live_startstop.c @@ -11,6 +11,7 @@ #include <skalibs/gol.h> #include <skalibs/env.h> #include <skalibs/djbunix.h> +#include <skalibs/lolstdio.h> #include <s6-rc/config.h> #include <s6-rc/s6rc-utils.h> @@ -53,29 +54,26 @@ static int run_s6rc_change (char const *const *services, unsigned int n, int h, pid_t pid ; int wstat ; unsigned int m = 0 ; - char const *argv[13 + n] ; + char const *argv[12 + n] ; char fmtv[UINT_FMT] ; char fmtt[UINT_FMT] ; unsigned char oldstate[nstate] ; if (!s6rc_live_state_read(g->dirs.live, oldstate, nstate)) strerr_diefu2sys(111, "read state in ", g->dirs.live) ; + LOLDEBUG("n is %u, h is %d, dryrun is %d, timeout is %u, nstate is %u", n, h, dryrun, timeout, nstate) ; argv[m++] = S6RC_EXTBINPREFIX "s6-rc" ; argv[m++] = "-X" ; /* we already hold the lock */ argv[m++] = "-v" ; - argv[m++] = fmtv ; fmtv[uint_fmt(fmtv, g->verbosity)] = 0 ; + argv[m++] = fmtv ; if (timeout) { argv[m++] = "-t" ; - argv[m++] = fmtt ; fmtt[uint_fmt(fmtt, timeout)] = 0 ; + argv[m++] = fmtt ; } - if (dryrun) - { - argv[m++] = "-n" ; - argv[m++] = "1" ; - } + if (dryrun) argv[m++] = "-n1" ; argv[m++] = "-l" ; argv[m++] = g->dirs.live ; argv[m++] = "--" ; @@ -107,7 +105,6 @@ static int live_startstop (char const *const *argv, int h) argv += parse_options(argv, &wgolb, &timeout) ; if (!*argv) strerr_dieusage(100, h ? "s6 live start services..." : "s6 live stop services...") ; - s6f_lock(g->dirs.stmp, 0) ; /* leaks, it's fine */ char dbfn[livelen + 10] ; memcpy(dbfn, g->dirs.live, livelen) ; memcpy(dbfn + livelen, "/compiled", 10) ; @@ -143,7 +140,6 @@ void live_restart (char const *const *argv) if (!*argv) strerr_dieusage(100, "s6 live restart services...") ; argc = env_len(argv) ; - s6f_lock(g->dirs.stmp, 0) ; char dbfn[livelen + 10] ; memcpy(dbfn, g->dirs.live, livelen) ; memcpy(dbfn + livelen, "/compiled", 10) ; |
