diff options
| author | Laurent Bercot <ska-skaware@skarnet.org> | 2026-01-24 08:25:53 +0000 |
|---|---|---|
| committer | Laurent Bercot <ska-skaware@skarnet.org> | 2026-01-24 08:25:53 +0000 |
| commit | b71b06951c8f9250f87a16cd1e60b2d779bfcfff (patch) | |
| tree | 3ea97d5ca0e6f70f8dcee137422e2d8b6a15a940 | |
| parent | dbaaee871996024e083bbdb83de85f8c287ee999 (diff) | |
| download | s6-rc-b71b06951c8f9250f87a16cd1e60b2d779bfcfff.tar.gz | |
And add similar options to s6-rc-set-install
s6-rc-set-install downs essential services by default. This is
different from the s6-rc-update default.
| -rw-r--r-- | doc/s6-rc-set-install.html | 12 | ||||
| -rw-r--r-- | src/repo/s6-rc-set-install.c | 8 |
2 files changed, 17 insertions, 3 deletions
diff --git a/doc/s6-rc-set-install.html b/doc/s6-rc-set-install.html index 8cdede9..a9fb281 100644 --- a/doc/s6-rc-set-install.html +++ b/doc/s6-rc-set-install.html @@ -31,7 +31,7 @@ the <em>live database</em> of the currently running system. <h2> Interface </h2> <pre> - s6-rc-set-install [ -v <em>verbosity</em> ] [ -r <em>repo</em> ] [ -c <em>bootdb</em> ] [ -l <em>livedir</em> ] [ -f <em>convfile</em> ] [ -b ] [ -K ] <em>set</em> + s6-rc-set-install [ -v <em>verbosity</em> ] [ -r <em>repo</em> ] [ -c <em>bootdb</em> ] [ -l <em>livedir</em> ] [ -f <em>convfile</em> ] [ -b ] [ -K ] [ -e | -E ] <em>set</em> </pre> <ul> @@ -89,6 +89,16 @@ the possibility of rollbacks. By default, s6-rc-set-install will delete the old live database after successfully updating to the new one. </dd> + <dt> -e, --force-essentials </dt> + <dd> If essential services running in the live database need to be stopped +before the new set is installed, stop them. This is the default, even though +it is <em>not</em> the default in <a href="s6-rc-update.html">s6-rc-update</a>. </dd> + + <dt> -E, --no-force-essentials </dt> + <dd> If essential services running in the live database need to be stopped +before the new set is installed, treat them as really essential and do not +stop them. This may put the machine in an inconsistent state. </dd> + <dt> --no-update </dt> <dd> Only copy the database from the repository and link it as boot database; do not run <a href="s6-rc-update.html">s6-rc-update</a>. This should <em>only</em> diff --git a/src/repo/s6-rc-set-install.c b/src/repo/s6-rc-set-install.c index 90f68b6..e2ecd6f 100644 --- a/src/repo/s6-rc-set-install.c +++ b/src/repo/s6-rc-set-install.c @@ -27,7 +27,7 @@ #include <s6-rc/config.h> #include <s6-rc/s6rc.h> -#define USAGE "s6-rc-set-install [ -v verbosity ] [ -c bootdb ] [ -l livedir ] [ -r repo ] [ -f convfile ] [ -b ] [ -K ] set" +#define USAGE "s6-rc-set-install [ -v verbosity ] [ -c bootdb ] [ -l livedir ] [ -r repo ] [ -f convfile ] [ -b ] [ -K ] [ -e | -E ] set" #define dieusage() strerr_dieusage(100, USAGE) enum golb_e @@ -35,6 +35,7 @@ enum golb_e GOLB_BLOCK = 0x01, GOLB_KEEPOLD = 0x02, GOLB_NOUPDATE = 0x04, + GOLB_NOFORCEESSENTIALS = 0x08, } ; enum gola_e @@ -54,6 +55,8 @@ int main (int argc, char const *const *argv) { .so = 'b', .lo = "block", .clear = 0, .set = GOLB_BLOCK }, { .so = 'K', .lo = "keep-old", .clear = 0, .set = GOLB_KEEPOLD }, { .so = 0, .lo = "no-update", .set = GOLB_NOUPDATE }, + { .so = 'e', .lo = "force-essentials", .clear = GOLB_NOFORCEESSENTIALS, .set = 0 }, + { .so = 'E', .lo = "no-force-essentials", .clear = 0, .set = GOLB_NOFORCEESSENTIALS }, } ; static gol_arg const rgola[] = { @@ -110,7 +113,7 @@ int main (int argc, char const *const *argv) pid_t pid ; int wstat ; char *olddb = 0 ; - char const *uargv[11] ; + char const *uargv[12] ; char fmtv[UINT_FMT] ; char clink[repolen + setlen + 11] ; char cfull[clen] ; @@ -164,6 +167,7 @@ int main (int argc, char const *const *argv) { uargv[l++] = S6RC_BINPREFIX "s6-rc-update" ; if (wgolb & GOLB_BLOCK) uargv[l++] = "-b" ; + uargv[l++] = wgolb & GOLB_NOFORCEESSENTIALS ? "-E" : "-e" ; uargv[l++] = "-v" ; uargv[l++] = fmtv ; uargv[l++] = "-l" ; |
