about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2023-12-23 03:02:15 +0100
committerLeah Neukirchen <leah@vuxu.org>2023-12-23 03:02:15 +0100
commit14707147d81b13f7f0e4ca5852e1a09a04f9aeb6 (patch)
treec1ffc1d8f354733e7c43933c95756e7bc2541126
parent151fb7e5908e87b278ca32148f551756664b2546 (diff)
downloadnitro-14707147d81b13f7f0e4ca5852e1a09a04f9aeb6.tar.gz
nitro-14707147d81b13f7f0e4ca5852e1a09a04f9aeb6.tar.xz
nitro-14707147d81b13f7f0e4ca5852e1a09a04f9aeb6.zip
don't handle SIGTERM as real pid 1
-rw-r--r--nitro.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/nitro.c b/nitro.c
index d3a050d..fc1ce9e 100644
--- a/nitro.c
+++ b/nitro.c
@@ -1077,11 +1077,11 @@ void
 init_mount() {
 #ifdef __linux__
 	if (!access("/dev/null", F_OK) && !mounted("/dev")) {
-		printf("mounting /dev");
+		printf("mounting /dev\n");
 		mount("dev", "/dev", "devtmpfs", MS_NOSUID, "mode=0755");
 	}
 	if (!mounted("/run")) {
-		printf("mounting /run");
+		printf("mounting /run\n");
 		mount("run", "/run", "tmpfs", MS_NOSUID|MS_NODEV, "mode=0755");
 	}
 #endif
@@ -1165,9 +1165,8 @@ main(int argc, char *argv[])
 	sigaction(SIGCHLD, &sa, 0);
 	sigaction(SIGHUP, &sa, 0);
 	sigaction(SIGINT, &sa, 0);
-/* for debugging
-	sigaction(SIGTERM, &sa, 0);
-*/
+	if (!real_pid1)		// only standalone and in containers
+		sigaction(SIGTERM, &sa, 0);
 
 	open_control_socket();