Skip to content

Commit c2f7b07

Browse files
update for more stable work stop command
update script /etc/comet-server/comet-service.sh for more stable work stop command. For start/stop/restart use this commands: service comet restart service comet stop service comet start
1 parent 9b32e20 commit c2f7b07

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

comet-service.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PIDFILE=/var/run/cppcomet.pid
1111
cd ${RUNDIR}
1212

1313
case "$1" in
14-
start)
14+
start)
1515
if test -f "$PIDFILE"
1616
then
1717
echo "CppComet already run"
@@ -24,25 +24,28 @@ case "$1" in
2424
if test -f "$PIDFILE"
2525
then
2626
echo "Stopping CppComet"
27+
killall cppcomet
2728
kill `cat $PIDFILE`
2829
`rm -rf $PIDFILE`
2930
else
30-
echo "pid file does not exist"
31-
echo 'exit' > /tmp/cpp.comet
31+
echo "Stopping CppComet"
32+
killall cppcomet
33+
#echo "pid file does not exist"
34+
#echo 'exit' > /tmp/cpp.comet
3235
fi
3336
;;
34-
*)
37+
*)
3538
if test -f "$PIDFILE"
3639
then
3740
echo "Stopping CppComet"
41+
killall -9 cppcomet
3842
kill `cat $PIDFILE`
3943
`rm -rf $PIDFILE`
4044
else
4145
echo "pid file does not exist"
4246
fi
4347
echo "Starting CppComet"
44-
/usr/bin/cppcomet > /var/log/cpp_comet.log 2>/var/log/cpp_comet.log &
48+
sleep 15
49+
/usr/bin/cppcomet --conf /etc/comet-server/comet.ini > /var/log/cpp_comet.log 2>/var/log/cpp_comet.log &
4550
;;
4651
esac
47-
48-

0 commit comments

Comments
 (0)