Parcourir la 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 il y a 2 ans
Parent
commit
30702708a9
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  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