Not a native service systemd - can't run on boot

16,907

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

Share:
16,907

Related videos on Youtube

Jimmy
Author by

Jimmy

Updated on September 18, 2022

Comments

  • Jimmy
    Jimmy over 1 year

    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.