summaryrefslogtreecommitdiffstats
path: root/debian
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-11-23 14:27:36 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-11-23 14:27:36 +0300
commitb67a212bfab7329f8de3e55e456b8e5bad226e57 (patch)
treefce84e390994eb4fa666a1acf4266f09146611d7 /debian
parent1a2fc69abd82710d8ce0f3bfb48762bbe9f28e04 (diff)
downloadrspamd-b67a212bfab7329f8de3e55e456b8e5bad226e57.tar.gz
rspamd-b67a212bfab7329f8de3e55e456b8e5bad226e57.zip
Add reopenlog ability for debian scripts.
Diffstat (limited to 'debian')
-rwxr-xr-xdebian/rspamd.init15
-rw-r--r--debian/rspamd.logrotate2
2 files changed, 15 insertions, 2 deletions
diff --git a/debian/rspamd.init b/debian/rspamd.init
index e0ed45cfd..8af5866e4 100755
--- a/debian/rspamd.init
+++ b/debian/rspamd.init
@@ -88,6 +88,14 @@ do_reload() {
return 0
}
+#
+# Function that sends a SIGUSR1 to the daemon/service
+#
+do_reopenlog() {
+ start-stop-daemon --stop --signal 10 --quiet --pidfile $PIDFILE
+ return 0
+}
+
_retcode=0
for ((i=0; i < $CONFIG_NUM; i++)); do
@@ -118,6 +126,11 @@ for ((i=0; i < $CONFIG_NUM; i++)); do
do_reload
log_end_msg $?
;;
+ reopenlog)
+ log_daemon_msg "Reopen logs for $DESC" "$NAME"
+ do_reopenlog
+ log_end_msg $?
+ ;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
@@ -137,7 +150,7 @@ for ((i=0; i < $CONFIG_NUM; i++)); do
esac
;;
*)
- echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
+ echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|reopenlog}" >&2
exit 3
;;
esac
diff --git a/debian/rspamd.logrotate b/debian/rspamd.logrotate
index 2d0175677..dca9cfadf 100644
--- a/debian/rspamd.logrotate
+++ b/debian/rspamd.logrotate
@@ -6,7 +6,7 @@
notifempty
missingok
postrotate
- reload rspamd >/dev/null 2>&1 || true
+ service rspamd reopenlog >/dev/null 2>&1 || true
endscript
}