Ver Fonte

必须以root用户启动

liangl há 11 anos atrás
pai
commit
c306e9925c
1 ficheiros alterados com 9 adições e 0 exclusões
  1. 9 0
      workerman/bin/workermand

+ 9 - 0
workerman/bin/workermand

@@ -87,6 +87,15 @@ if($cmd != 'status' && is_file(WORKERMAN_PID_FILE))
     }
 }
 
+// 必须是root启动
+if($user_info = posix_getpwuid(posix_getuid()))
+{
+    if($user_info['name'] !== 'root')
+    {
+        exit("\033[31;40mYou should ran Workerman as root , Permission denied\033[0m\n");
+    }
+}
+
 switch($cmd)
 {
     case 'start':