I want to start wildfly as a service but nothing happens when I try to start it using:
$ /etc/init.d/wildfly start Starting WildFly Application Server: wildfly $ ls -l /etc/init.d/wildfly -rwxr-xr-x 1 root root 6786 Feb 10 16:06 /etc/init.d/wildfly
Then, when I type
ps -ef
, there is no wildfly or java process.I followed this post: How can I install WildFly 8.0.0.Final as service on Ubuntu Linux?
It works using this command:
/opt/wildfly/bin/standalone.sh
Permission on wildfly folder are:$ ls -l /opt total 8 drwxr-xr-x 11 sonar adm 4096 Feb 11 08:38 sonar lrwxrwxrwx 1 wildfly wildfly 25 Feb 10 16:06 wildfly -> /opt/wildfly-8.2.0.Final/ drwxr-xr-x 10 wildfly wildfly 4096 Nov 21 05:43 wildfly-8.2.0.Final
I have the following java version:
# java -version java version "1.8.0_31" Java(TM) SE Runtime Environment (build 1.8.0_31-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
Why init.d wildfly service does not work?
Answer
I’ve found the problem and the solution. It is because pidofproc
command is missing.
Line 151:
check_status() {
pidofproc -p "$JBOSS_PIDFILE" "$JAVA" >/dev/null 2>&1
}
I fixed it at line 158 by replacing:
check_status
status_start=$?
if [ $status_start -eq 3 ]; then
#...
fi
By:
check_status
status_start=$?
if [ $status_start -ge 3 ]; then
#...
fi
Attribution
Source : Link , Question Author : Athanor , Answer Author : Athanor