forked from cmsdaq/merger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dfMerger
executable file
·60 lines (48 loc) · 1.31 KB
/
dfMerger
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /bin/bash
# cmsDataFlowMerger_initd
#
# dfMerger Init file used for starting / stoppping the CMS Data Flow Merger.
#
# chkconfig: 2345 85 25
# description: The daemon which does the mini and macro merging.
# processname: dataFlowMerger
# pidfile: /var/run/dfMerger.pid
###########################################################
################### Managed by puppet #####################
###########################################################
# Source function library.
. /etc/rc.d/init.d/functions
prog="dataFlowMerger"
#TODO: decide on the final location, both for the wrapper and for the core script
scriptFile="/opt/merger/$prog"
RETVAL=0
# See how we were called.
case "$1" in
start)
echo -n "Starting $prog: "
$scriptFile start > /dev/null
RETVAL=$?
[ $RETVAL -eq 0 ] && success "$prog startup" || failure "$prog startup"
echo
;;
stop)
echo -n "Stopping $prog: "
$scriptFile stop > /dev/null
RETVAL=$?
[ $RETVAL -eq 0 ] && success "$prog stop" || failure "$prog stop"
echo
;;
status)
$scriptFile status
RETVAL=$?
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
*)
echo "Usage: $prog {start|stop|status|restart}"
exit 1
esac
exit $RETVAL