diff --git a/CMakeLists.txt b/CMakeLists.txt index 56361fb..121a7f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ ENDIF() ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(dict) -if (!${APPLE}) +IF("${CMAKE_SYSTEM}" MATCHES "Linux") ADD_SUBDIRECTORY(script) ADD_SUBDIRECTORY(conf) endif() diff --git a/README.md b/README.md index 71bfb86..3713c04 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ make test ### 启动服务 +因为服务的后台运行需要`start-stop-daemon`,在ubuntu下是自带的。但是在CentOS下就需要自己安装了。 + ``` #Usage: /etc/init.d/cjserver {start|stop|restart|force-reload} #启动 diff --git a/script/cjserver b/script/cjserver index 11cf5f2..85666f0 100755 --- a/script/cjserver +++ b/script/cjserver @@ -20,7 +20,7 @@ case "$1" in mkdir -p $RUNDIR touch $PIDFILE 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 echo "$NAME." else