From 9811ef53b65027091afc252cba859383419d6c94 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 13 Nov 2015 13:34:47 +0000 Subject: - better error codes in s6-rc-update - doc fixes --- doc/overview.html | 2 +- doc/s6-rc-init.html | 6 ++++++ doc/s6-rc-update.html | 11 ++++------- src/s6-rc/s6-rc-update.c | 8 ++++++-- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/doc/overview.html b/doc/overview.html index 4209f42..12d5e4d 100644 --- a/doc/overview.html +++ b/doc/overview.html @@ -195,7 +195,7 @@ managed by s6-rc should be brought down in the proper order (via the brought down successfully, the final shutdown procedure can take place; for instance, if s6-svscan is running as process 1 with the s6-linux-init -defaults, s6-svscanctl -t /run/service will kill the +defaults, s6-svscanctl -6 /run/service will kill the supervision tree and call /etc/rc.shutdown reboot, which should reboot the machine.

diff --git a/doc/s6-rc-init.html b/doc/s6-rc-init.html index e5ae884..67ed7de 100644 --- a/doc/s6-rc-init.html +++ b/doc/s6-rc-init.html @@ -109,6 +109,12 @@ similarly named, directory (live:suffix) and updates the live state by atomically changing the target of the live symlink - so live will not change names, whereas the real directory may.) +
  • Similarly, it is recommended that administrators store their +compiled service databases into some versioned directory, and that +compiled be a symbolic link to the database currently in +use. This will make it easier to create new compiled databases and +switch them with s6-rc-update +without having to change the s6-rc-init invocation in boot scripts.
  • diff --git a/doc/s6-rc-update.html b/doc/s6-rc-update.html index e9ab43c..f683952 100644 --- a/doc/s6-rc-update.html +++ b/doc/s6-rc-update.html @@ -59,12 +59,14 @@ live compiled service database. @@ -210,11 +212,6 @@ matter whether a service is renamed or not, changing its type will force a restart.

    -ps output as supervising the old name. This is purely cosmetic and -will have no impact on the service; nevertheless, if you wish to avoid that, -simply force a restart on every service you rename. -

    -

    Restarting

    diff --git a/src/s6-rc/s6-rc-update.c b/src/s6-rc/s6-rc-update.c index 608ecf3..d94a572 100644 --- a/src/s6-rc/s6-rc-update.c +++ b/src/s6-rc/s6-rc-update.c @@ -744,7 +744,7 @@ int main (int argc, char const *const *argv, char const *const *envp) if (verbosity >= 2) strerr_warni1x("computing state adjustments") ; compute_transitions(convfile, oldstate, fdoldc, &olddb, newstate, invimage, fdnewc, argv[0], &newdb, &sa) ; tain_now_g() ; - if (!tain_future(&deadline)) strerr_dief1x(2, "timed out while computing state adjutments") ; + if (!tain_future(&deadline)) strerr_dief1x(10, "timed out while computing state adjutments") ; /* Down transition */ @@ -786,7 +786,11 @@ int main (int argc, char const *const *argv, char const *const *envp) if (wait_pid(pid, &wstat) < 0) strerr_diefu1sys(111, "waitpid") ; tain_now_g() ; if (WIFSIGNALED(wstat) || WEXITSTATUS(wstat)) - strerr_dief1x(wait_estatus(wstat), "first s6-rc invocation failed") ; + { + wstat = wait_estatus(wstat) ; + if (wstat == 1 || wstat == 2) wstat += 8 ; + strerr_dief1x(wstat, "first s6-rc invocation failed") ; + } } if (!dryrun) -- cgit v1.2.3