0

I tried running NiFi as a startup service using this:

sudo systemctl enable nifi.service

I get this error:

nifi.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nifi
update-rc.d: error: nifi Default-Start contains no runlevels, aborting.

Looking at this tutorial https://askubuntu.com/questions/909523/default-start-contains-no-runlevels-aborting

It suggests making changes to a shell file, but I don't use such a file. Any help would be appreciated.

6

Try to create systemd file for nifi, below is example please change path/user/group accordingly.

$ sudo vi /etc/systemd/system/nifi.service

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

[Service]
Type=forking
User=nifi
Group=nifi
ExecStart=/opt/nifi-latest/bin/nifi.sh start
ExecStop=/opt/nifi-latest/bin/nifi.sh stop
ExecRestart=/opt/nifi-latest/bin/nifi.sh restart 

[Install]
WantedBy=multi-user.target

After that you can use systemctl like below

$ sudo systemctl daemon-reload

$ sudo systemctl start nifi.service

$ sudo systemctl status nifi.service

$ sudo systemctl enable nifi.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.