diff options
author | Hubert Plociniczak <hubert@lshift.net> | 2008-08-27 13:39:22 +0100 |
---|---|---|
committer | Hubert Plociniczak <hubert@lshift.net> | 2008-08-27 13:39:22 +0100 |
commit | 5a4dcf246250bd44300bca11ccf07d656b0cfbc2 (patch) | |
tree | 65cf0efb67f68488d465bc8bbefbcb62b8159cb7 | |
parent | 23f9b0a9da27d87deda1875d9d60de9a9f5ea30c (diff) | |
download | rabbitmq-server-5a4dcf246250bd44300bca11ccf07d656b0cfbc2.tar.gz |
Logrotate script calls init.d script instead
of calling rabbitmq-multi directly
-rw-r--r-- | packaging/RPMS/Fedora/init.d | 14 | ||||
-rw-r--r-- | packaging/RPMS/Fedora/rabbitmq-server.logrotate | 2 | ||||
-rw-r--r-- | packaging/debs/Debian/debian/init.d | 15 | ||||
-rw-r--r-- | packaging/debs/Debian/debian/rabbitmq-server.logrotate | 2 |
4 files changed, 29 insertions, 4 deletions
diff --git a/packaging/RPMS/Fedora/init.d b/packaging/RPMS/Fedora/init.d index a7e6b98c..dc0c2698 100644 --- a/packaging/RPMS/Fedora/init.d +++ b/packaging/RPMS/Fedora/init.d @@ -23,6 +23,7 @@ NAME=rabbitmq-server DESC=rabbitmq-server USER=rabbitmq NODE_COUNT=1 +ROTATE_SUFFIX= LOCK_FILE=/var/lock/subsys/$NAME @@ -82,6 +83,13 @@ restart_rabbitmq () { echo "$NAME." } +rotate_logs_rabbitmq() { + set +e + su $USER -s /bin/sh -c "$DAEMON rotate_logs_all ${ROTATE_SUFFIX}" 2>&1 + RETVAL=$? + set -e +} + case "$1" in start) echo -n "Starting $DESC: " @@ -93,6 +101,10 @@ case "$1" in stop_rabbitmq echo "$NAME." ;; + rotate-logs) + echo -n "Rotating log files for $DESC: " + rotate_logs_rabbitmq + ;; force-reload|reload|restart) restart_rabbitmq ;; @@ -106,7 +118,7 @@ case "$1" in restart_rabbitmq ;; *) - echo "Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" >&2 + echo "Usage: $0 {start|stop|rotate-logs|status|restart|condrestart|try-restart|reload|force-reload}" >&2 RETVAL=1 ;; esac diff --git a/packaging/RPMS/Fedora/rabbitmq-server.logrotate b/packaging/RPMS/Fedora/rabbitmq-server.logrotate index 8b5811d8..64cd01a1 100644 --- a/packaging/RPMS/Fedora/rabbitmq-server.logrotate +++ b/packaging/RPMS/Fedora/rabbitmq-server.logrotate @@ -7,6 +7,6 @@ notifempty sharedscripts postrotate - /usr/sbin/rabbitmq-multi rotate_logs_all > /dev/null 2>&1 + /sbin/service rabbitmq-server rotate-logs endscript }
\ No newline at end of file diff --git a/packaging/debs/Debian/debian/init.d b/packaging/debs/Debian/debian/init.d index ae82dd5c..c3c180a8 100644 --- a/packaging/debs/Debian/debian/init.d +++ b/packaging/debs/Debian/debian/init.d @@ -15,6 +15,7 @@ NAME=rabbitmq-server DESC=rabbitmq-server USER=rabbitmq NODE_COUNT=1 +ROTATE_SUFFIX= test -x $DAEMON || exit 0 @@ -51,6 +52,14 @@ stop_rabbitmq () { set -e } +rotate_logs_rabbitmq() { + set +e + su $USER -s /bin/sh -c "$DAEMON rotate_logs_all ${ROTATE_SUFFIX}" 2>&1 + RETVAL=$? + set -e + +} + case "$1" in start) echo -n "Starting $DESC: " @@ -62,6 +71,10 @@ case "$1" in stop_rabbitmq echo "$NAME." ;; + rotate-logs) + echo -n "Rotating log files for $DESC: " + rotate_logs_rabbitmq + ;; force-reload|restart) echo -n "Restarting $DESC: " stop_rabbitmq @@ -69,7 +82,7 @@ case "$1" in echo "$NAME." ;; *) - echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + echo "Usage: $0 {start|stop|rotate-logs|restart|force-reload}" >&2 exit 1 ;; esac diff --git a/packaging/debs/Debian/debian/rabbitmq-server.logrotate b/packaging/debs/Debian/debian/rabbitmq-server.logrotate index 8b5811d8..247635d1 100644 --- a/packaging/debs/Debian/debian/rabbitmq-server.logrotate +++ b/packaging/debs/Debian/debian/rabbitmq-server.logrotate @@ -7,6 +7,6 @@ notifempty sharedscripts postrotate - /usr/sbin/rabbitmq-multi rotate_logs_all > /dev/null 2>&1 + /etc/init.d/rabbitmq-server rotate-logs endscript }
\ No newline at end of file |