Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 898410 Details for
Bug 921612
SAR log file corruption in odd Feb 28th edge-case
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
sysstat-9.0.4-history-25.patch
sysstat-9.0.4-history-25.patch (text/plain), 4.34 KB, created by
Peter Schiffer
on 2014-05-22 15:11:27 UTC
(
hide
)
Description:
sysstat-9.0.4-history-25.patch
Filename:
MIME Type:
Creator:
Peter Schiffer
Created:
2014-05-22 15:11:27 UTC
Size:
4.34 KB
patch
obsolete
>diff -upr sysstat-9.0.4.orig/FAQ sysstat-9.0.4/FAQ >--- sysstat-9.0.4.orig/FAQ 2009-02-15 15:59:46.000000000 +0100 >+++ sysstat-9.0.4/FAQ 2014-05-22 16:38:52.858324512 +0200 >@@ -462,7 +462,7 @@ By default sar saves its data in the sta > the /var/log/sa/sa<DD> file, where <DD> is the current day in the month. > To prevent sar from overwriting any existing files, just set the variable > HISTORY in /etc/sysconfig/sysstat to the number of days during which data >-must be kept. When this variable has a value greater than 28, sa1 script >+must be kept. When this variable has a value greater than 25, sa1 script > uses a month-by-month directory structure; datafiles are named YYYYMM/saDD > and the script maintains links to these datafiles to mimic the standard > sar datafile structure. >diff -upr sysstat-9.0.4.orig/man/sadc.in sysstat-9.0.4/man/sadc.in >--- sysstat-9.0.4.orig/man/sadc.in 2014-05-15 18:17:41.063130000 +0200 >+++ sysstat-9.0.4/man/sadc.in 2014-05-22 16:35:12.157783158 +0200 >@@ -25,6 +25,9 @@ is set to -, then > uses the standard system activity daily data file, the > .IR @SA_DIR@/sa dd > file, where the dd parameter indicates the current day. >+In this case, >+.B sadc >+will overwrite the file if it is from a previous month. > By default > .B sadc > collects all the data available from the kernel. >diff -upr sysstat-9.0.4.orig/sa1.in sysstat-9.0.4/sa1.in >--- sysstat-9.0.4.orig/sa1.in 2014-05-15 18:17:41.075130000 +0200 >+++ sysstat-9.0.4/sa1.in 2014-05-22 16:37:06.436026491 +0200 >@@ -7,15 +7,15 @@ > # > HISTORY=0 > SADC_OPTIONS="-S DISK" >+DDIR=@SA_DIR@ >+DATE=`date +%d` >+CURRENTFILE=sa${DATE} >+CURRENTDIR=`date +%Y%m` > SYSCONFIG_DIR=@SYSCONFIG_DIR@ > umask 0022 > [ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat >-if [ ${HISTORY} -gt 28 ] >+if [ ${HISTORY} -gt 25 ] > then >- CURRENTDIR=`date +%Y%m` >- DATE=`date +%d` >- CURRENTFILE=sa${DATE} >- DDIR=@SA_DIR@ > cd ${DDIR} || exit 1 > [ -d ${CURRENTDIR} ] || mkdir -p ${CURRENTDIR} > # If ${CURRENTFILE} exists and is a regular file, then make sure >@@ -30,6 +30,10 @@ then > # the (new) current file > rm -f ${CURRENTFILE} > ln -s ${CURRENTDIR}/${CURRENTFILE} ${CURRENTFILE} >+else >+ # If ${CURRENTFILE} exists, is a regular file and is from a previous >+ # month then delete it so that it is recreated by sadc afresh >+ [ -f ${CURRENTFILE} ] && [ "`date +%Y%m -r ${CURRENTFILE}`" -lt "${CURRENTDIR}" ] && rm -f ${CURRENTFILE} > fi > ENDIR=@SA_LIB_DIR@ > cd ${ENDIR} >diff -upr sysstat-9.0.4.orig/sa2.in sysstat-9.0.4/sa2.in >--- sysstat-9.0.4.orig/sa2.in 2014-05-15 18:17:41.079130000 +0200 >+++ sysstat-9.0.4/sa2.in 2014-05-22 16:37:06.436026491 +0200 >@@ -20,7 +20,7 @@ HISTORY=@HISTORY@ > COMPRESSAFTER=@COMPRESSAFTER@ > ZIP="@ZIP@" > [ -r ${SYSCONFIG_DIR}/sysstat ] && . ${SYSCONFIG_DIR}/sysstat >-if [ ${HISTORY} -gt 28 ] >+if [ ${HISTORY} -gt 25 ] > then > CURRENTDIR=`date ${YESTERDAY} +%Y%m` > cd ${DDIR} || exit 1 >diff -upr sysstat-9.0.4.orig/sadc.c sysstat-9.0.4/sadc.c >--- sysstat-9.0.4.orig/sadc.c 2009-07-18 15:19:57.000000000 +0200 >+++ sysstat-9.0.4/sadc.c 2014-05-22 16:35:12.157783158 +0200 >@@ -643,6 +643,7 @@ void open_ofile(int *ofd, char ofile[]) > { > struct file_magic file_magic; > struct file_activity file_act; >+ struct tm rectime; > ssize_t sz; > int i, p; > >@@ -687,6 +688,21 @@ void open_ofile(int *ofd, char ofile[]) > } > > /* >+ * If we are using the standard daily data file (file specified >+ * as "-" on the command line) and it is from a past month, >+ * then overwrite (truncate) it. >+ */ >+ get_time(&rectime); >+ >+ if (((file_hdr.sa_month != rectime.tm_mon) || >+ (file_hdr.sa_year != rectime.tm_year)) && >+ WANT_SA_ROTAT(flags)) { >+ close(*ofd); >+ create_sa_file(ofd, ofile); >+ return; >+ } >+ >+ /* > * OK: It's a true system activity file. > * List of activities from the file prevails over that of the user. > * So unselect all of them. And reset activity sequence. >diff -upr sysstat-9.0.4.orig/sysstat.sysconfig.in sysstat-9.0.4/sysstat.sysconfig.in >--- sysstat-9.0.4.orig/sysstat.sysconfig.in 2014-05-15 18:17:41.062130000 +0200 >+++ sysstat-9.0.4/sysstat.sysconfig.in 2014-05-22 16:43:57.765332794 +0200 >@@ -1,7 +1,7 @@ > # @PACKAGE_NAME@-@PACKAGE_VERSION@ configuration file. > > # How long to keep log files (in days). >-# If value is greater than 28, then log files are kept in >+# If value is greater than 25, then log files are kept in > # multiple directories, one for each month. > HISTORY=@HISTORY@ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 921612
:
898410
|
898661