Browse Source

* add log rotation to debian package

master
Alex 'AdUser' Z 7 years ago
parent
commit
968030ad40
  1. 15
      debian/f2b.init
  2. 11
      debian/f2b.logrotate

15
debian/f2b.init vendored

@ -77,6 +77,14 @@ do_stop()
return "$RETVAL"
}
#
# Rotate log files
#
do_rotate() {
start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
@ -115,8 +123,13 @@ case "$1" in
;;
esac
;;
rotate)
log_daemon_msg "Re-opening $DESC log files" "$NAME"
do_rotate
log_end_msg $?
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload|rotate}" >&2
exit 3
;;
esac

11
debian/f2b.logrotate vendored

@ -0,0 +1,11 @@
/var/log/f2b.log {
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
[ -e /var/run/f2b.pid ] && invoke-rc.d f2b rotate > /dev/null
endscript
}
Loading…
Cancel
Save