diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-12-02 21:52:24 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-12-02 21:52:24 +0000 |
| commit | b6ddee242592ffd02c05ae3ed6127c1dd80d7580 (patch) | |
| tree | d2035d15a35e84d26987154a03b1eb6f4176101d | |
| parent | c5045fdbf1bbb8314b78e5f8d219a4449231a33e (diff) | |
| download | busybox-w32-b6ddee242592ffd02c05ae3ed6127c1dd80d7580.tar.gz busybox-w32-b6ddee242592ffd02c05ae3ed6127c1dd80d7580.tar.bz2 busybox-w32-b6ddee242592ffd02c05ae3ed6127c1dd80d7580.zip | |
crond: put tasks in separate process groups
| -rw-r--r-- | miscutils/crond.c | 4 |
1 files changed, 4 insertions, 0 deletions
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, | |||
| 779 | xmove_fd(mailFd, mail_filename ? 1 : 0); | 779 | xmove_fd(mailFd, mail_filename ? 1 : 0); |
| 780 | dup2(1, 2); | 780 | dup2(1, 2); |
| 781 | } | 781 | } |
| 782 | /* "standard" cron puts tasks in separate process groups */ | ||
| 783 | setpgrp(); | ||
| 782 | execlp(prog, prog, cmd, arg, NULL); | 784 | execlp(prog, prog, cmd, arg, NULL); |
| 783 | crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, prog, cmd, arg); | 785 | crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, prog, cmd, arg); |
| 784 | if (mail_filename) { | 786 | if (mail_filename) { |
| @@ -914,6 +916,8 @@ static void RunJob(const char *user, CronLine *line) | |||
| 914 | if (DebugOpt) { | 916 | if (DebugOpt) { |
| 915 | crondlog(LVL5 "child running %s", DEFAULT_SHELL); | 917 | crondlog(LVL5 "child running %s", DEFAULT_SHELL); |
| 916 | } | 918 | } |
| 919 | /* "standard" cron puts tasks in separate process groups */ | ||
| 920 | setpgrp(); | ||
| 917 | execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL); | 921 | execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL); |
| 918 | crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, | 922 | crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, |
| 919 | DEFAULT_SHELL, "-c", line->cl_Shell); | 923 | DEFAULT_SHELL, "-c", line->cl_Shell); |
