summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/s6-linux-init-maker.html2
-rw-r--r--src/init/s6-linux-init-maker.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/doc/s6-linux-init-maker.html b/doc/s6-linux-init-maker.html
index 1e87265..00a9722 100644
--- a/doc/s6-linux-init-maker.html
+++ b/doc/s6-linux-init-maker.html
@@ -337,6 +337,8 @@ Default is <strong>no utmpd service</strong>. </li> <br />
<li> <tt>-C</tt>&nbsp;: create a set of scripts that is suitable
for running <em>in a container</em>. This modifies some behaviours:
<ul>
+ <li> SIGTERM will be caught by s6-svscan, and cause an orderly
+shutdown of the container, as if the "poweroff" script had been invoked. </li>
<li> No early <tt>runleveld</tt> service is created. Changing
runlevels via
<a href="s6-linux-init-telinit.html">s6-linux-init-telinit</a>
diff --git a/src/init/s6-linux-init-maker.c b/src/init/s6-linux-init-maker.c
index 6d2a146..209ad2c 100644
--- a/src/init/s6-linux-init-maker.c
+++ b/src/init/s6-linux-init-maker.c
@@ -563,7 +563,6 @@ static inline void make_image (char const *base)
auto_dir(base, "run-image", 0, 0, 0755) ;
auto_dir(base, "run-image/" SCANDIR, 0, 0, 0755) ;
auto_dir(base, "run-image/" SCANDIR "/.s6-svscan", 0, 0, 0755) ;
- auto_script(base, "run-image/" SCANDIR "/.s6-svscan/SIGTERM", &put_shebang_options, 0) ;
auto_script(base, "run-image/" SCANDIR "/.s6-svscan/SIGQUIT", &put_shebang_options, 0) ;
auto_script(base, "run-image/" SCANDIR "/.s6-svscan/SIGINT", &sig_script, "-r") ;
auto_script(base, "run-image/" SCANDIR "/.s6-svscan/SIGUSR1", &sig_script, "-p") ;
@@ -589,6 +588,7 @@ static inline void make_image (char const *base)
if (inns)
{
+ auto_script(base, "run-image/" SCANDIR "/.s6-svscan/SIGTERM", &sig_script, "-p") ;
auto_script(base, "run-image/" SCANDIR "/.s6-svscan/crash", &container_crash_script, 0) ;
auto_script(base, "run-image/" SCANDIR "/.s6-svscan/finish", &container_exit_script, 0) ;
auto_dir(base, "run-image/" CONTAINER_RESULTS, 0, 0, 0755) ;
@@ -596,6 +596,7 @@ static inline void make_image (char const *base)
}
else
{
+ auto_script(base, "run-image/" SCANDIR "/.s6-svscan/SIGTERM", &put_shebang_options, 0) ;
auto_script(base, "run-image/" SCANDIR "/.s6-svscan/crash", &death_script, "crashed") ;
auto_script(base, "run-image/" SCANDIR "/.s6-svscan/finish", &death_script, "exited") ;
auto_dir(base, "run-image/" SCANDIR "/" RUNLEVELD_SERVICEDIR, 0, 0, 0755) ;