H.7. Directories used by NUT at run-time

--with-pidpath=PATH

Changes the directory where NUT pid files are stored for processes running as root. By default this is /var/run (or /run on systems that follow FHS-3.0 standard strictly and do not offer a legacy symlink). A build of NUT is encouraged to configure the use of a dedicated sub-directory, like /var/run/ups or /var/run/nut, as long as its existence and proper ownership and permissions can be ensured by the time NUT daemons start. Certain programs like upsmon will leave files here.

The NUT_PIDPATH environment variable overrides this at run time.

--with-altpidpath=PATH

Programs that normally don’t have root powers, like the drivers and upsd, write their PID files here. By default this is whatever the statepath (below) is, as those programs should be able to write there.

The NUT_ALTPIDPATH environment variable overrides this at run time.

--with-statepath=PATH

Change the default location of the local Unix sockets created by the drivers to interact with the data server upsd to report their state and receive commands. Default is /var/state/ups.

This is also the default location for non-root daemons to write a PID file, if a separate location is not specified by --with-altpidpath option.

Sample configuration examples for upssched.conf (and default systemd-tmpfiles configuration generated with a NUT build) suggest using a sub-directory like ${STATEPATH}/upssched for the tool’s lock file and client-daemon communication pipe. This allows to potentially run that tool and daemon under a dedicated user account, without overlapping with permissions needed by other NUT programs.

The NUT_STATEPATH environment variable overrides this at run time.

Note

Fun fact: in early iterations of the NUT project, the drivers and the data server did exchange information by writing and reading complete state files in a commonly accessible location, hence the name.

--with-powerdownflag=FILEPATH

Change the default location (full filename path) of the POWERDOWNFLAG created by upsmon (as root) to tell the late-shutdown integration that this machine should tell all UPSes for which it is a "primary" NUT server to cut power to the load. Default is /etc/killpower on POSIX systems and "C:\\killpower" (note the double backslashes) on Windows.