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 | + |
2 | 8 | udpprofile (1.1-1) lucid-wikimedia; urgency=low |
3 | 9 | |
4 | 10 | * init and py path fixes |
Index: trunk/udpprofile/debian/udpprofile.init |
— | — | @@ -17,6 +17,7 @@ |
18 | 18 | DESC="UDP Profile Collector" |
19 | 19 | DAEMON="/usr/udpprofile/sbin/collector" |
20 | 20 | DAEMON2="/usr/udpprofile/sbin/profiler-to-carbon" |
| 21 | +DAEMON3="/opt/graphite/bin/carbon-cache.py" |
21 | 22 | |
22 | 23 | USER="nobody" |
23 | 24 | SCRIPTNAME=/etc/init.d/udpprofile |
— | — | @@ -55,6 +56,13 @@ |
56 | 57 | --exec /usr/bin/python -- /usr/udpprofile/sbin/profiler-to-carbon > /dev/null || return 2 |
57 | 58 | fi |
58 | 59 | |
| 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 | + |
59 | 67 | # Add code here, if necessary, that waits for the process to be ready |
60 | 68 | # to handle requests from services started subsequently which depend |
61 | 69 | # on this one. As a last resort, sleep for some time. |
— | — | @@ -72,7 +80,8 @@ |
73 | 81 | # other if a failure occurred |
74 | 82 | start-stop-daemon --stop --quiet -c $USER --exec $DAEMON |
75 | 83 | 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 |
77 | 86 | [ "$RETVAL" = 2 ] && return 2 |
78 | 87 | return "$RETVAL" |
79 | 88 | } |