diff options
| -rw-r--r-- | doc/s6_live.html | 16 | ||||
| -rw-r--r-- | doc/s6_set.html | 13 | ||||
| -rw-r--r-- | doc/s6_system.html | 4 | ||||
| -rw-r--r-- | package/deps.mak | 3 | ||||
| -rw-r--r-- | src/s6-frontend/deps-exe/s6-frontend | 1 | ||||
| -rw-r--r-- | src/s6-frontend/live_startstop.c | 2 | ||||
| -rw-r--r-- | src/s6-frontend/repository.c | 1 | ||||
| -rw-r--r-- | src/s6-frontend/repository_check.c | 2 | ||||
| -rw-r--r-- | src/s6-frontend/s6-frontend-internal.h | 1 | ||||
| -rw-r--r-- | src/s6-frontend/set.c | 1 | ||||
| -rw-r--r-- | src/s6-frontend/set_check.c | 2 | ||||
| -rw-r--r-- | src/s6-frontend/set_delete.c | 38 |
12 files changed, 69 insertions, 15 deletions
diff --git a/doc/s6_live.html b/doc/s6_live.html index 3e121ec..1c0cc33 100644 --- a/doc/s6_live.html +++ b/doc/s6_live.html @@ -166,16 +166,16 @@ transitions. By default, <em>timeout</em> is 0, meaning infinite: the command can wait forever. </dd> </dl> -<h3 id="start_everything"> start_everything </h3> +<h3 id="start-everything"> start-everything </h3> <h4> Interface </h4> <pre> - s6 live start_everything [ -n ] [ -t <em>timeout</em> ] [ -D <em>bundle</em> ] + s6 live start-everything [ -n ] [ -t <em>timeout</em> ] [ -D <em>bundle</em> ] </pre> <ul> - <li> <tt>s6 live start_everything</tt> brings up all the services + <li> <tt>s6 live start-everything</tt> brings up all the services defined in the current live database and in the default bundle, i.e. the bundle of services that are enabled at boot time. </li> </ul> @@ -201,16 +201,16 @@ The default is <tt>default</tt>, possibly overridden by the <a href="//skarnet.org/software/s6-frontend/">s6-frontend</a>. </dd> </dl> -<h3 id="stop_everything"> stop_everything </h3> +<h3 id="stop-everything"> stop-everything </h3> <h4> Interface </h4> <pre> - s6 live stop_everything [ -n ] [ -e | -E ] [ -t <em>timeout</em> ] + s6 live stop-everything [ -n ] [ -e | -E ] [ -t <em>timeout</em> ] </pre> <ul> - <li> <tt>s6 live stop_everything</tt> brings down all the services, + <li> <tt>s6 live stop-everything</tt> brings down all the services, except the essential ones. This is not the command that can reboot a machine; for that, check <a href="s6_system.html"><tt>s6 system</tt></a>.</li> </ul> @@ -228,10 +228,10 @@ bare state. This is the default. </dd> <dt> -E, --with-essentials </dt> <dd> Also stop essential services. After this command, the machine -isn't good for much except a reboot. <code>s6 live stop_everything -E</code> +isn't good for much except a reboot. <code>s6 live stop-everything -E</code> is the command that should be run right before a shutdown when the system is not using s6-linux-init. To that end, the line -<code>::shutdown:/usr/bin/s6 live stop_everything -E</code> should be +<code>::shutdown:/usr/bin/s6 live stop-everything -E</code> should be added to <tt>/etc/inittab</tt>, if that is what the init uses. </dd> <dt> -t <em>timeout</em>, --timeout=<em>timeout</em> </dt> diff --git a/doc/s6_set.html b/doc/s6_set.html index 08857d7..3421c22 100644 --- a/doc/s6_set.html +++ b/doc/s6_set.html @@ -91,6 +91,19 @@ as <em>name</em>. </li> <li> No options are defined. </li> </ul> +<h3 id="delete"> delete </h3> + +<h4> Interface </h4> + +<pre> + s6 set delete <em>names...</em> +</pre> + +<ul> + <li> <tt>s6 set delete</tt> delete the saved sets named <em>names...</em> </li> + <li> No options are defined. </li> +</ul> + <h3 id="list"> list </h3> <h4> Interface </h4> diff --git a/doc/s6_system.html b/doc/s6_system.html index a226a27..63055f8 100644 --- a/doc/s6_system.html +++ b/doc/s6_system.html @@ -97,11 +97,11 @@ only work if the machine makes use of s6-frontend has been configured to support it. On a machine that does not boot via s6-linux-init, a shutdown should be executed via the shutdown commands provided by your init system. In order for -the shutdown to be clean, the <code>s6 live stop_everything -E</code> +the shutdown to be clean, the <code>s6 live stop-everything -E</code> should be run before the init system performs a hard shutdown. For instance, if the system uses <tt>/etc/inittab</tt>, then the following line should appear in <tt>/etc/inittab</tt>: -<code>::shutdown:/usr/bin/s6 live stop_everything -E</code> +<code>::shutdown:/usr/bin/s6 live stop-everything -E</code> </p> <h3 id="reboot"> reboot </h3> diff --git a/package/deps.mak b/package/deps.mak index 0509291..377de32 100644 --- a/package/deps.mak +++ b/package/deps.mak @@ -33,6 +33,7 @@ src/s6-frontend/set_change.o src/s6-frontend/set_change.lo: src/s6-frontend/set_ src/s6-frontend/set_check.o src/s6-frontend/set_check.lo: src/s6-frontend/set_check.c src/s6-frontend/s6-frontend-internal.h src/include/s6-frontend/config.h src/s6-frontend/set_commit.o src/s6-frontend/set_commit.lo: src/s6-frontend/set_commit.c src/s6-frontend/s6-frontend-internal.h src/s6-frontend/set_copy.o src/s6-frontend/set_copy.lo: src/s6-frontend/set_copy.c src/s6-frontend/s6-frontend-internal.h +src/s6-frontend/set_delete.o src/s6-frontend/set_delete.lo: src/s6-frontend/set_delete.c src/s6-frontend/s6-frontend-internal.h src/s6-frontend/set_list.o src/s6-frontend/set_list.lo: src/s6-frontend/set_list.c src/s6-frontend/s6-frontend-internal.h src/s6-frontend/set_status.o src/s6-frontend/set_status.lo: src/s6-frontend/set_status.c src/s6-frontend/s6-frontend-internal.h src/include/s6-frontend/config.h src/s6-frontend/system.o src/s6-frontend/system.lo: src/s6-frontend/system.c src/s6-frontend/s6-frontend-internal.h @@ -51,5 +52,5 @@ endif s6: EXTRA_LIBS := s6: src/s6-frontend/s6.o -lskarnet s6-frontend: EXTRA_LIBS := ${MAYBEPTHREAD_LIB} -s6-frontend: src/s6-frontend/s6-frontend.o src/s6-frontend/live.o src/s6-frontend/live_help.o src/s6-frontend/live_install.o src/s6-frontend/live_startstop.o src/s6-frontend/live_status.o src/s6-frontend/live_start_everything.o src/s6-frontend/live_stop_everything.o src/s6-frontend/main_help.o src/s6-frontend/main_version.o src/s6-frontend/process.o src/s6-frontend/process_help.o src/s6-frontend/process_kill.o src/s6-frontend/process_restart.o src/s6-frontend/process_startstop.o src/s6-frontend/process_status.o src/s6-frontend/repository.o src/s6-frontend/repository_check.o src/s6-frontend/repository_help.o src/s6-frontend/repository_init.o src/s6-frontend/repository_list.o src/s6-frontend/repository_sync.o src/s6-frontend/set.o src/s6-frontend/set_change.o src/s6-frontend/set_check.o src/s6-frontend/set_commit.o src/s6-frontend/set_copy.o src/s6-frontend/set_help.o src/s6-frontend/set_list.o src/s6-frontend/set_status.o src/s6-frontend/system.o src/s6-frontend/system_boot.o src/s6-frontend/system_help.o src/s6-frontend/system_hpr.o libs6f.a.xyzzy ${LIBNSSS} -ls6rc -ls6 -lskarnet +s6-frontend: src/s6-frontend/s6-frontend.o src/s6-frontend/live.o src/s6-frontend/live_help.o src/s6-frontend/live_install.o src/s6-frontend/live_startstop.o src/s6-frontend/live_status.o src/s6-frontend/live_start_everything.o src/s6-frontend/live_stop_everything.o src/s6-frontend/main_help.o src/s6-frontend/main_version.o src/s6-frontend/process.o src/s6-frontend/process_help.o src/s6-frontend/process_kill.o src/s6-frontend/process_restart.o src/s6-frontend/process_startstop.o src/s6-frontend/process_status.o src/s6-frontend/repository.o src/s6-frontend/repository_check.o src/s6-frontend/repository_help.o src/s6-frontend/repository_init.o src/s6-frontend/repository_list.o src/s6-frontend/repository_sync.o src/s6-frontend/set.o src/s6-frontend/set_change.o src/s6-frontend/set_check.o src/s6-frontend/set_commit.o src/s6-frontend/set_copy.o src/s6-frontend/set_delete.o src/s6-frontend/set_help.o src/s6-frontend/set_list.o src/s6-frontend/set_status.o src/s6-frontend/system.o src/s6-frontend/system_boot.o src/s6-frontend/system_help.o src/s6-frontend/system_hpr.o libs6f.a.xyzzy ${LIBNSSS} -ls6rc -ls6 -lskarnet INTERNAL_LIBS := libs6f.a.xyzzy diff --git a/src/s6-frontend/deps-exe/s6-frontend b/src/s6-frontend/deps-exe/s6-frontend index 9f08747..9be433a 100644 --- a/src/s6-frontend/deps-exe/s6-frontend +++ b/src/s6-frontend/deps-exe/s6-frontend @@ -24,6 +24,7 @@ set_change.o set_check.o set_commit.o set_copy.o +set_delete.o set_help.o set_list.o set_status.o diff --git a/src/s6-frontend/live_startstop.c b/src/s6-frontend/live_startstop.c index ea66ba0..f3bcb06 100644 --- a/src/s6-frontend/live_startstop.c +++ b/src/s6-frontend/live_startstop.c @@ -11,7 +11,6 @@ #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> @@ -61,7 +60,6 @@ static int run_s6rc_change (char const *const *services, unsigned int n, int h, 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" ; diff --git a/src/s6-frontend/repository.c b/src/s6-frontend/repository.c index 923bf68..97064ac 100644 --- a/src/s6-frontend/repository.c +++ b/src/s6-frontend/repository.c @@ -13,6 +13,7 @@ void repository (char const *const *argv) { static struct command_s const commands[] = { + { .s = "check", .f = &repository_check }, { .s = "help", .f = &repository_help }, { .s = "init", .f = &repository_init }, { .s = "list", .f = &repository_list }, diff --git a/src/s6-frontend/repository_check.c b/src/s6-frontend/repository_check.c index 525d874..6e83a38 100644 --- a/src/s6-frontend/repository_check.c +++ b/src/s6-frontend/repository_check.c @@ -33,7 +33,7 @@ void repository_check (char const *const *argv) char const *newargv[9] ; char fmtv[UINT_FMT] = " " ; - argv += gol_argv(argv, rgolb, 4, 0, 0, &wgolb, 0) ; + argv += gol_argv(argv, rgolb, 5, 0, 0, &wgolb, 0) ; newargv[m++] = S6RC_EXTBINPREFIX "s6-rc-set-fix" ; if (g->verbosity != 1) diff --git a/src/s6-frontend/s6-frontend-internal.h b/src/s6-frontend/s6-frontend-internal.h index d763024..32e0240 100644 --- a/src/s6-frontend/s6-frontend-internal.h +++ b/src/s6-frontend/s6-frontend-internal.h @@ -76,6 +76,7 @@ extern void set_status (char const *const *) gccattr_noreturn ; extern void set_load (char const *const *) gccattr_noreturn ; extern void set_save (char const *const *) gccattr_noreturn ; +extern void set_delete (char const *const *) gccattr_noreturn ; extern void set_mask (char const *const *) gccattr_noreturn ; extern void set_unmask (char const *const *) gccattr_noreturn ; diff --git a/src/s6-frontend/set.c b/src/s6-frontend/set.c index b013c35..8123371 100644 --- a/src/s6-frontend/set.c +++ b/src/s6-frontend/set.c @@ -25,6 +25,7 @@ void set (char const *const *argv) { { .s = "check", .f = &set_check }, { .s = "commit", .f = &set_commit }, + { .s = "delete", .f = &set_delete }, { .s = "disable", .f = &set_disable }, { .s = "enable", .f = &set_enable }, { .s = "help", .f = &set_help }, diff --git a/src/s6-frontend/set_check.c b/src/s6-frontend/set_check.c index 54c8a7c..a76d538 100644 --- a/src/s6-frontend/set_check.c +++ b/src/s6-frontend/set_check.c @@ -33,7 +33,7 @@ void set_check (char const *const *argv) char const *newargv[11] ; char fmtv[UINT_FMT] = " " ; - argv += gol_argv(argv, rgolb, 4, 0, 0, &wgolb, 0) ; + argv += gol_argv(argv, rgolb, 5, 0, 0, &wgolb, 0) ; newargv[m++] = S6RC_EXTBINPREFIX "s6-rc-set-fix" ; if (g->verbosity != 1) diff --git a/src/s6-frontend/set_delete.c b/src/s6-frontend/set_delete.c new file mode 100644 index 0000000..f5e5e37 --- /dev/null +++ b/src/s6-frontend/set_delete.c @@ -0,0 +1,38 @@ +/* ISC license. */ + +#include <string.h> + +#include <skalibs/types.h> +#include <skalibs/envexec.h> + +#include <s6-rc/config.h> + +#include "s6-frontend-internal.h" + +void set_delete (char const *const *argv) +{ + unsigned int argc ; + argv += gol_argv(argv, 0, 0, 0, 0, 0, 0) ; + if (!*argv) strerr_die(100, "usage: s6 set delete names...") ; + + argc = env_len(argv) ; + for (unsigned int i = 0 ; i < argc ; i++) + if (argv[i][0] == '.' || strchr(argv[i], '/') || strchr(argv[i], '\n') + || !strcmp(argv[i], "current")) + strerr_dief(100, "invalid set name: ", argv[i]) ; + + unsigned int m = 0 ; + char const *newargv[7 + argc] ; + char fmtv[UINT_FMT] ; + + newargv[m++] = S6RC_EXTBINPREFIX "s6-rc-set-delete" ; + fmtv[uint_fmt(fmtv, g->verbosity)] = 0 ; + newargv[m++] = "-v" ; + newargv[m++] = fmtv ; + newargv[m++] = "-r" ; + newargv[m++] = g->dirs.repo ; + newargv[m++] = "--" ; + while (argc--) newargv[m++] = *argv++ ; + newargv[m++] = 0 ; + main_exec(newargv) ; +} |
