Skip to main content
Version: 2.10.2

Run as Non-Root User

By default, NFO runs as a root user. If you would like to change the Run As user after installation, follow this procedure to change the Run As user. These instructions show how to change NFO tomcat and EDFN user “root” and group “root” to a non root user “nfo” which belongs to a group “nfo-group”.

warning

NFO Repeater function requires running the service under root. If you change the user to a non-root user and configure Repeater output, NFO will not run and becomes unresponsive!

Procedure

  1. Switch to a root shell, for example
sudo -i
  1. Stop tomcat and EDFN services
systemctl stop nfi_updd.service
systemctl stop tomcat_nfo.service
  1. Change root user and group in the file /etc/systemd/system/tomcat_nfo.service to nfo and nfo-group respectively:

from

[Service]
User=root
Group=root

to

[Service]
User=nfo
Group=nfo-group
  1. Change root user and group in the file /etc/systemd/system/nfi_updd.service to nfo and nfo-group respectively:

from

[Service]
User=root
Group=root

to

[Service]
User=nfo
Group=nfo-group
  1. Edit /opt/flowintegrator/nfi.sh script file, modify the following line by changing root user to nfo:

from

./daemon.sh --java-home ${JAVA_HOME} --service-start-wait-time 120 --tomcat-user root start

to

./daemon.sh --java-home ${JAVA_HOME} --service-start-wait-time 120 --tomcat-user nfo start
  1. Edit /opt/nfi-updater/bin/nfiu_daemon script file, modify the following line by changing root user to nfo:

from

./daemon.sh -java-home="${JAVA_HOME}" -nfiu-user=root start

to

./daemon.sh -java-home="${JAVA_HOME}" -nfiu-user=nfo start
  1. Change /opt/flowintegrator user and group recursively. For example to change root to user nfo and group nfo-group use the following command:
chown --recursive nfo:nfo-group /opt/flowintegrator
  1. Change /opt/nfi-updater user and group recursively. For example to change root to user nfo and group nfo-group use the following command:
chown --recursive nfo:nfo-group /opt/nfi-updater
  1. Start tomcat and EDFN services:
systemctl start nfi_updd.service
systemctl start tomcat_nfo.service