зеркало из https://github.com/Azure/Avere.git
update cachewarmer syslog configuration including rotate (#1288)
This commit is contained in:
Родитель
a37b277581
Коммит
f5058ac019
|
@ -79,6 +79,27 @@ function configure_rsyslog() {
|
||||||
# enable listen on port 514/TCP
|
# enable listen on port 514/TCP
|
||||||
sed -i 's/^#module(load="imtcp")/module(load="imtcp")/g' /etc/rsyslog.conf
|
sed -i 's/^#module(load="imtcp")/module(load="imtcp")/g' /etc/rsyslog.conf
|
||||||
sed -i 's/^#input(type="imtcp" port="514")/input(type="imtcp" port="514")/g' /etc/rsyslog.conf
|
sed -i 's/^#input(type="imtcp" port="514")/input(type="imtcp" port="514")/g' /etc/rsyslog.conf
|
||||||
|
|
||||||
|
# ensure the logs are rotating
|
||||||
|
if grep -F --quiet "/var/log/cachewarmer-manager.log" /etc/logrotate.d/rsyslog; then
|
||||||
|
echo "not updating /etc/logrotate.d/rsyslog, already there"
|
||||||
|
else
|
||||||
|
/bin/cat <<EOM >>/etc/logrotate.d/rsyslog
|
||||||
|
/var/log/cachewarmer-manager.log
|
||||||
|
{
|
||||||
|
rotate 2
|
||||||
|
daily
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
compress
|
||||||
|
postrotate
|
||||||
|
/usr/lib/rsyslog/rsyslog-rotate
|
||||||
|
endscript
|
||||||
|
}
|
||||||
|
EOM
|
||||||
|
fi
|
||||||
|
|
||||||
|
# restart syslog
|
||||||
systemctl restart rsyslog
|
systemctl restart rsyslog
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,26 @@ function configure_rsyslog() {
|
||||||
# enable listen on port 514/TCP
|
# enable listen on port 514/TCP
|
||||||
sed -i 's/^#module(load="imtcp")/module(load="imtcp")/g' /etc/rsyslog.conf
|
sed -i 's/^#module(load="imtcp")/module(load="imtcp")/g' /etc/rsyslog.conf
|
||||||
sed -i 's/^#input(type="imtcp" port="514")/input(type="imtcp" port="514")/g' /etc/rsyslog.conf
|
sed -i 's/^#input(type="imtcp" port="514")/input(type="imtcp" port="514")/g' /etc/rsyslog.conf
|
||||||
|
|
||||||
|
# ensure the logs are rotating
|
||||||
|
if grep -F --quiet "/var/log/cachewarmer-worker.log" /etc/logrotate.d/rsyslog; then
|
||||||
|
echo "not updating /etc/logrotate.d/rsyslog, already there"
|
||||||
|
else
|
||||||
|
/bin/cat <<EOM >>/etc/logrotate.d/rsyslog
|
||||||
|
/var/log/cachewarmer-worker.log
|
||||||
|
{
|
||||||
|
rotate 2
|
||||||
|
daily
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
compress
|
||||||
|
postrotate
|
||||||
|
/usr/lib/rsyslog/rsyslog-rotate
|
||||||
|
endscript
|
||||||
|
}
|
||||||
|
EOM
|
||||||
|
fi
|
||||||
|
|
||||||
systemctl restart rsyslog
|
systemctl restart rsyslog
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
if $programname == 'cachewarmer-manager' or $syslogtag == 'cachewarmer-manager' then /var/log/cachewarmer/manager.log
|
if $programname == 'cachewarmer-manager' or $syslogtag == 'cachewarmer-manager' then /var/log/cachewarmer-manager.log
|
||||||
& stop
|
& stop
|
|
@ -1,2 +1,2 @@
|
||||||
if $programname == 'cachewarmer-worker' or $syslogtag == 'cachewarmer-worker' then /var/log/cachewarmer/worker.log
|
if $programname == 'cachewarmer-worker' or $syslogtag == 'cachewarmer-worker' then /var/log/cachewarmer-worker.log
|
||||||
& stop
|
& stop
|
Загрузка…
Ссылка в новой задаче