sysstat/sysstat-8.1.6-sa1sa2lock.diff
David Anes 85dc38b6b9 Accepting request 1179169 from home:pgajdos
- version update to 12.7.5
  2023/12/17: Version 12.7.5 - Sebastien Godard (sysstat <at> orange.fr)
	* [Quan quan Cao]: sar/sadc: Add new metrics pgprom/s and pgdem/s.
	* sar: Remove %vmeff metric.
	* sadf: Update various output formats to take into account metrics
	  that have been added or removed.
	* Update DTD and XSD documents.
	* Update sar manual page.
	* sar: Add a cron entry and a new systemd service and timer to rotate
	  daily data file at midnight.
	* Option -V with sysstat commands also displays environment contents.
	* [Sam Morris]: Use correct encoding to produce hyphen-minus when
	  rendering man pages.
	* Add UMASK variable definition to sysstat(5) manual page.
	* Update non regression tests.
	* Add --getenv option to commands that didn't have it.
	* Update README file for Debian-based distros.
	* Update link to my personal web page in README and manual pages.
	* NLS: Translations updated.
  2023/06/18: Version 12.7.4 - Sebastien Godard (sysstat <at> orange.fr)
	* Makefile.in: Fix installation error.
	* Makefile.in: Remove gcc warning displayed in LTO mode.
  2023/06/16: Version 12.7.3 - Sebastien Godard (sysstat <at> orange.fr)
	* sar: Add new option '-x' used to display extended reports.
	* [Pavel Kopylov]: Fix an overflow which is still possible for
	  some values.
	* [Jan Kurik]: Fix export of PSI metrics to a PCP archive.
	* [Lukáš Zaoral]: Tools that take `--dec=X` option should only accept
	  digits.
	* common.c: Fix an overflow which was still possible for some values.

OBS-URL: https://build.opensuse.org/request/show/1179169
OBS-URL: https://build.opensuse.org/package/show/Base:System/sysstat?expand=0&rev=151
2024-06-11 20:26:16 +00:00

59 lines
1.8 KiB
Diff

Index: sysstat-12.7.5/sa1.in
===================================================================
--- sysstat-12.7.5.orig/sa1.in
+++ sysstat-12.7.5/sa1.in
@@ -31,8 +31,14 @@ then
LONG_NAME=y
fi
+set -e
ENDIR=@SA_LIB_DIR@
cd ${ENDIR}
+LOCKFILE=/var/run/sysstat/sadc.LOCK
+mkdir -p /var/run/sysstat
+lockfile -r2 -30 "$LOCKFILE" 2>/dev/null
+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
if [ "${SLEEP}" = "y" ]
then
- exec ${ENDIR}/sadc -F -L ${SADC_OPTIONS} -C "LINUX SLEEP MODE ($*)" ${SA_DIR}
+ ${ENDIR}/sadc -F -L ${SADC_OPTIONS} -C "LINUX SLEEP MODE ($*)" ${SA_DIR}
elif [ $# = 0 ] && [ "${BOOT}" = "n" ]
then
# Note: Stats are written at the end of previous file *and* at the
# beginning of the new one (when there is a file rotation) only if
# outfile has not been explicitly specified on the command line...
- exec ${ENDIR}/sadc -F -L ${SADC_OPTIONS} 1 1 ${SA_DIR}
+ ${ENDIR}/sadc -F -L ${SADC_OPTIONS} 1 1 ${SA_DIR}
else
- exec ${ENDIR}/sadc -F -L ${SADC_OPTIONS} $* ${SA_DIR}
+ ${ENDIR}/sadc -F -L ${SADC_OPTIONS} $* ${SA_DIR}
fi
Index: sysstat-12.7.5/sa2.in
===================================================================
--- sysstat-12.7.5.orig/sa2.in
+++ sysstat-12.7.5/sa2.in
@@ -59,6 +59,17 @@ 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
+ if test `find $LOCKFILE -mmin +180 2>/dev/null`; then
+ rm -f $LOCKFILE
+ logger -p cron.alert "$0: detected an old lockfile \"$LOCKFILE\"."
+ fi
+fi
+trap "/bin/rm -f $LOCKFILE" EXIT
+
if [ x${REPORTS} != xfalse ]
then
S_REPEAT_HEADER=${REPEAT_HEADER} ${ENDIR}/sar $* -f ${DFILE} > ${RPT}