[PLUG] service in systemd not starting custom java app after rebooting RHEL 7.4

Shridhar Daithankar ghodechhap at ghodechhap.net
Thu Jul 5 20:26:06 IST 2018


On गुरुवार, ५ जुलै, २०१८ ४:४५:४६ म.उ. IST Amey Abhyankar wrote:
> [root at app-01 amey]# systemctl status app1.service
> ● app1.service - app1 service
>    Loaded: loaded (/etc/systemd/system/app1.service; enabled; vendor
> preset: disabled)
>    Active: failed (Result: resources) since Wed 2018-07-04 04:36:03
> IST; 1 day 2h ago
>   Process: 760 ExecStart=/opt/app1/app1.sh $OPTIONS (code=exited,
> status=0/SUCCESS)
> 
> Jul 04 04:36:03 app-01 systemd[1]: Starting app1 service...
> Jul 04 04:36:03 app-01 systemd[1]: PID file /opt/app1/app1.pid not
> readable (yet?) after start.
> Jul 04 04:36:03 app-01 systemd[1]: Failed to start app1 service.
> Jul 04 04:36:03 app-01 systemd[1]: Unit app1.service entered failed state.
> Jul 04 04:36:03 app-01 systemd[1]: app1.service failed.

Try RemainAfterExit = true

The app1.sh seems to be putting the java application in background and exiting 
0/SUCESS should mean that. You need to tell systemd that the unit is 
successful if that happens.

However, down the line, you have

> Jul 04 04:36:03 app-01 systemd[1]: PID file /opt/app1/app1.pid not
> readable (yet?) after start.

So debug the shell script and see why it is not generating the pid file as you 
have configured. Either make it generate the pid file or take out the 
configuration.

May be it just needs some time to create the file and RemainAfterExit would 
help in that case? Java apps are usually SLOW to start ;)

HTH.

-- 
Regards
 Shridhar




More information about the plug-mail mailing list