]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Run helpers in the same process group as the main process but instead
authorhno <>
Fri, 27 May 2005 13:18:08 +0000 (13:18 +0000)
committerhno <>
Fri, 27 May 2005 13:18:08 +0000 (13:18 +0000)
disable SIGINT for the helpers when not running in daemon mode.

This accomplishes several things

  a) The helpers may access /dev/tty for screen output (debug purposes)

  b) A "kill -9" can be sent to the whole process group at once.

src/ipc.cc

index 80208358b627cea822cf02cd7a783c4f519c4464..415c90204b13f74997eab4189a7ede49e2c061b1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ipc.cc,v 1.39 2004/12/20 16:30:35 robertc Exp $
+ * $Id: ipc.cc,v 1.40 2005/05/27 07:18:08 hno Exp $
  *
  * DEBUG: section 54    Interprocess Communication
  * AUTHOR: Duane Wessels
@@ -377,11 +377,8 @@ ipcCreate(int type, const char *prog, const char *const args[], const char *name
     for (x = 3; x < SQUID_MAXFD; x++)
         close(x);
 
-#if HAVE_SETSID
-
-    setsid();
-
-#endif
+    if (opt_no_daemon)
+        squid_signal(SIGINT, SIG_IGN, SA_RESETHAND);
 
     execvp(prog, (char *const *) args);