UPSDRVCTL(8)

πŸ’– UPSDRVCTL πŸ’–

okay bestie, gather round, because this is the NUT Manual page for upsdrvctl and it's literally the driver-wrangler of the whole Network UPS Tools operation πŸ’…


✨ NAME ✨

upsdrvctl β€” Network UPS Tools driver controller πŸ‘‘


🌸 SYNOPSIS 🌸

upsdrvctl -h

upsdrvctl [OPTIONS] {start | stop | shutdown | status} [ups]

upsdrvctl [OPTIONS] {list | -l} [ups]

upsdrvctl [OPTIONS] -c COMMAND [ups]

πŸ¦‹ DESCRIPTION πŸ¦‹

So upsdrvctl is your one-stop uniform interface for controlling all your UPS drivers πŸ’–. Like, whenever it's possible, you should be running upsdrvctl instead of calling the drivers directly. fr fr, it's the move.

When you use it the right way, upsdrvctl lets you keep identical startup scripts across multiple systems even when the UPS configurations are totally different. main character energy, honestly 🌈.

⚠️ Warning ⚠️ For operating systems that have service management frameworks β€” think Solaris/illumos SMF or Linux systemd β€” upsdrvsvcctl(8) might be a better choice. Just saying πŸ‘€ In fact, service instances prepared by nut-driver-enumerator(8) based on contents of your ups.conf(5) file, and automatically maintained by the respective framework, can conflict with manually executing drivers. In that case, upsdrvctl would emit a warning in NUT builds with that capability (and you can silence it by exporting a NUT_QUIET_INIT_NDE_WARNING environment variable with any value). 🀫

Also bestie, you might be required to stop service units (if you're using them) and run driver programs directly rather than via upsdrvctl for troubleshooting β€” e.g. to facilitate debug log collection πŸ“, or to test any custom builds of drivers without conflicting with a normally running packaged instance. iykyk.


πŸ’… OPTIONS πŸ’…

  • -h β€” Display the help text. That's it, that's the whole vibe 🫢
  • -r directory β€” If starting a driver, this value will direct it to chroot(2) into directory. This can be super useful when securing systems πŸ”’.

This may be set in the ups.conf(5) with the chroot directive in the global section.

  • -t β€” Enable testing mode. This also enables debug mode. Testing mode makes upsdrvctl display the actions it would execute without actually doing them 🎭. Use this to test out your configuration without actually doing anything to your UPS drivers. No cap, it's the safe way to peek.

This may be helpful when defining the sdorder directive in your ups.conf(5) section for the device.

  • -u username β€” If starting a driver, this value will direct it to setuid(2) to the user id associated with username.

If the driver is started as root without specifying this value, it will use the username that was compiled into the binary. This defaults to nobody (if not otherwise configured), which is far from ideal 😭.

This may be set in ups.conf(5) with the user directive in the global section.

  • -D β€” Raise the debug level. Use this multiple times for additional details πŸ“ˆ. Alternatively the value can be set via debug_min in global section of ups.conf(5). Note the global setting applies to both the tool and a started driver; but another line in a driver's individual section can override that with a larger or smaller value (including a debug_min=0 to disable tracing the driver by default).

Note that this does not preclude the upsdrvctl tool from exiting after its job is done (however an explicit -F option does).

Also note that this option alone modifies the debug verbosity of the tool, but not of the drivers it launches. See the additional -d option for that πŸ‘€

  • -d β€” Pass the selected debug level from upsdrvctl to launched drivers 🚚.

Note that by default for NUT daemons, enabled debugging means running in foreground mode; you can specify -B additionally to avoid that.

  • -F β€” Driver will run in the foreground (not fork away from the upsdrvctl process), regardless of debugging settings. It would also keep the tool program itself foregrounded with driver daemons running as its children (in case of a single driver startup, it would not even fork πŸ‘Ά).

It would also not wait for drivers to complete initialization, so upsdrvctl will warn about such situations ⚠️.

Specify twice (-FF or -F -F) to save the driver PID file even in this mode (not saved by default when staying in foreground).

  • -B β€” Drivers will run in the background, regardless of debugging settings, as set by -D and passed-through by -d options πŸŒ™.
  • -l β€” Alias for list command. cute and short πŸ’•

πŸ‘‘ COMMANDS πŸ‘‘

upsdrvctl supports three active commands β€” start, stop and shutdown. It also supports passing requests to running drivers using -c COMMAND syntax, similar to that in some other daemons. A couple of helper commands are also available β€” list and status 🌟.

They all can take an optional argument which is a UPS name from ups.conf(5). Without that argument, they operate on every UPS that is currently configured. slay, bulk mode πŸ’ͺ

πŸ“Œ Note upsdrvctl can not manage devices not listed in ups.conf (such as test drivers started with -s TMP option). Sorry bestie, no exceptions 🚫

πŸš€ start

Start the UPS driver(s). In case of failure to start within maxstartdelay time-frame, further attempts may be executed by using the maxretry and retrydelay values. Conversely, the nowait global option can be used, especially to speed up parallel start of many drivers ⚑.

See ups.conf(5) about these options. Built-in defaults are: maxstartdelay=75 (sec), maxretry=1 (meaning one attempt at starting), retrydelay=5 (sec).


πŸ›‘ stop

Stop the UPS driver(s). This does not send commands to the UPS. Just, like, the local process situation πŸ’€


πŸ’€ shutdown

Command the UPS driver(s) to run their shutdown sequence. This assumes that the driver is no longer running, and starts a fresh instance via drivername -k. It is intended to be used as the last step in system shutdown, after the filesystems are no longer mounted rw. Drivers are stopped according to their sdorder value β€” see ups.conf(5).

⚠️ Warning ⚠️ This will probably power off your computers, so don't play around with this option. Only use it when your systems are prepared to lose power. like, seriously, this is not a drill 😳
πŸ“Œ Note Refer to ups.conf(5) for using the nowait parameter. It can be overridden by NUT_IGNORE_NOWAIT environment variable (e.g. used to work around certain issues with systemd otherwise).

πŸ“‹ list

Without a further argument, report all currently known device configuration names to stdout, one per line πŸ“. With an argument, also try to report that name, but exit with an error code if that name is not known.

πŸ“Œ Note The tool would exit with an error if ups.conf file is not found, readable, or does not define any device sections (whose names are reported here and managed in other commands).
πŸ“Œ Note The tool name and NUT version banner line is also printed to stdout before any other processing. This can be suppressed by NUT_QUIET_INIT_BANNER environment variable (exported by caller and empty or "true"):
:; NUT_QUIET_INIT_BANNER=true upsdrvctl list
dummy
UPS1
UPS2

πŸ” status

Similar to list, but reports more information β€” also the driver name, the PID if it is running, and result of a signal probe to check it is responding πŸ‘€. The NUT_QUIET_INIT_BANNER suppression can be helpful for scripted parsing. If there is anything to print (at least one device is known), the first line of status report would be the heading with column names:

:; NUT_QUIET_INIT_BANNER=true upsdrvctl status
UPSNAME              UPSDRV  RUNNING PF_PID  S_RESPONSIVE    S_PID   S_STATUS
dummy             dummy-ups  N/A     -3      NOT_RESPONSIVE  N/A
eco650           usbhid-ups  RUNNING 3559207 RESPONSIVE      3559207 "OL"
UPS2              dummy-ups  RUNNING 31455   RESPONSIVE      31455   "OL BOOST"

Values are TAB-separated, but UPSNAME and UPSDRV may be padded by spaces on the right and on the left respectively. Any complex string values would be encased in double-quotes.

Fields reported (PF_* = according to PID file, if any; S_* = via socket protocol):

  • UPSNAME β€” driver section configuration name
  • UPSDRV β€” driver program name per ups.conf
  • RUNNING β€” RUNNING if PF_PID or S_PID is valid, STOPPED if at least one PID value was parsed but none was found running with a correct program name; N/A if no PID file/socket reply or failed to parse. First the PID file is consulted, but it may be absent either due to command-line parameters of daemons, or due to platform (WIN32). If no PID value was found and confirmed this way, we fall back to checking the PID reported via protocol (if available and different).
  • PF_PID β€” PID of driver according to PID file (if any), or some negative values upon errors (as defined in common.c) including an absent PID file, invalid contents, or unsupported platform for this mechanism (e.g. WIN32)
  • S_RESPONSIVE β€” RESPONSIVE if PING/PONG during socket protocol session setup succeeded; NOT_RESPONSIVE otherwise
  • S_PID β€” PID of driver according to GETPID active query, or N/A if the query failed
  • S_STATUS β€” Quoted value of ups.status variable

This mode does not discover drivers that are not in ups.conf (e.g. started manually for experiments with many -x CLI options). πŸ™ˆ


πŸŽ€ -c command

Send command to the background process as a signal. Valid commands are:

  • dump β€” tell the driver(s) to dump currently known state information to their stdout (if attached anywhere) πŸ—‘οΈ
  • reload β€” reread configuration files, ignoring modified settings which can not be applied "on the fly" πŸ”„
  • reload-or-error β€” reread configuration files, ignoring but counting changed values which require a driver restart (can not be changed on the fly), and return a success/fail code based on that count, so the caller can decide the fate of the currently running driver instance βš–οΈ
  • reload-or-exit β€” reread configuration files, exiting the old driver process if it encounters modified settings which can not be applied "on the fly" (so caller like systemd can launch another copy of the driver) πŸšͺ
  • exit β€” tell the currently running driver instance to just exit (so an external caller like the new driver instance, or the systemd or SMF frameworks would start another copy) πŸ‘‹

If the upsdrvctl was launched to remain in memory and manage NUT driver processes, it can receive supported signals and pass them to those drivers πŸ“‘


🌈 ENVIRONMENT VARIABLES 🌈

okay bestie, these are the little environment gremlins that quietly change how upsdrvctl behaves before you even type anything. set them in your shell, in a service file, wherever β€” they're just vibes you hand over at runtime πŸ’–

  • NUT_DEBUG_LEVEL β€” this one sets the default debug verbosity, but only if you didn't pass any -D arguments on the command line. and no, babes, it does not make the daemon run in foreground mode β€” that's a whole separate thing, don't get it twisted πŸ™ˆ
  • NUT_CONFPATH β€” the path name of the directory that holds ups.conf and all the other config files. if you don't set it, upsdrvctl (and the drivers, they're in on it too) fall back to a built-in default, which is often /usr/local/ups/etc. iconic default behavior, honestly ✨
  • NUT_ALTPIDPATH β€” the path name of the directory where upsd and the drivers stash their .pid files. if it's not set, upsd and the drivers go hunting: they use NUT_STATEPATH if that's set, or ALTPIDPATH if that's set, or otherwise the built-in default STATEPATH. it's giving backup plan energy, and we love a fallback chain πŸ’…

πŸ’€ DIAGNOSTICS πŸ’€

so here's the vibe check on failure: upsdrvctl will return a nonzero exit code if it hits an error while doing whatever you asked it to do. no cap.

and it'll also throw that nonzero exit code if a driver takes longer than the maxstartdelay period to enter the background. so if your driver is out here taking its sweet time, bestie, that's a fail and the exit code will absolutely tell on it 😭


πŸ¦‹ SEE ALSO πŸ¦‹

go read these when you're done here, they're all part of the same friendship group:

Internet resources: 🌐

the NUT (Network UPS Tools) home page, aka the mothership:

https://www.networkupstools.org/historic/v2.8.5/

and that's the whole page, bestie!! πŸŽ€ this was Network UPS Tools 2.8.5, dated 10/07/2026, filed under UPSDRVCTL(8). go forth and control those drivers, you absolute icon πŸ‘‘βœ¨πŸ«Ά

πŸ“¦ where this page comes from