Add a judgment on whether the tomcat-user is set to be unable to log in
@@ -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