Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jenslohmann/d083f5172da6071cbc75 to your computer and use it in GitHub Desktop.
Save jenslohmann/d083f5172da6071cbc75 to your computer and use it in GitHub Desktop.
Wildfly 9.0 startup scripts for Debian 8.2 (systemd) inspired by files from wildfly 10 distribution
[Unit]
Description=The WildFly Application Server
After=syslog.target network.target
Before=httpd.service
[Service]
Environment=LAUNCH_JBOSS_IN_BACKGROUND=1
EnvironmentFile=-/etc/wildfly/wildfly.conf
User=wildfly
LimitNOFILE=102642
PIDFile=/var/run/wildfly/wildfly.pid
ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND $WILDFLY_MANAGEMENTBIND
StandardOutput=null
[Install]
WantedBy=multi-user.target
# The configuration you want to run
WILDFLY_CONFIG=standalone-full.xml
# The mode you want to run
WILDFLY_MODE=standalone
# The address to bind to
WILDFLY_BIND=127.0.0.1
WILDFLY_MANAGEMENTBIND=0.0.0.0
# Be sure to set the proper JAVA_HOME
JAVA_HOME=/opt/jdk
#!/bin/sh
if [ "x$WILDFLY_HOME" = "x" ]; then
WILDFLY_HOME="/opt/wildfly"
fi
if [[ "$1" == "domain" ]]; then
$WILDFLY_HOME/bin/domain.sh --server-config=$2 -b=$3 -bmanagement=$4
else
$WILDFLY_HOME/bin/standalone.sh --server-config=$2 -b=$3 -bmanagement=$4
fi
groupadd -r wildfly
useradd -r -g wildfly -d /opt/wildfly -s /sbin/nologin wildfly
== Install WildFly
tar xvzf wildfly-9.0.1.Final.tar.gz -C /opt
ln -s /opt/wildfly-9.0.1.Final /opt/wildfly
chown -R wildfly:wildfly /opt/wildfly
== Configure systemd
mkdir /etc/wildfly
mkdir /var/run/wildfly
# Create the files below
chmod +x /opt/wildfly/bin/launch.sh
== Start and enable
systemctl start wildfly.service
systemctl enable wildfly.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment