Fix releasing the lock in the parent atrun process after the queue
directory has been processed. Otherwise, a long-running child process caused other atrun invocations to stall unnecessarily.
This commit is contained in:
parent
48ecfdc414
commit
c759c06046
@ -567,6 +567,12 @@ main(int argc, char *argv[])
|
|||||||
if (run_batch && (gloadavg() < load_avg))
|
if (run_batch && (gloadavg() < load_avg))
|
||||||
run_file(batch_name, batch_uid, batch_gid);
|
run_file(batch_name, batch_uid, batch_gid);
|
||||||
|
|
||||||
|
if (flock(dirfd(spool), LOCK_UN) == -1)
|
||||||
|
perr("cannot unlock %s", ATJOB_DIR);
|
||||||
|
|
||||||
|
if (closedir(spool) == -1)
|
||||||
|
perr("cannot closedir %s", ATJOB_DIR);
|
||||||
|
|
||||||
closelog();
|
closelog();
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user