Start wildfly as service
9,498
If you want to have a service available: from the script I would assume you need to do this:
WILDFLY_DIR=$INSTALL_DIR/wildfly
INSTALL_DIR=/opt
WILDFLY_USER="wildfly"
WILDFLY_SERVICE="wildfly"
....
echo "Registrating Wildfly as service..."
# if Debian-like distribution
if [ -r /lib/lsb/init-functions ]; then
cp $WILDFLY_DIR/bin/init.d/wildfly-init-debian.sh /etc/init.d/$WILDFLY_SERVICE
sed -i -e 's,NAME=wildfly,NAME='$WILDFLY_SERVICE',g' /etc/init.d/$WILDFLY_SERVICE
WILDFLY_SERVICE_CONF=/etc/default/$WILDFLY_SERVICE
fi
Ie. copy /opt/wildfly/bin/init.d/wildfly-init-debian.sh
over to /etc/init.d/wildfire
. Change the /etc/init.d/wildfire
and change the NAME to wildfly
and the part of the script a bit down explains how to start it as a service so you could make your own service from it.
Author by
jan
A Senior Development Engineer based in Mannheim, Germany.
Updated on September 18, 2022Comments
-
jan over 1 year
I installed wildfly on an ubuntu on a EC2 VM. I connect to the server via SSH and start the server with:
./standalone.sh --server-config=standalone-full.xml
This works fine until I terminate the SSH connection. How can I start this as service so it stays active after closing the SSH connection. Did not find any working guide about that. Is there any easy way to do that?
-
A.B. about 9 yearstry this:
./standalone.sh --server-config=standalone-full.xml & disown
-
A.B. about 9 yearsRelevant: stackoverflow.com/q/285015/3644902
-
Rinzwind about 9 yearsHave a look at this script: gist.github.com/sukharevd/6087988
-