I've got a annoying problem at the moment with payara and systemd on centos7.
when I first start payara via systemd and later when I (or jenkins) use asadmin to restart-domain. It will stop payara and not start it again. systemd thinks the payara service is failing and it enters a failed state and never starts the domain.
The contents of my payara.service file:
# cat /etc/systemd/system/payara.service
Description=Payara (Glassfish) Server¬
After=syslog.target network.target¬
¬
[Service]¬
Type=forking¬
User=payara¬
RestartSec=10¬
ExecStart=/opt/payara/bin/asadmin start-domain¬
ExecStop=/opt/payara/bin/asadmin stop-domain¬
Journalctl after I use ./asadmin restart-domain
# journalctl --unit payara
Jul 04 08:36:35
payara.dev systemd[1]: Starting Payara (Glassfish) Server...
Jul 04 08:36:41
payara.dev asadmin[4101]: Waiting for domain1 to start .....
Jul 04 08:36:41
payara.dev asadmin[4101]: Successfully started the domain : domain1
Jul 04 08:36:41
payara.dev asadmin[4101]: domain Location: /opt/payara41/glassfish/domains/domain1
Jul 04 08:36:41
payara.dev asadmin[4101]: Log File: /opt/payara41/glassfish/domains/domain1/logs/server.log
Jul 04 08:36:41
payara.dev asadmin[4101]: Admin Port: 4848
Jul 04 08:36:41
payara.dev asadmin[4101]: Command start-domain executed successfully.
Jul 04 08:36:42
payara.dev systemd[1]: Started Payara (Glassfish) Server.
Jul 04 08:41:28
payara.dev systemd[1]: payara.service: main process exited, code=exited, status=10/n/a
Jul 04 08:41:29
payara.dev asadmin[4253]: CLI306: Warning - The server located at /opt/payara41/glassfish/domains/domain1 is not running.
Jul 04 08:41:29
payara.dev asadmin[4253]: Command stop-domain executed successfully.
When I circumvent systemd with starting the domain with ./asadmin start-domain it will restart-domain just fine. So I think systemd doesn't like fact that ./asadmin is interfering with a service that is his/hers to manage and stops the attempt. Im a bit stuck at the moment, probably I just can't find the right words to search this.
any hints will be greatly appreciated.
thanks in advance
Koen