blockd: move to its own POSIX process group
authorDaniel Golle <daniel@makrotopia.org>
Thu, 15 Jul 2021 14:49:34 +0000 (15:49 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 15 Jul 2021 16:54:04 +0000 (17:54 +0100)
Not to be confused with cgroups, there are also POSIX process groups.
They do matter when it comes to autofs, as all requests coming from the
process group of the automounter itself will be ignored.
Hence, if blockd runs in the same process group as init and all
services, requests from services will be ignored.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
blockd.c

index 0520009055fe49fb6c3d44db6e079ef2639d26de..58b33e327e6e91147c1631718b538236b80992e7 100644 (file)
--- a/blockd.c
+++ b/blockd.c
@@ -635,6 +635,9 @@ struct uloop_timeout startup = {
 
 int main(int argc, char **argv)
 {
+       /* make sure blockd is in it's own POSIX process group */
+       setpgrp();
+
        ulog_open(ULOG_SYSLOG | ULOG_STDIO, LOG_DAEMON, "blockd");
        uloop_init();