summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-11-13 13:34:47 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-11-13 13:34:47 +0000
commit9811ef53b65027091afc252cba859383419d6c94 (patch)
tree93f4d1e5b805a6593b031b4e3735273c3d4b902f
parent501b54278cf3965d9d38dba81870c4ea371d20a3 (diff)
downloads6-rc-9811ef53b65027091afc252cba859383419d6c94.tar.xz
- better error codes in s6-rc-update
- doc fixes
-rw-r--r--doc/overview.html2
-rw-r--r--doc/s6-rc-init.html6
-rw-r--r--doc/s6-rc-update.html11
-rw-r--r--src/s6-rc/s6-rc-update.c8
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
<a href="http://skarnet.org/software/s6-linux-init/">s6-linux-init</a>
-defaults, <tt>s6-svscanctl -t /run/service</tt> will kill the
+defaults, <tt>s6-svscanctl -6 /run/service</tt> will kill the
supervision tree and call <tt>/etc/rc.shutdown reboot</tt>, which should
reboot the machine.
</p>
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 (<em>live</em><tt>:<em>suffix</em></tt>)
and updates the live state by atomically changing the target of the
<em>live</em> symlink - so <em>live</em> will not change names, whereas
the real directory may.) </li>
+ <li> Similarly, it is recommended that administrators store their
+compiled service databases into some versioned directory, and that
+<em>compiled</em> be a symbolic link to the database currently in
+use. This will make it easier to create new compiled databases and
+switch them with <a href="s6-rc-update.html">s6-rc-update</a>
+without having to change the s6-rc-init invocation in boot scripts. </li>
</ul>
</body>
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. </li>
<ul>
<li> 0: success </li>
- <li> 1: failure to perform some state transitions </li>
- <li> 2: timed out </li>
+ <li> 1: failure to perform some state transitions, but the database was switched to <em>newdb</em> </li>
+ <li> 2: timed out, but the database was switched to <em>newdb</em> </li>
<li> 3: unknown service name in the conversion file </li>
<li> 4: invalid service database </li>
<li> 5: wrong service type in the conversion file </li>
<li> 6: duplicate service in the conversion file </li>
+ <li> 9: failure to perform some state transitions, and the database was not switched </li>
+ <li> 10: timed out, and the database was not switched </li>
<li> 100: wrong usage </li>
<li> 111: system call failed </li>
</ul>
@@ -210,11 +212,6 @@ matter whether a service is renamed or not, changing its type will force a
restart.
</p>
-<tt>ps</tt> 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.
-</p>
-
<h4> Restarting </h4>
<p>
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)