Index: config-scripts/cups-common.m4 =================================================================== --- config-scripts/cups-common.m4 (revision 9778) +++ config-scripts/cups-common.m4 (working copy) @@ -166,6 +166,9 @@ dnl Check for geteuid function. AC_CHECK_FUNCS(geteuid) +dnl Check for setpgid function. +AC_CHECK_FUNCS(setpgid) + dnl Check for vsyslog function. AC_CHECK_FUNCS(vsyslog) Index: vcnet/config.h =================================================================== --- vcnet/config.h (revision 9778) +++ vcnet/config.h (working copy) @@ -291,6 +291,13 @@ /* + * Do we have the setpgid() function? + */ + +/* #undef HAVE_SETPGID */ + + +/* * Do we have the vsyslog() function? */ Index: config.h.in =================================================================== --- config.h.in (revision 9778) +++ config.h.in (working copy) @@ -232,6 +232,13 @@ /* + * Do we have the setpgid() function? + */ + +#undef HAVE_SETPGID + + +/* * Do we have the vsyslog() function? */ Index: xcode/config.h =================================================================== --- xcode/config.h (revision 9778) +++ xcode/config.h (working copy) @@ -230,6 +230,13 @@ /* + * Do we have the setpgid() function? + */ + +#define HAVE_SETPGID 1 + + +/* * Do we have the vsyslog() function? */ Index: scheduler/process.c =================================================================== --- scheduler/process.c (revision 9779) +++ scheduler/process.c (working copy) @@ -246,9 +246,9 @@ if (!pid) return (0); else if (force) - return (kill(pid, SIGKILL)); + return (kill(-pid, SIGKILL)); else - return (kill(pid, SIGTERM)); + return (kill(-pid, SIGTERM)); } @@ -477,6 +477,19 @@ nice(FilterNice); /* + * Put this process in its own process group so that we can kill any child + * processes it creates. + */ + +#ifdef HAVE_SETPGID + if (setpgid(0, 0)) + exit(errno); +#else + if (setpgrp()) + exit(errno); +#endif /* HAVE_SETPGID */ + + /* * Change user to something "safe"... */