zebrone
Posts: 4
Joined: Thu Feb 07, 2013 12:25 pm

How to set Wildfly server as service in Raspbian

Sun May 22, 2016 11:46 am

Hi everyone,
I was looking how to set as service a Wildfly server installation in the Raspberry PI with the latest version of Raspbian.
I've tried to use this https://gist.github.com/sukharevd/6087988, but if I try to start the service no messages are sent back. The command line I use is this one:

Code: Select all

sudo service wildfly start
When I execute this, no messages are sent back. How Can I fix this problem? I want to set as service the Wildfly service.

P.S. If execute sudo bash standalone.sh the server starts correctly.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How to set Wildfly server as service in Raspbian

Sun May 22, 2016 12:00 pm

zebrone wrote:

Code: Select all

sudo service wildfly start
When I execute this, no messages are sent back. How Can I fix this problem? I want to set as service the Wildfly service
Do you mean that you get no messages when you issue the command?
That's normal on Jessie / Systemd.

To see if it's running use e.g.

Code: Select all

sudo systemctl status wildfly

zebrone
Posts: 4
Joined: Thu Feb 07, 2013 12:25 pm

Re: How to set Wildfly server as service in Raspbian

Mon May 23, 2016 12:35 pm

DirkS wrote:
zebrone wrote:

Code: Select all

sudo service wildfly start
When I execute this, no messages are sent back. How Can I fix this problem? I want to set as service the Wildfly service
Do you mean that you get no messages when you issue the command?
That's normal on Jessie / Systemd.

To see if it's running use e.g.

Code: Select all

sudo systemctl status wildfly
Thank you for your reply. You're almost right! The service is loaded correctly, here is the output:

Code: Select all

root@raspberrypi:/opt/wildfly/bin# sudo systemctl status wildfly
● wildfly.service - The WildFly Application Server
   Loaded: loaded (/etc/systemd/system/wildfly.service; disabled)
   Active: active (running) since Mon 2016-05-22 16:39:20 UTC; 5s ago
 Main PID: 1425 (launch.sh)
   CGroup: /system.slice/wildfly.service
           ├─1425 /bin/sh /opt/wildfly/bin/launch.sh standalone standalone.xml 0.0.0.0
           ├─1428 /bin/sh /opt/wildfly/bin/standalone.sh -c standalone.xml -b 0.0.0.0
           └─1483 java -D[Standalone] -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stac...
The only problem is that if I try to execute sudo service wildfly reload, I got this error:

Code: Select all

wildfly: unrecognized service
Is this normal?

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How to set Wildfly server as service in Raspbian

Mon May 23, 2016 1:40 pm

The service is disabled; AFAIK this just means it will not autostart on boot.
It seems to be running though.

I think it's best to start using the systemd version of the service commands. See e.g. https://www.digitalocean.com/community/ ... -and-units
To enable:

Code: Select all

sudo systemctl enable wildfly
Restart

Code: Select all

sudo systemctl restart wildfly
You can use either 'wildfly' or 'wildfly.service'

zebrone
Posts: 4
Joined: Thu Feb 07, 2013 12:25 pm

Re: How to set Wildfly server as service in Raspbian

Tue May 24, 2016 12:13 pm

DirkS wrote:The service is disabled; AFAIK this just means it will not autostart on boot.
It seems to be running though.

I think it's best to start using the systemd version of the service commands. See e.g. https://www.digitalocean.com/community/ ... -and-units
To enable:

Code: Select all

sudo systemctl enable wildfly
Restart

Code: Select all

sudo systemctl restart wildfly
You can use either 'wildfly' or 'wildfly.service'
Thank you for your reply. I've tried to upload a war on the Wildfly server but it seems it doesn't work correctly. I mean the was is deployed correctly, but if I try to connect to the endpoint with Websocket implementation, nothing happen. I don't know why, the port is now 28080 for http, so I've also changed it. Have you got any idea about this problem?

zebrone92
Posts: 12
Joined: Fri Aug 14, 2015 12:45 pm

Re: How to set Wildfly server as service in Raspbian

Thu Jun 08, 2017 7:24 pm

Hi,
I got the following problem, with Wildly 9.0.2.Final. The bash standalone.sh command works correctly, but the service doesn't:

pi@raspberrypi:~ $ sudo systemctl status wildfly -l
● wildfly.service - The WildFly Application Server
Loaded: loaded (/etc/systemd/system/wildfly.service; enabled)
Active: failed (Result: exit-code) since gio 2017-06-08 17:17:05 -02; 4min 59s ago
Process: 443 ExecStart=/opt/wildfly/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND (code=exited, status=203/EXEC)
Main PID: 443 (code=exited, status=203/EXEC)

giu 08 17:17:04 raspberrypi systemd[1]: Started The WildFly Application Server.
giu 08 17:17:04 raspberrypi systemd[443]: Failed at step EXEC spawning /opt/wildfly/bin/launch.sh: No such file or directory
giu 08 17:17:05 raspberrypi systemd[1]: wildfly.service: main process exited, code=exited, status=203/EXEC
giu 08 17:17:05 raspberrypi systemd[1]: Unit wildfly.service entered failed state.

How Can I Fix it?

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How to set Wildfly server as service in Raspbian

Thu Jun 08, 2017 7:46 pm

giu 08 17:17:04 raspberrypi systemd[443]: Failed at step EXEC spawning /opt/wildfly/bin/launch.sh: No such file or directory
Apparently the directory and / or file does not exist.
Check first if the directory exists. Could it be in a different location?

Return to “General discussion”