From: Denis Vlasenko Date: Tue, 2 Dec 2008 21:52:24 +0000 (-0000) Subject: crond: put tasks in separate process groups X-Git-Tag: 1_14_0~419 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b6ddee242592ffd02c05ae3ed6127c1dd80d7580;p=oweals%2Fbusybox.git crond: put tasks in separate process groups --- diff --git a/miscutils/crond.c b/miscutils/crond.c index bd7a177e0..1960a2c35 100644 --- a/miscutils/crond.c +++ b/miscutils/crond.c @@ -779,6 +779,8 @@ ForkJob(const char *user, CronLine *line, int mailFd, xmove_fd(mailFd, mail_filename ? 1 : 0); dup2(1, 2); } + /* "standard" cron puts tasks in separate process groups */ + setpgrp(); execlp(prog, prog, cmd, arg, NULL); crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, prog, cmd, arg); if (mail_filename) { @@ -914,6 +916,8 @@ static void RunJob(const char *user, CronLine *line) if (DebugOpt) { crondlog(LVL5 "child running %s", DEFAULT_SHELL); } + /* "standard" cron puts tasks in separate process groups */ + setpgrp(); execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL); crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, DEFAULT_SHELL, "-c", line->cl_Shell);