Package: dovecot-common Version: 1:1.0.3-3 Severity: important Tags: patch
I changed my default configuration to log to a file instead of using syslog. Currently if one wants to use logrotate, he must hardcode the pid file location in the postrotate section of the logrotate script. A cleaner solution is to use /etc/init.d/dovecot reload, which already knows about all pid file locations. The attached patch implements a reload of the logging subsystem by sending a USR1 signal to dovecot as described here: http://wiki.dovecot.org/Logging#head-8886f6e09e2f691a4c45448f18f914c124dead50 If you find this useful feel free to include in the official distribution. HTH Peter
--- dovecot.org 2007-08-16 03:53:14.000000000 -0400 +++ dovecot 2007-09-06 05:13:04.000000000 -0400 @@ -118,7 +118,7 @@ # restarting (for example, when it is sent a SIGHUP), # then implement that here. # - start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME + start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE --name $NAME return 0 } @@ -140,20 +140,12 @@ 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; - #reload|force-reload) - # - # If do_reload() is not implemented then leave this commented out - # and leave 'force-reload' as an alias for 'restart'. - # - #log_daemon_msg "Reloading $DESC" "$NAME" - #do_reload - #log_end_msg $? - #;; - restart|force-reload) - # - # If the "reload" option is implemented then remove the - # 'force-reload' alias - # + reload|force-reload) + log_daemon_msg "Reloading $DESC" "$NAME" + do_reload + log_end_msg $? + ;; + restart) log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in @@ -172,8 +164,7 @@ esac ;; *) - #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 exit 3 ;; esac