Browse Source

Merge pull request #484 from Kizureina/fixTomcatUserNoLogin

Add a judgment on whether the tomcat-user is set to be unable to log in
Justo 2 years ago
parent
commit
30702708a9
1 changed files with 6 additions and 1 deletions
  1. 6 1
      init.d/Tomcat-init

+ 6 - 1
init.d/Tomcat-init

@@ -87,7 +87,12 @@ stop() {
 
 user_exists() {
   if id -u $1 >/dev/null 2>&1; then
-    echo "1"
+	islogin=`cat /etc/passwd | grep ^www: | grep nologin$`
+	if [ "${islogin: -7}" = "nologin" ]; then
+      echo "0"
+    else
+      echo "1"	
+    fi
   else
     echo "0"
   fi