fix bug for install server to linux (using start-stop-daemon)

This commit is contained in:
wyy 2014-02-11 14:03:53 +08:00
parent b54afeb5a3
commit 7ec17a2cd6
3 changed files with 4 additions and 2 deletions

View File

@ -13,7 +13,7 @@ ENDIF()
ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(dict) ADD_SUBDIRECTORY(dict)
if (!${APPLE}) IF("${CMAKE_SYSTEM}" MATCHES "Linux")
ADD_SUBDIRECTORY(script) ADD_SUBDIRECTORY(script)
ADD_SUBDIRECTORY(conf) ADD_SUBDIRECTORY(conf)
endif() endif()

View File

@ -41,6 +41,8 @@ make test
### 启动服务 ### 启动服务
因为服务的后台运行需要`start-stop-daemon`在ubuntu下是自带的。但是在CentOS下就需要自己安装了。
``` ```
#Usage: /etc/init.d/cjserver {start|stop|restart|force-reload} #Usage: /etc/init.d/cjserver {start|stop|restart|force-reload}
#启动 #启动

View File

@ -20,7 +20,7 @@ case "$1" in
mkdir -p $RUNDIR mkdir -p $RUNDIR
touch $PIDFILE touch $PIDFILE
chmod 755 $RUNDIR chmod 755 $RUNDIR
if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --exec /bin/bash -- -c "$DAEMON $DAEMON_ARGS >> $LOGFILE 2>&1" if start-stop-daemon --start --quiet --pidfile $PIDFILE --exec /bin/bash -- -c "$DAEMON $DAEMON_ARGS >> $LOGFILE 2>&1"
then then
echo "$NAME." echo "$NAME."
else else