1

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?

grepmaster
  • 143
  • 2
  • 3
  • 14

1 Answers1

1

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.

grepmaster
  • 143
  • 2
  • 3
  • 14