2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 03:32:04 +00:00

Merge pull request #166 from neo954/story50687log

Story50687 xCAT customize rsyslog configuration files and logrotate configuration file
This commit is contained in:
yangsong 2015-09-16 17:45:22 +08:00
commit d4244e4710
8 changed files with 34 additions and 0 deletions

View File

@ -100,6 +100,7 @@ function makexcat {
tar --exclude .svn -czf $RPMROOT/SOURCES/prescripts.tar.gz prescripts
tar --exclude .svn -czf $RPMROOT/SOURCES/templates.tar.gz templates
tar --exclude .svn -czf $RPMROOT/SOURCES/winpostscripts.tar.gz winpostscripts
tar --exclude .svn -czf $RPMROOT/SOURCES/etc.tar.gz etc
cp xcat.conf $RPMROOT/SOURCES
cp xcat.conf.apach24 $RPMROOT/SOURCES
cp xCATMN $RPMROOT/SOURCES

View File

@ -7,4 +7,6 @@ opt/xcat/share/xcat
etc/apache2/conf.d
etc/apache2/conf-available
etc/apache2/conf-enabled
etc/logrotate.d
etc/rsyslog.d
opt/xcat/share/doc/packages/xCAT

View File

@ -6,3 +6,5 @@ postscripts/* install/postscripts/
prescripts/* install/prescripts/
templates/* opt/xcat/share/xcat/templates/
xCATMN etc/
etc/logrotate.d/* etc/logrotate.d/
etc/rsyslog.d/* etc/rsyslog.d/

View File

@ -45,6 +45,8 @@ case "$1" in
ln -s -f /etc/apache2/conf-available/xcat.conf.apach24 /etc/apache2/conf-enabled/xcat.conf
/etc/init.d/apache2 restart
kill -HUP $(</var/run/rsyslogd.pid) >/dev/null 2>&1 || :
;;
abort-upgrade|abort-remove|abort-deconfigure)

View File

@ -0,0 +1,7 @@
/var/log/xcat/*.log {
missingok
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

View File

@ -0,0 +1,2 @@
$template xCATTraditionalFormat0,"%timegenerated% %HOSTNAME% %syslogtag% %msg:::drop-last-lf%\n"
:programname, isequal, "xcat" /var/log/xcat/cluster.log;xCATTraditionalFormat0

View File

@ -0,0 +1,2 @@
$template xCATTraditionalFormat9,"%timegenerated% %HOSTNAME% %syslogtag% %msg:::drop-last-lf%\n"
:fromhost-ip, !isequal, "127.0.0.1" /var/log/xcat/computes.log;xCATTraditionalFormat9

View File

@ -18,6 +18,7 @@ Source5: xCATMN
%ifos linux
Source4: prescripts.tar.gz
Source6: winpostscripts.tar.gz
Source8: etc.tar.gz
%endif
Source7: xcat.conf.apach24
@ -86,6 +87,7 @@ hardware management and software management.
tar zxf %{SOURCE2}
tar zxf %{SOURCE4}
tar zxf %{SOURCE6}
tar zxf %{SOURCE8}
%else
rm -rf postscripts
cp %{SOURCE2} /opt/freeware/src/packages/BUILD
@ -125,6 +127,8 @@ fi
mkdir -p $RPM_BUILD_ROOT/etc/xcat/conf.orig
mkdir -p $RPM_BUILD_ROOT/etc/apache2/conf.d
mkdir -p $RPM_BUILD_ROOT/etc/httpd/conf.d
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
mkdir -p $RPM_BUILD_ROOT/etc/rsyslog.d
mkdir -p $RPM_BUILD_ROOT/install/postscripts
mkdir -p $RPM_BUILD_ROOT/install/prescripts
mkdir -p $RPM_BUILD_ROOT/install/kdump
@ -140,6 +144,13 @@ tar -xf templates.tar
rm templates.tar
%endif
cd -
cd $RPM_BUILD_ROOT
%ifos linux
tar zxf %{SOURCE8}
%endif
cd -
cd $RPM_BUILD_ROOT/install
@ -190,6 +201,8 @@ then
cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/apache2/conf.d/xcat.conf
fi
# Lets rsyslogd perform close all open files
kill -HUP $(</var/run/rsyslogd.pid) >/dev/null 2>&1 || :
%endif
# create dir for the current pid
@ -232,6 +245,9 @@ exit 0
/install/postscripts
/install/prescripts
%ifos linux
/etc/logrotate.d/xcat
/etc/rsyslog.d/xcat-cluster.conf
/etc/rsyslog.d/xcat-compute.conf
/install/winpostscripts
%endif
%defattr(-,root,root)