[Logcheck-commits] CVS logcheck/src
CVS User maks-guest
logcheck-devel at lists.alioth.debian.org
Sat Mar 18 17:34:53 UTC 2006
Update of /cvsroot/logcheck/logcheck/src
In directory haydn:/tmp/cvs-serv3999/src
Modified Files:
logcheck
Log Message:
add $LOCKDIR, use it and create it on startup if removed.
fix permission of $LOCKDIR on upgrade.
bonus removed gratious whitespace
--- /cvsroot/logcheck/logcheck/src/logcheck 2006/03/10 00:27:45 1.137
+++ /cvsroot/logcheck/logcheck/src/logcheck 2006/03/18 17:34:50 1.138
@@ -22,7 +22,7 @@
# along with Logcheck; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-# $Id: logcheck,v 1.137 2006/03/10 00:27:45 maks-guest Exp $
+# $Id: logcheck,v 1.138 2006/03/18 17:34:50 maks-guest Exp $
if [ $UID == 0 ]; then
echo "logcheck should not be run as root. Use su to invoke logcheck:"
@@ -87,7 +87,8 @@
SORTUNIQ=0
SUPPORT_CRACKING_IGNORE=0
SYSLOGSUMMARY=0
-LOCKFILE="/var/lock/logcheck/logcheck"
+LOCKDIR=/var/lock/logcheck
+LOCKFILE="$LOCKDIR/logcheck"
# Carry out the clean up tasks
cleanup() {
@@ -619,8 +620,11 @@
fi
trap 'cleanup' 0
-
+
debug "Trying to get lockfile: $LOCKFILE.lock"
+if [ ! -d $LOCKDIR ]; then
+ mkdir -m 0755 $LOCKDIR
+fi
lockfile-create --retry 1 $LOCKFILE > /dev/null 2>&1
More information about the Logcheck-commits
mailing list