aboutsummaryrefslogtreecommitdiff
path: root/src/supervise-daemon/supervise-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/supervise-daemon/supervise-daemon.c')
-rw-r--r--src/supervise-daemon/supervise-daemon.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/supervise-daemon/supervise-daemon.c b/src/supervise-daemon/supervise-daemon.c
index 58946716..68490ad4 100644
--- a/src/supervise-daemon/supervise-daemon.c
+++ b/src/supervise-daemon/supervise-daemon.c
@@ -391,6 +391,14 @@ static void child_process(char *exec, char **argv)
if (setpriority(PRIO_PROCESS, getpid(), nicelevel) == -1)
eerrorx("%s: setpriority %d: %s", applet, nicelevel,
strerror(errno));
+ /* Open in "r+" mode to avoid creating if non-existent. */
+ fp = fopen("/proc/self/autogroup", "r+");
+ if (fp) {
+ fprintf(fp, "%d\n", nicelevel);
+ fclose(fp);
+ } else if (errno != ENOENT)
+ eerrorx("%s: autogroup nice %d: %s", applet,
+ nicelevel, strerror(errno));
}
if (ionicec != -1 && ioprio_set(1, getpid(), ionicec | ioniced) == -1)