Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
sysstat.4520
sysstat-8.1.6-sa1sa2lock.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File sysstat-8.1.6-sa1sa2lock.diff of Package sysstat.4520
Index: sa1.in =================================================================== --- sa1.in.orig 2013-11-04 12:58:07.434353548 +0100 +++ sa1.in 2013-11-04 13:00:20.173812120 +0100 @@ -40,16 +40,22 @@ else [ -f ${CURRENTFILE} ] && [ "`date +%Y%m -r ${CURRENTFILE}`" -lt "${CURRENTDIR}" ] && rm -f ${CURRENTFILE} 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 if [ $# = 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 been specified as '-' on the command line... - exec ${ENDIR}/sadc -F -L ${SADC_OPTIONS} 1 1 - + ${ENDIR}/sadc -F -L ${SADC_OPTIONS} 1 1 - else - exec ${ENDIR}/sadc -F -L ${SADC_OPTIONS} $* - + ${ENDIR}/sadc -F -L ${SADC_OPTIONS} $* - fi Index: sa2.in =================================================================== --- sa2.in.orig 2013-11-04 12:58:06.615344546 +0100 +++ sa2.in 2013-11-04 12:58:07.435353559 +0100 @@ -48,6 +48,17 @@ ENDIR=@bindir@ DFILE=${CURRENTDIR}/${CURRENTFILE} [ -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 + [ -L ${RPT} ] && rm -f ${RPT} ${ENDIR}/sar $* -f ${DFILE} > ${RPT} find ${DDIR} \( -name 'sar??' -o -name 'sa??' -o -name 'sar??.gz' -o -name 'sa??.gz' -o -name 'sar??.bz2' -o -name 'sa??.bz2' \) \
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor