]> source.dussan.org Git - rspamd.git/commitdiff
Add reopenlog ability for debian scripts.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 23 Nov 2011 11:27:36 +0000 (14:27 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 23 Nov 2011 11:27:36 +0000 (14:27 +0300)
debian/rspamd.init
debian/rspamd.logrotate

index e0ed45cfda76e928d08daf4cce000eb23f3a093a..8af5866e474d31aa51a89a774efc62dfc23376c5 100755 (executable)
@@ -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
index 2d0175677a30d0c985f8978ae80f369d79e69c3e..dca9cfadf6626abd773ef0f15b0751eff2ca4feb 100644 (file)
@@ -6,7 +6,7 @@
        notifempty
        missingok
        postrotate
-          reload rspamd >/dev/null 2>&1 || true
+          service rspamd reopenlog >/dev/null 2>&1 || true
        endscript
 }