Running ntservice as a Non-Root User

Software Installation for Linux

Platform
Napatech SmartNIC
Content Type
Software Installation Guide
Capture Software Version
Link™ Capture Software 12.16

Running ntservice as a non-root user is supported under specific conditions.

Conditions for running ntservice as a non-root user

It is possible to run ntservice as a non-root user under certain conditions based on the installation method of Napatech Link-Capture™ Software.

  • Installed Link-Capture™ Software with an RPM package: Running ntservice as a non-root user is supported.
  • Installed Link-Capture™ Software with the package_install_3gd.sh script:
    • Red Hat Enterprise Linux-based distributions: Running ntservice as a non-root user is not supported when ntservice is installed using the package_install_3gd.sh script and started via ntstart.sh.
    • Non-Red Hat Enterprise Linux-based distributions: Running ntservice as a non-root user is not supported when started using ntstart.sh. However, it is supported if started via systemd, provided that DKMS is used. See Running ntservice as a service as a non-root user.

The following table summarizes the conditions for supporting ntservice as a non-root user.

Table 1. Conditions for supporting ntservice as a non-root user
Napatech Link-Capture™ Software installation Using ntstart.sh Using systemd
Installed via RPM. Supported. Supported.
Installed via the script (Red Hat Enterprise Linux-based distributions). Not supported. Not supported.
Installed with the script (Non-Red Hat Enterprise Linux-based distributions). Not supported. Supported, if DKMS is used. See Running ntservice as a service as a non-root user.
Note: If ntservice runs as a non-root user, the system may fail to read the PCIe configuration correctly. As a result, the adapterinfo output can display incomplete PCIe bus information as shown in the following example:
…
Bus type                : PCI Express 0
Link width supported    : unknown
Link width negotiated   : unknown
Link speed              : 2.5 GT/s
Max payload supported   : unknown
Max payload negotiated  : unknown
Max expected throughput : 230365 Mbps

To ensure that all PCIe parameters are reported correctly, ntservice must be run with root privileges.

Enabling real-time scheduling for ntservice when running as a non‑root user

If ntservice runs as a non-root user, it may not be able to apply a real-time scheduling policy due to insufficient permissions. In this case, ntservice is running in time-sliced mode, which can negatively affect performance. When this issue occurs, the log file typically contains a warning similar to the following:

11/28/25 06:04:20.598677 | 1869 | WARNING | OSS | 38-7b70e74e | Thread 'NT400D11_Mon0' is running timesliced: Failed to use real-time sched policy: code=1: Operation not permitted

Real‑time scheduling policies require the CAP_SYS_NICE capability. When ntservice is executed without this capability, the system prevents it from applying the required scheduling policy.

To resolve this issue, grant the CAP_SYS_NICE capability to ntservice and configure the runtime library path.

  1. Run the following command as root to add the CAP_SYS_NICE capability.

    setcap "CAP_SYS_NICE+ep" /opt/napatech3/bin/ntservice

    The capability flags have the following meanings:

    • +e: Marks the capability as effective (active for the process).
    • +p: Marks the capability as permitted (allowed to be used by the process).
  2. Configure the shared library path. When a binary has capabilities set, the LD_LIBRARY_PATH environment variable is ignored. Therefore, the shared library location for ntservice must be registered explicitly. Create a new configuration file and add the library path:

    echo -e "/opt/napatech3/lib" >> /etc/ld.so.conf.d/ntservice.conf

    Update the dynamic linker cache:

    ldconfig

    If CAP_SYS_NICE is set but the ld.so.conf file is not created, ntservice fails to load its shared libraries.

  3. Verify the capability settings. To confirm that the capability has been applied correctly, run:

    getcap /opt/napatech3/bin/ntservice

    An output example:

    /opt/napatech3/bin/ntservice cap_sys_nice=ep

    After completing the configuration, restart ntservice to apply the changes.