# This patch causes svscanboot to 'exec' svscan, instead of starting it as a
# child process.  i.e. you end up with
#     (original pid) svscan
#       (some child)   readproctitle
# instead of
#     (original pid) svscanboot
#       (some child)   svscan
#       (some child)   readproctitle
# Previously, if the original pid was killed, svscan and readproctitle would
# become orphans.  With this patch, svscan and readproctitle terminate.

# Side-effect: svscan has an extra file descriptor (usually 63) open, writing
# to the same pipe as stdin and stderr.

--- src/svscanboot.sh	2001-07-12 17:49:49.000000000 +0100
+++ src/svscanboot.sh	2007-06-02 12:12:21.232459000 +0100
@@ -7,5 +7,8 @@
 
 /command/svc -dx /service/* /service/*/log
 
-env - PATH=$PATH svscan /service 2>&1 | \
-env - PATH=$PATH readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
+exec bash -c '
+exec env - PATH=$PATH svscan /service > >(
+	exec env - PATH=$PATH readproctitle service errors: ................................................................................................................................................................................................................................................................................................................................................................................................................
+) 2>&1
+'

