r101885 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101884‎ | r101885 | r101886 >
Date:21:28, 3 November 2011
Author:asher
Status:deferred
Tags:
Comment:
also start carbon collector if installed
Modified paths:
  • /trunk/udpprofile/debian/changelog (modified) (history)
  • /trunk/udpprofile/debian/udpprofile.init (modified) (history)

Diff [purge]

Index: trunk/udpprofile/debian/changelog
@@ -1,3 +1,9 @@
 2+udpprofile (1.1-2) lucid-wikimedia; urgency=low
 3+
 4+ * init also starts carbon collector if installed
 5+
 6+ -- Asher Feldman <afeldman@wikimedia.org> Thu, 03 Nov 2011 21:28:00 +0000
 7+
28 udpprofile (1.1-1) lucid-wikimedia; urgency=low
39
410 * init and py path fixes
Index: trunk/udpprofile/debian/udpprofile.init
@@ -17,6 +17,7 @@
1818 DESC="UDP Profile Collector"
1919 DAEMON="/usr/udpprofile/sbin/collector"
2020 DAEMON2="/usr/udpprofile/sbin/profiler-to-carbon"
 21+DAEMON3="/opt/graphite/bin/carbon-cache.py"
2122
2223 USER="nobody"
2324 SCRIPTNAME=/etc/init.d/udpprofile
@@ -55,6 +56,13 @@
5657 --exec /usr/bin/python -- /usr/udpprofile/sbin/profiler-to-carbon > /dev/null || return 2
5758 fi
5859
 60+ if [ -x "$DAEMON3" ] ; then
 61+ start-stop-daemon --start --quiet --pidfile /opt/graphite/storage/carbon-cache-a.pid -d /tmp \
 62+ --exec /usr/bin/python --test -- $DAEMON3 start > /dev/null || return 1
 63+ start-stop-daemon --start --quiet --pidfile /opt/graphite/storage/carbon-cache-a.pid -d /tmp \
 64+ --exec /usr/bin/python -- $DAEMON3 start > /dev/null || return 2
 65+ fi
 66+
5967 # Add code here, if necessary, that waits for the process to be ready
6068 # to handle requests from services started subsequently which depend
6169 # on this one. As a last resort, sleep for some time.
@@ -72,7 +80,8 @@
7381 # other if a failure occurred
7482 start-stop-daemon --stop --quiet -c $USER --exec $DAEMON
7583 RETVAL="$?"
76 - start-stop-daemon --stop --quiet -c $USER --exec $DAEMON2
 84+ [ -x "$DAEMON2" ] && start-stop-daemon --stop --quiet -c $USER --exec $DAEMON2
 85+ [ -x "$DAEMON2" ] && start-stop-daemon --stop --quiet -c $USER --exec $DAEMON3
7786 [ "$RETVAL" = 2 ] && return 2
7887 return "$RETVAL"
7988 }

Status & tagging log