Running WildFly as a systemd service on Ubuntu

2,518 views
Skip to first unread message

Vlad

unread,
May 14, 2018, 6:25:52 PM5/14/18
to dcm...@googlegroups.com
Has anyone been successful in setting this up? I've followed the instructions in $WILDFLY_HOME/docs/contrib/scripts/systemd to a tee, but to no avail. Although, I've added the following line to my /etc/systemd/system/wildfly.service file:

[Service]
Type=forking

And I get the following errors when running `sudo systemctl status wildfly.service` after the `sudo systemctl start wildfly.service` command:

wildfly.service - The WildFly Application Server
 
Loaded: loaded (/etc/systemd/system/wildfly.service; enabled; vendor preset: enabled)
 
Active: failed (Result: protocol) since Mon 2018-05-14 17:44:53 EDT; 29min ago
 
Process: 5943 ExecStart=/JavaPrograms/wildfly/current/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND (code=exited, status=0/SUCCESS)
 
Main PID: 4535 (code=exited, status=0/SUCCESS)

May 14 17:44:53 prod-1 systemd[1]: Starting The WildFly Application Server...
May 14 17:44:53 prod-1 systemd[1]: wildfly.service: Can't open PID file /var/run/wildfly/wildfly.pid (yet?) after start: No such file or directory
May 14 17:44:53 prod-1 systemd[1]: wildfly.service: Failed with result '
protocol'.
May 14 17:44:53 prod-1 systemd[1]: Failed to start The WildFly Application Server.


Without Type=forking instruction, everything seemed to run fine, but `sudo systemctl status wildfly.service` would indicate that the service is inactive:

wildfly.service - The WildFly Application Server
 
Loaded: loaded (/etc/systemd/system/wildfly.service; enabled; vendor preset: enabled)
 
Active: inactive (dead) since Mon 2018-05-14 18:18:48 EDT; 4s ago
 
Process: 6237 ExecStart=/JavaPrograms/wildfly/current/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND (code=exited, status=0/SUCCESS)
 
Main PID: 6237 (code=exited, status=0/SUCCESS)

May 14 18:18:48 prod-1 systemd[1]: Started The WildFly Application Server


This is on Ubuntu 18.04.

Any insight would be appreciated!

Nicolas Pasini

unread,
May 16, 2018, 12:14:03 AM5/16/18
to dcm...@googlegroups.com
Hi,

wildfly.service: Can't open PID file /var/run/wildfly/wildfly.pid

Does your /var/run/wildfly/ directory exist?
If so, maybe permission issues?

Regards,
Nicolás
Reply all
Reply to author
Forward
0 new messages