summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2020-04-17 02:12:56 +0000
committermillert <millert@openbsd.org>2020-04-17 02:12:56 +0000
commit86013cca23371e714cd268ce9378840c9bf2d4db (patch)
tree4bd32d3dafc976c3f7d58e52687389f1a9c5a634
parentSuggest to update RPKI once an hour. (diff)
downloadwireguard-openbsd-86013cca23371e714cd268ce9378840c9bf2d4db.tar.xz
wireguard-openbsd-86013cca23371e714cd268ce9378840c9bf2d4db.zip
Log skipped jobs in job_add() not job_runqueue().
We want to log when the job is added but will not be run, not every time the run queue is processed.
-rw-r--r--usr.sbin/cron/job.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/cron/job.c b/usr.sbin/cron/job.c
index fde35e7a5ca..8198b8f5c88 100644
--- a/usr.sbin/cron/job.c
+++ b/usr.sbin/cron/job.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: job.c,v 1.14 2020/04/16 17:51:56 millert Exp $ */
+/* $OpenBSD: job.c,v 1.15 2020/04/17 02:12:56 millert Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
@@ -46,8 +46,13 @@ job_add(entry *e, user *u)
/* if already on queue, keep going */
SIMPLEQ_FOREACH(j, &jobs, entries) {
- if (j->e == e && j->u == u)
+ if (j->e == e && j->u == u) {
+ if ((j->e->flags & DONT_LOG) == 0) {
+ syslog(LOG_INFO, "(%s) SKIPPING (%s)",
+ j->u->name, j->e->cmd);
+ }
return;
+ }
}
/* build a job queue element */
@@ -112,9 +117,6 @@ job_runqueue(void)
if (j->pid == -1) {
j->pid = do_command(j->e, j->u);
run++;
- } else if ((j->e->flags & DONT_LOG) == 0) {
- syslog(LOG_INFO, "(%s) SKIPPING (%s)",
- j->u->name, j->e->cmd);
}
/* Singleton jobs persist in the queue until they exit. */