Debian Codegraph @

support/Startup/radium

raw
1 #!/bin/sh
2 # Argus Software
3 # Copyright (c) 2000-2024 QoSient, LLC
4 # All rights reserved.
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #
20 #
21 # radium This shell script takes care of starting and stopping radium.
22 #
23 # chkconfig: 2345 55 45
24 # description: radium-3.0 collects and processes argus data.
25 # processname: radium
26 # config: /etc/radium.conf
27
28 #
29 # The assumption here is that /etc/radium.conf specifies RADIUM_DAEMON=yes.
30 # If not the system will hang running radium. If this is not set, change
31 # "daemon radium" below to "daemon radium -d"
32 #
33
34 # Source function library.
35 if [ -f /etc/init.d/functions ]; then
36 . /etc/init.d/functions
37 else
38 if [ -f /etc/rc.d/init.d/functions ]; then
39 . /etc/init.d/functions
40 fi
41 fi
42
43 # Source networking configuration.
44 . /etc/sysconfig/network
45
46 # Check that networking is up.
47 [ ${NETWORKING} = "no" ] && exit 1
48
49
50 # Set radium path by defining $RADIUMHOME for this script.
51 # If radium was installed in another way, modify PATH to
52 # include the directory where the radium binary was installed.
53
54 RADIUMDIR=/usr/local/sbin
55 RADIUMHOME=$RADIUMDIR
56 export PATH=$RADIUMHOME:$PATH
57
58 [ -f $RADIUMHOME/radium ] || exit 1
59
60 RETVAL=0
61 RADIUM=$RADIUMDIR/radium
62 RADIUMOPTIONS="-de `hostname` -P 562 > /dev/null 2>&1"
63
64 start() {
65 # Start daemons.
66
67 echo -n "Starting radium: "
68 if [ ! -e /etc/radium.conf ]
69 then
70 initlog -c "$RADIUM $RADIUMOPTIONS" && success || failure
71 RETVAL=$?
72 else
73 radium > /dev/null 2>&1 && success || failure
74 RETVAL=$?
75 fi
76 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/radium
77 echo
78 }
79
80 stop() {
81 # Stop daemons.
82 echo -n "Stopping radium: "
83 killproc radium
84 RETVAL=$?
85 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/radium
86 echo
87 }
88
89 # See how we were called.
90 case "$1" in
91 start)
92 start
93 RETVAL=$?
94 ;;
95 stop)
96 stop
97 RETVAL=$?
98 ;;
99 restart|reload)
100 stop
101 start
102 RETVAL=$?
103 ;;
104 condrestart)
105 if [ -f /var/lock/subsys/radium ]; then
106 stop
107 start
108 RETVAL=$?
109 fi
110 ;;
111 status)
112 status radium
113 RETVAL=$?
114 ;;
115 *)
116 echo "Usage: radium {start|stop|restart|condrestart|status}"
117 exit 1
118 ;;
119 esac
120 exit $RETVAL