Lines 42-48
Link Here
|
42 |
|
42 |
|
43 |
# Define LSB log_* functions. |
43 |
# Define LSB log_* functions. |
44 |
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. |
44 |
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. |
45 |
. /lib/lsb/init-functions |
45 |
#. /lib/lsb/init-functions |
46 |
|
46 |
|
47 |
if [ -z $2 ]; then # empty string |
47 |
if [ -z $2 ]; then # empty string |
48 |
ARG_CONFIG="" |
48 |
ARG_CONFIG="" |
Lines 71-88
Link Here
|
71 |
# |
71 |
# |
72 |
# Function that starts the daemon/service |
72 |
# Function that starts the daemon/service |
73 |
# |
73 |
# |
74 |
do_start() |
74 |
start() |
75 |
{ |
75 |
{ |
76 |
# Return |
76 |
# Return |
77 |
# 0 if daemon has been started |
77 |
# 0 if daemon has been started |
78 |
# 1 if daemon was already running |
78 |
# 1 if daemon was already running |
79 |
# 2 if daemon could not be started |
79 |
# 2 if daemon could not be started |
80 |
|
80 |
|
81 |
start_daemon $DAEMON -b $ARG_CONFIG |
81 |
$DAEMON -b $ARG_CONFIG |
82 |
RET=$? |
82 |
RET=$? |
83 |
if [ $RET -eq 2 ]; then |
83 |
if [ $RET -eq 2 ]; then |
84 |
log_failure_msg "start_daemon failed to start btnx with full path. Trying without" |
84 |
echo "start_daemon failed to start btnx with full path. Trying without" |
85 |
start_daemon $NAME -b $ARG_CONFIG |
85 |
$NAME -b $ARG_CONFIG |
86 |
RET=$? |
86 |
RET=$? |
87 |
fi |
87 |
fi |
88 |
return $RET |
88 |
return $RET |
Lines 91-97
Link Here
|
91 |
# |
91 |
# |
92 |
# Function that stops the daemon/service |
92 |
# Function that stops the daemon/service |
93 |
# |
93 |
# |
94 |
do_stop() |
94 |
stop() |
95 |
{ |
95 |
{ |
96 |
# Return |
96 |
# Return |
97 |
# 0 if daemon has been stopped |
97 |
# 0 if daemon has been stopped |
Lines 110-120
Link Here
|
110 |
# [ $I -lt 1 ] && return 2 |
110 |
# [ $I -lt 1 ] && return 2 |
111 |
#done |
111 |
#done |
112 |
|
112 |
|
113 |
start_daemon $DAEMON -k |
113 |
$DAEMON -k |
114 |
RET=$? |
114 |
RET=$? |
115 |
if [ $RET -eq 2 ]; then |
115 |
if [ $RET -eq 2 ]; then |
116 |
log_failure_msg "start_daemon failed to stop btnx with full path. Trying without" |
116 |
echo "start_daemon failed to stop btnx with full path. Trying without" |
117 |
start_daemon $NAME -k |
117 |
$NAME -k |
118 |
RET=$? |
118 |
RET=$? |
119 |
fi |
119 |
fi |
120 |
return $RET |
120 |
return $RET |
Lines 143-149
Link Here
|
143 |
check_handlers |
143 |
check_handlers |
144 |
[ $? -ne 0 ] && exit 1 |
144 |
[ $? -ne 0 ] && exit 1 |
145 |
#do_stop |
145 |
#do_stop |
146 |
do_start |
146 |
start |
147 |
RET=$? |
147 |
RET=$? |
148 |
case "$RET" in |
148 |
case "$RET" in |
149 |
0) |
149 |
0) |
Lines 160-166
Link Here
|
160 |
;; |
160 |
;; |
161 |
stop) |
161 |
stop) |
162 |
echo "Stopping $NAME :" "$DESC" >&2 |
162 |
echo "Stopping $NAME :" "$DESC" >&2 |
163 |
do_stop |
163 |
stop |
164 |
case "$?" in |
164 |
case "$?" in |
165 |
0|1) |
165 |
0|1) |
166 |
echo "btnx successfully stopped" |
166 |
echo "btnx successfully stopped" |
Lines 189-200
Link Here
|
189 |
# 'force-reload' alias |
189 |
# 'force-reload' alias |
190 |
# |
190 |
# |
191 |
echo "Restarting $NAME :" "$DESC" >&2 |
191 |
echo "Restarting $NAME :" "$DESC" >&2 |
192 |
do_stop |
192 |
stop |
193 |
case "$?" in |
193 |
case "$?" in |
194 |
0|1) |
194 |
0|1) |
195 |
echo "btnx successfully stopped" |
195 |
echo "btnx successfully stopped" |
196 |
#log_success_msg "btnx successfully stopped" |
196 |
#log_success_msg "btnx successfully stopped" |
197 |
do_start |
197 |
start |
198 |
RET=$? |
198 |
RET=$? |
199 |
case "$RET" in |
199 |
case "$RET" in |
200 |
0) |
200 |
0) |