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

Amey Abhyankar sco1984 at gmail.com
Fri Jul 6 18:03:54 IST 2018


On 5 July 2018 at 20:26, Shridhar Daithankar <ghodechhap at ghodechhap.net> wrote:
> 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 ;)

Thanks.
I added 'start' flag after the app1.sh in the respective service & it
helped. :-)

>
> HTH.
>
> --
> Regards
>  Shridhar
>
>
> _______________________________________________
> plug-mail mailing list
> plug-mail at plug.org.in
> http://list.plug.org.in/listinfo/plug-mail


More information about the plug-mail mailing list