Created
May 22, 2012 13:13
-
-
Save linmx0130/2768963 to your computer and use it in GitHub Desktop.
the script to start cbojserver as a daemon under CentOS/RHEL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# /etc/init.d/cbojserver | |
# | |
# Starts the cboj daemon to support a powerful online judger system | |
# | |
# chkconfig 345 28 72 | |
# description: Support online judge system, listen the request and judge. | |
# processname: ctserver ctester | |
# Source funciton library. | |
. /etc/rc.d/init.d/functions | |
#TODO | |
PATH=/usr/local/bin:/usr/bin:/bin | |
export PATH | |
start() { | |
echo -n "Starting cboj..." | |
daemon /usr/local/bin/ctserver & | |
#In fact here is a bug, ctserver can't start | |
#daemon /usr/local/bin/ctester | |
} | |
stop(){ | |
echo -n "Stopping cboj..." | |
killall /usr/local/bin/ctserver | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
define PATH is very important