1

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.

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

1 Answer 1

8

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .