summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2019-05-17 17:33:19 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2019-05-17 17:33:19 (GMT)
commitc63b903713b6ec5600b11d6197c5c0c11f3b0247 (patch) (side-by-side diff)
tree64d3195506272890e1d60a96a3d4e119fbfdec8d
parenta3240e8cdde7d311cf006217d894a00398d4f130 (diff)
downloadpies-c63b903713b6ec5600b11d6197c5c0c11f3b0247.tar.gz
pies-c63b903713b6ec5600b11d6197c5c0c11f3b0247.tar.bz2
Provide an option to disable SysV init mode.
This is useful if pies is run as a entrypoint process in a docker container.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/cmdline.opt6
-rw-r--r--src/pies.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/src/cmdline.opt b/src/cmdline.opt
index 5380b80..57f5b90 100644
--- a/src/cmdline.opt
+++ b/src/cmdline.opt
@@ -57,2 +57,8 @@ END
+OPTION(no-init,,,
+ [<don't suppose SysV init mode if PID is 1>])
+BEGIN
+ /* handled separately */
+END
+
OPTION(inetd,i,,
diff --git a/src/pies.c b/src/pies.c
index c0c1306..503be73 100644
--- a/src/pies.c
+++ b/src/pies.c
@@ -2034,2 +2034,3 @@ main (int argc, char **argv)
int diag_flags;
+ int i;
@@ -2051,2 +2052,10 @@ main (int argc, char **argv)
init_process = getpid () == 1;
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp (argv[i], "--no-init") == 0)
+ {
+ init_process = 0;
+ break;
+ }
+ }

Return to:

Send suggestions and report system problems to the System administrator.