mirror of
https://github.com/sheumann/hush.git
synced 2024-08-21 11:28:57 +00:00
crond: put tasks in separate process groups
This commit is contained in:
parent
c5045fdbf1
commit
b6ddee2425
@ -779,6 +779,8 @@ ForkJob(const char *user, CronLine *line, int mailFd,
|
|||||||
xmove_fd(mailFd, mail_filename ? 1 : 0);
|
xmove_fd(mailFd, mail_filename ? 1 : 0);
|
||||||
dup2(1, 2);
|
dup2(1, 2);
|
||||||
}
|
}
|
||||||
|
/* "standard" cron puts tasks in separate process groups */
|
||||||
|
setpgrp();
|
||||||
execlp(prog, prog, cmd, arg, NULL);
|
execlp(prog, prog, cmd, arg, NULL);
|
||||||
crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, prog, cmd, arg);
|
crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user, prog, cmd, arg);
|
||||||
if (mail_filename) {
|
if (mail_filename) {
|
||||||
@ -914,6 +916,8 @@ static void RunJob(const char *user, CronLine *line)
|
|||||||
if (DebugOpt) {
|
if (DebugOpt) {
|
||||||
crondlog(LVL5 "child running %s", DEFAULT_SHELL);
|
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);
|
execl(DEFAULT_SHELL, DEFAULT_SHELL, "-c", line->cl_Shell, NULL);
|
||||||
crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user,
|
crondlog(ERR20 "can't exec, user %s cmd %s %s %s", user,
|
||||||
DEFAULT_SHELL, "-c", line->cl_Shell);
|
DEFAULT_SHELL, "-c", line->cl_Shell);
|
||||||
|
Loading…
Reference in New Issue
Block a user