diff --git a/compctl.c b/compctl.c
index 204f26210701f2e62f3d815c4670e63aeda731aa..fff81ab75c2ef4e36e9a466732768f39f9e95282 100644
--- a/compctl.c
+++ b/compctl.c
@@ -105,6 +105,7 @@ run(int argc, char *argv[])
 	}
 	free(line);
 
+	setpgrp();
 	if (setpriority(PRIO_PROCESS, 0, COMPNICE) < 0)
 		perror("Warning: setpriority()");