[Logcheck-commits] martin f. krafft: Special-case lockfile error message in case logcheck is still running
Martin F. Krafft
madduck at alioth.debian.org
Tue Aug 11 08:07:00 UTC 2009
Module: logcheck
Branch: master
Commit: ac9f26e5df647d74b931e287cc0fb470df129a56
URL: http://git.debian.org/?p=logcheck/logcheck.git;a=commit;h=ac9f26e5df647d74b931e287cc0fb470df129a56
Author: martin f. krafft <madduck at debian.org>
Date: Tue Aug 11 10:04:33 2009 +0200
Special-case lockfile error message in case logcheck is still running
Now logcheck differentiates between another process still running and
some other problem with obtaining the lock.
Signed-off-by: martin f. krafft <madduck at debian.org>
---
debian/changelog | 3 +++
src/logcheck | 7 ++++++-
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index c04b5be..eec6437 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,9 @@ logcheck (1.3.3) experimental; urgency=low
* use dh_prep instead of dh_clean -k
[ martin f. krafft ]
+ * Special-case lockfile error message in case logcheck is still running. Now
+ logcheck differentiates between another process still running and some
+ other problem with obtaining the lock.
* ignore.d.server/clamav-milter:
- ignore connect warnings when hostname is "unknown", e.g. when the
connection was closed before postfix even had time to create the socket
diff --git a/src/logcheck b/src/logcheck
index d962325..94b9b55 100755
--- a/src/logcheck
+++ b/src/logcheck
@@ -624,7 +624,12 @@ lockfile-create --retry 1 $LOCKFILE > /dev/null 2>&1
if [ $? -eq 1 ]; then
trap 0
- error "Failed to get lockfile: $LOCKFILE.lock" "noclean"
+ if [ -e ${LOCKFILE}.lock ]; then
+ error "Another logcheck process is still running" "noclean"
+ else
+ error "Failed to get lockfile: $LOCKFILE.lock" "noclean"
+ fi
+
else
debug "Running lockfile-touch $LOCKFILE.lock"
lockfile-touch $LOCKFILE &
More information about the Logcheck-commits
mailing list