0

Centos 7

Wildfly-16.0.0.Beta1

JDK 1.8.0_212

I cannot start wildfly with "systemctl start wildfly" but I can start it with "/opt/wildfly/bin/launch.sh standalone standalone.xml 192.168.56.200 &"

Config file:
# cat /etc/wildfly/wildfly.conf
# The configuration you want to run
WILDFLY_CONFIG=standalone.xml

# The mode you want to run
WILDFLY_MODE=standalone

# The address to bind to
WILDFLY_BIND=192.168.56.200

Systemctl status

[root@liferay ~]# systemctl status wildfly -l
● wildfly.service - The WildFly Application Server
   Loaded: loaded (/etc/systemd/system/wildfly.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2019-04-22 17:42:47 +08; 14min ago
  Process: 12925 ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND (code=exited, status=1/FAILURE)
 Main PID: 12925 (code=exited, status=1/FAILURE)

Apr 22 17:42:46 liferay systemd[1]: Started The WildFly Application Server.
Apr 22 17:42:47 liferay systemd[1]: wildfly.service: main process exited, code=exited, status=1/FAILURE
Apr 22 17:42:47 liferay systemd[1]: Unit wildfly.service entered failed state.
Apr 22 17:42:47 liferay systemd[1]: wildfly.service failed.

systemd unit

# cat /etc/systemd/system/wildfly.service
[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
StandardOutput=null

[Install]
WantedBy=multi-user.target

How can I make this work with systemd?

7
  • Check in debug.log where WILDFLY_HOME is. You probably have to add it to /etc/wildfly/wildfly.conf . – Overmind Apr 22 '19 at 13:00
  • @Overmind I could not find it in /opt/wildfly or /opt/wildfly/standalone/log/. Do I need to configure something to enable it? – grepmaster Apr 23 '19 at 1:04
  • @Overmind The launch.sh script sets it to /opt/wildfly if the user hasn't provided one. – Michael Hampton Apr 23 '19 at 1:16
  • WILDFLY_HOME is not defined in wildfly.conf . It should be there. – Overmind Apr 23 '19 at 5:13
  • @Overmind I have added "WILDFLY_HOME=/opt/wildfly" in /etc/wildfly/wildfly.conf but it still failed to start – grepmaster Apr 23 '19 at 6:56
0

Upon checking supplied systemd unit, I found that there's a PID folder set

mkdir /var/run/wildfly/
chown wildfly. /var/run/wildfly/

these commands fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.