Author: depsterr <email@example.com>
Date: Sun, 31 May 2020 18:08:11 +0200
added info to readme
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
@@ -2,9 +2,7 @@
These are some linux init "scripts" written in C. The scripts are heavily inspired by [the kisslinux init scripts](https://github.com/kisslinux/init). However, unlike the kiss init scripts, my init script doesn't:
-* support mdev
-* drop you into a shell if anything goes wrong (good luck)
+* support mdev (though you could easily change this yourself)
* read options from rc.conf
@@ -14,6 +12,14 @@ The boot init script currently works. Though it doesn't read sysctl settings yet
The shutdown script is not yet implemented.
+## Services and custom startup programs
+Just add them in `init.c` with a call to `spawn_process`, though beware of the following:
+* Any process called by `spawn_process` which does not exit sucessfully (with an error code of 0) will cause `wait_for_children` to drop the user into a shell.
+* If your process doesn't exit into the background `wait_for_children` will halt init. To work around this, create a shellscript which starts and disowns processes that you wish to start and then exits with code 0. Then execute this file instead.
If you can't figure this out on your own, then you should not try to install anything here.
diff --git a/initscripts/util.h b/initscripts/util.h
@@ -1,8 +1,5 @@
-int status = 0;
-#define WAIT_FOR_CHILDREN while(wait(&status) > 0)
int spawn_process(char** argv);