Support Questions

Find answers, ask questions, and share your expertise

Nifi starts then stops at linux startup

avatar
New Contributor

Hi,

When my linux server reboots, Nifi automatically starts but automatically stops after few secondes.
When I manually restart the service, that's okay.

Could anyone help me to diagnose this issue ?

OS : Cent OS 7

Service :

nifi.service - Apache NiFi
  Loaded: loaded (/usr/lib/systemd/system/nifi.service; enabled; vendor preset: disabled)

Service description (nifi.service):

[Unit]
Description=Apache NiFi
After=network.target

[Service]
Type=simple
User=nifi
Group=nifi
LimitAS=infinity
LimitRSS=infinity
LimitCORE=infinity
LimitFSIZE=infinity
LimitNOFILE=65536
PIDFile=/appli/nifi/run/nifi.pid
ExecStart=/appli/nifi/bin/nifi.sh start
ExecStop=/appli/nifi/bin/nifi.sh stop

[Install]
WantedBy=multi-user.target


Extract from the bootstrap log :

2023-12-21 14:43:46,394 DEBUG [main] org.apache.nifi.bootstrap.Command Established connection to NiFi instance.
2023-12-21 14:43:46,394 DEBUG [main] org.apache.nifi.bootstrap.Command Sending SHUTDOWN Command to port 44185

I can't see any WARN/ERROR in bootstrap log or nifi log that would correlate to this...

 

Thanks

 

2 REPLIES 2

avatar
Master Mentor

@jerome69007 

How was your nifi.service created?
I am confused as to why it contains both the following lines:

ExecStart=/appli/nifi/bin/nifi.sh start
ExecStop=/appli/nifi/bin/nifi.sh stop

I would expect the nifi.service to only contain the start command.
This explains why on linux startup it is executing the start followed by the stop command.

Typically setting NiFi as a service on your linux is performed in a few simple steps:
1. Execute "./nifi.sh install" command.  This will setup NiFi as a service allowing to use systemctl command like "systemctl start nifi", "systemctl status nifi", and "systemctl stop
nifi".  
2. execute "systemctl enable nifi" command to configure nifi service start on system bootup.

If you found any of the suggestions/solutions provided helped you with your issue, please take a moment to login and click "Accept as Solution" on one or more of them that helped.

Thank you,
Matt

avatar
New Contributor

Thanks @MattWho . Well...

I regained ownership of the Nifi platform; I don't have the information regarding the initial installation.

I will check about ExecStop and give a feedback.

Thanks a lot !