Compare commits

...

1 Commits

2 changed files with 22 additions and 11 deletions

View File

@@ -1,8 +1,8 @@
Index: sysstat-12.6.0/sa1.in
Index: sysstat-12.6.2/sa1.in
===================================================================
--- sysstat-12.6.0.orig/sa1.in
+++ sysstat-12.6.0/sa1.in
@@ -31,8 +31,14 @@ then
--- sysstat-12.6.2.orig/sa1.in
+++ sysstat-12.6.2/sa1.in
@@ -31,8 +31,16 @@ then
LONG_NAME=y
fi
@@ -11,13 +11,15 @@ Index: sysstat-12.6.0/sa1.in
cd ${ENDIR}
+LOCKFILE=/var/run/sysstat/sadc.LOCK
+mkdir -p /var/run/sysstat
+lockfile -r2 -30 "$LOCKFILE" 2>/dev/null
+touch "$LOCKFILE"
+exec 4<>"$LOCKFILE"
+flock -w 60 4
+trap "/bin/rm -f $LOCKFILE" EXIT
+
[ "$1" = "--boot" ] && shift && BOOT=y || BOOT=n
[ "$1" = "--sleep" ] && shift && SLEEP=y || SLEEP=n
@@ -51,13 +57,13 @@ fi
@@ -51,13 +59,13 @@ fi
if [ "${SLEEP}" = "y" ]
then
@@ -34,18 +36,20 @@ Index: sysstat-12.6.0/sa1.in
- exec ${ENDIR}/sadc -F -L ${SADC_OPTIONS} $* ${SA_DIR}
+ ${ENDIR}/sadc -F -L ${SADC_OPTIONS} $* ${SA_DIR}
fi
Index: sysstat-12.6.0/sa2.in
Index: sysstat-12.6.2/sa2.in
===================================================================
--- sysstat-12.6.0.orig/sa2.in
+++ sysstat-12.6.0/sa2.in
@@ -59,6 +59,17 @@ fi
--- sysstat-12.6.2.orig/sa2.in
+++ sysstat-12.6.2/sa2.in
@@ -59,6 +59,19 @@ fi
[ -f "${DFILE}" ] || exit 0
cd ${ENDIR}
+
+LOCKFILE=/var/run/sysstat/sadc.LOCK
+mkdir -p /var/run/sysstat
+if ! lockfile -r6 -600 $LOCKFILE 2>/dev/null; then
+touch "$LOCKFILE"
+exec 4<>"$LOCKFILE"
+if ! flock -w 3600 4; then
+ if test `find $LOCKFILE -mmin +180 2>/dev/null`; then
+ rm -f $LOCKFILE
+ logger -p cron.alert "$0: detected an old lockfile \"$LOCKFILE\"."

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Mar 19 18:35:10 UTC 2025 - Martin Schreiner <martin.schreiner@suse.com>
- Updated sysstat-8.1.6-sa1sa2lock.diff to use flock to create the
lockfile. Using lockfile would require additional SELinux permissions.
Require util-linux instead of procmail for this (bsc#1228246)
-------------------------------------------------------------------
Tue Jul 18 08:31:18 UTC 2023 - Franck Bui <fbui@suse.com>