Ver código fonte

修改启动启动和停止时的日志

tangs 6 anos atrás
pai
commit
1df539b94a
1 arquivos alterados com 4 adições e 3 exclusões
  1. 4 3
      server.sh

+ 4 - 3
server.sh

@@ -24,8 +24,8 @@ start (){
 		exit
 	fi
 
-	start-stop-daemon --start --make-pidfile --background --pidfile=$PROCESS --chuid=$USER --exec=$DAEMON
-	echo "$NAME start successful, pid(`cat $PROCESS`)"
+	start-stop-daemon --start --make-pidfile --background --pidfile=$PROCESS --user=$USER --exec=$DAEMON
+	test $? -ne 0 || echo "$NAME start successful, pid(`cat $PROCESS`)"
 }
 
 # Stop the server
@@ -34,10 +34,11 @@ stop (){
 	start-stop-daemon --status --pidfile=$PROCESS
 	if [ $? != 0 ]; then
 		echo "$NAME is not running"
+		exit
 	fi
 
 	start-stop-daemon --stop --pidfile=$PROCESS
-	echo "$NAME stop successful"
+	test $? -ne 0 || echo "$NAME stop successful"
 }
 
 # Return the status of the server