mirror of
https://github.com/openvswitch/ovs
synced 2025-10-17 14:28:02 +00:00
debian, xenserver: Update logrotate config to match RHEL.
Commit 618a5b45ae
("rhel: Avoid logrotate error if /var/run/openvswitch
does not exist") updated the RHEL logrotate configuration. This commit
makes similar changes for Debian, by synchronizing with the RHEL version.
In particular:
- Indent to match logrotate.conf(5) examples.
- Use "sharedscripts" flag, because the postrotate script only needs to
run once regardless of the number of rotations.
- Drop "delaycompress", because the postrotate script does make daemons
reopen their log files.
- Ignore errors calling vlog/reopen.
Also make similar changes to the xenserver logrotate script. I confirmed
via Twitter that the xenserver packaging still has users.
CC: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Gurucharan Shetty <guru@ovn.org>
This commit is contained in:
14
debian/openvswitch-switch.logrotate
vendored
14
debian/openvswitch-switch.logrotate
vendored
@@ -1,16 +1,16 @@
|
|||||||
/var/log/openvswitch/*.log {
|
/var/log/openvswitch/*.log {
|
||||||
daily
|
daily
|
||||||
compress
|
compress
|
||||||
|
sharedscripts
|
||||||
create 640 root adm
|
create 640 root adm
|
||||||
delaycompress
|
|
||||||
missingok
|
missingok
|
||||||
rotate 30
|
rotate 30
|
||||||
postrotate
|
postrotate
|
||||||
# Tell Open vSwitch daemons to reopen their log files
|
# Tell Open vSwitch daemons to reopen their log files
|
||||||
if [ -d /var/run/openvswitch ]; then
|
if [ -d /var/run/openvswitch ]; then
|
||||||
for pidfile in `cd /var/run/openvswitch && echo *.pid`; do
|
for pidfile in `cd /var/run/openvswitch && echo *.pid`; do
|
||||||
ovs-appctl -t "${pidfile%%.pid}" vlog/reopen
|
ovs-appctl -t "${pidfile%%.pid}" vlog/reopen 2>/dev/null || :
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
endscript
|
endscript
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (C) 2009, 2010, 2011, 2012 Nicira, Inc.
|
# Copyright (C) 2009, 2010, 2011, 2012, 2017 Nicira, Inc.
|
||||||
#
|
#
|
||||||
# Copying and distribution of this file, with or without modification,
|
# Copying and distribution of this file, with or without modification,
|
||||||
# are permitted in any medium without royalty provided the copyright
|
# are permitted in any medium without royalty provided the copyright
|
||||||
@@ -6,14 +6,16 @@
|
|||||||
# without warranty of any kind.
|
# without warranty of any kind.
|
||||||
|
|
||||||
/var/log/openvswitch/*.log {
|
/var/log/openvswitch/*.log {
|
||||||
daily
|
daily
|
||||||
compress
|
compress
|
||||||
sharedscripts
|
sharedscripts
|
||||||
missingok
|
missingok
|
||||||
postrotate
|
postrotate
|
||||||
# Tell Open vSwitch daemons to reopen their log files
|
# Tell Open vSwitch daemons to reopen their log files
|
||||||
for pidfile in `cd /var/run/openvswitch && echo *.pid`; do
|
if [ -d /var/run/openvswitch ]; then
|
||||||
ovs-appctl -t "${pidfile%%.pid}" vlog/reopen
|
for pidfile in `cd /var/run/openvswitch && echo *.pid`; do
|
||||||
done
|
ovs-appctl -t "${pidfile%%.pid}" vlog/reopen 2>/dev/null || :
|
||||||
endscript
|
done
|
||||||
|
fi
|
||||||
|
endscript
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user