'\" t .\" Title: upsdrvctl .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/05/2026 .\" Manual: NUT Manual .\" Source: Network UPS Tools 2.8.4 .\" Language: English .\" .TH "UPSDRVCTL" "8" "01/05/2026" "Network UPS Tools 2\&.8\&.4" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" upsdrvctl \- Network UPS Tools driver controller .SH "SYNOPSIS" .sp \fBupsdrvctl\fR \-h .sp \fBupsdrvctl\fR [\fIOPTIONS\fR] {start | stop | shutdown | status} [\fIups\fR] .sp \fBupsdrvctl\fR [\fIOPTIONS\fR] {list | \-l} [\fIups\fR] .sp \fBupsdrvctl\fR [\fIOPTIONS\fR] \-c COMMAND [\fIups\fR] .SH "DESCRIPTION" .sp \fBupsdrvctl\fR provides a uniform interface for controlling your UPS drivers\&. You should use upsdrvctl command instead of direct calls to the drivers whenever possible\&. .sp When used properly, upsdrvctl lets you maintain identical startup scripts across multiple systems with different UPS configurations\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br .sp For operating systems with service management frameworks, such as Solaris/illumos SMF or Linux systemd, the \fBupsdrvsvcctl\fR(8) may be a better choice\&. .sp In fact, service instances prepared by \fBnut-driver-enumerator\fR(8) based on contents of your \fBups.conf\fR(5) file and automatically maintained by the respective framework can conflict with manual execution of drivers\&. In this case, upsdrvctl would emit a warning in NUT builds with that capability (can be silenced by exporting a NUT_QUIET_INIT_NDE_WARNING environment variable with any value)\&. .sp .5v .RE .sp You may be required to stop service units (if used) and run driver programs directly rather than via upsdrvctl for troubleshooting, e\&.g\&. to facilitate debug log collection or test any custom builds of drivers without conflict with a normally running packaged instance\&. .SH "OPTIONS" .PP \fB\-h\fR .RS 4 Display the help text\&. .RE .PP \fB\-r\fR \fIdirectory\fR .RS 4 If starting a driver, this value will direct it to \fBchroot\fR(2) into \fIdirectory\fR\&. This can be useful when securing systems\&. .sp This may be set in the \fBups.conf\fR(5) with the chroot directive in the global section\&. .RE .PP \fB\-t\fR .RS 4 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\&. .sp This may be helpful when defining the sdorder directive in your \fBups.conf\fR(5) section for the device\&. .RE .PP \fB\-u\fR \fIusername\fR .RS 4 If starting a driver, this value will direct it to \fBsetuid\fR(2) to the user id associated with \fIusername\fR\&. .sp If the driver is started as \fIroot\fR without specifying this value, it will use the username that was compiled into the binary\&. This defaults to \fInobody\fR (if not otherwise configured), which is far from ideal\&. .sp This may be set in \fBups.conf\fR(5) with the user directive in the global section\&. .RE .PP \fB\-D\fR .RS 4 Raise the debug level\&. Use this multiple times for additional details\&. .sp Note that this does not preclude the upsdrvctl tool from exiting after its job is done (however an explicit \fB\-F\fR option does)\&. .sp Also note that this option alone modifies the debug verbosity of the tool, but not of the drivers it launches\&. See the additional \fB\-d\fR option for that\&. .RE .PP \fB\-d\fR .RS 4 Pass the selected debug level from upsdrvctl to launched drivers\&. .sp Note that by default for NUT daemons, enabled debugging means running in foreground mode; you can specify \fB\-B\fR additionally to avoid that\&. .RE .PP \fB\-F\fR .RS 4 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)\&. .sp It would also not wait for drivers to complete initialization, so upsdrvctl will warn about such situations\&. .sp Specify twice (\-FF or \-F \-F) to save the driver PID file even in this mode (not saved by default when staying in foreground)\&. .RE .PP \fB\-B\fR .RS 4 Drivers will run in the background, regardless of debugging settings, as set by \fB\-D\fR and passed\-through by \fB\-d\fR options\&. .RE .PP \fB\-l\fR .RS 4 Alias for list command\&. .RE .SH "COMMANDS" .sp upsdrvctl supports three active commands \(em 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 \(em list and status\&. .sp They all can take an optional argument which is a UPS name from \fBups.conf\fR(5)\&. Without that argument, they operate on every UPS that is currently configured\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp upsdrvctl can not manage devices not listed in ups\&.conf (such as test drivers started with \-s TMP option)\&. .sp .5v .RE .PP \fBstart\fR .RS 4 Start the UPS driver(s)\&. In case of failure to start within \fImaxstartdelay\fR time\-frame, further attempts may be executed by using the \fImaxretry\fR and \fIretrydelay\fR values\&. Conversely, the \fInowait\fR global option can be used, especially to speed up parallel start of many drivers\&. .sp See \fBups.conf\fR(5) about these options\&. Built\-in defaults are: \fImaxstartdelay=75\fR (sec), \fImaxretry=1\fR (meaning one attempt at starting), \fIretrydelay=5\fR (sec)\&. .RE .PP \fBstop\fR .RS 4 Stop the UPS driver(s)\&. This does not send commands to the UPS\&. .RE .PP \fBshutdown\fR .RS 4 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 \fIrw\fR\&. Drivers are stopped according to their sdorder value \(em see \fBups.conf\fR(5)\&. .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br .sp This will probably power off your computers, so don\(cqt play around with this option\&. Only use it when your systems are prepared to lose power\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp Refer to \fBups.conf\fR(5) for using the \fBnowait\fR parameter\&. It can be overridden by NUT_IGNORE_NOWAIT environment variable (e\&.g\&. used to work around certain issues with systemd otherwise)\&. .sp .5v .RE .PP \fBlist\fR .RS 4 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\&. .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp 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)\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .sp 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"): .sp .5v .RE .sp .if n \{\ .RS 4 .\} .nf :; NUT_QUIET_INIT_BANNER=true upsdrvctl list dummy UPS1 UPS2 .fi .if n \{\ .RE .\} .PP \fBstatus\fR .RS 4 Similar to list, but reports more information \(em 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: .sp .if n \{\ .RS 4 .\} .nf :; 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" .fi .if n \{\ .RE .\} .sp 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\&. .sp Fields reported (PF_* = according to PID file, if any; S_* = via socket protocol): .PP \fBUPSNAME\fR .RS 4 driver section configuration name .RE .PP \fBUPSDRV\fR .RS 4 driver program name per ups\&.conf .RE .PP \fBRUNNING\fR .RS 4 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)\&. .RE .PP \fBPF_PID\fR .RS 4 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) .RE .PP \fBS_RESPONSIVE\fR .RS 4 RESPONSIVE if PING/PONG during socket protocol session setup succeeded; NOT_RESPONSIVE otherwise .RE .PP \fBS_PID\fR .RS 4 PID of driver according to GETPID active query, or N/A if the query failed .RE .PP \fBS_STATUS\fR .RS 4 Quoted value of ups\&.status variable .RE .sp This mode does not discover drivers that are not in ups\&.conf (e\&.g\&. started manually for experiments with many \-x CLI options)\&. .RE .PP \fB\-c\fR \fIcommand\fR .RS 4 Send \fIcommand\fR to the background process as a signal\&. Valid commands are: .PP \fBdump\fR .RS 4 tell the driver(s) to dump currently known state information to their stdout (if attached anywhere) .RE .PP \fBreload\fR .RS 4 reread configuration files, ignoring modified settings which can not be applied "on the fly" .RE .PP \fBreload\-or\-error\fR .RS 4 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 .RE .PP \fBreload\-or\-exit\fR .RS 4 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) .RE .PP \fBexit\fR .RS 4 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) .RE .RE .sp 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\&. .SH "ENVIRONMENT VARIABLES" .sp \fBNUT_DEBUG_LEVEL\fR sets default debug verbosity if no \fB\-D\fR arguments were provided on command line, but does not request that the daemon runs in foreground mode\&. .sp \fBNUT_CONFPATH\fR is the path name of the directory that contains ups\&.conf and other configuration files\&. If this variable is not set, \fBupsdrvctl\fR (and the drivers) use a built\-in default, which is often /usr/local/ups/etc\&. .sp \fBNUT_ALTPIDPATH\fR is the path name of the directory in which \fBupsd\fR and drivers store \&.pid files\&. If this variable is not set, \fBupsd\fR and drivers use either \fBNUT_STATEPATH\fR if set, or ALTPIDPATH if set, or otherwise the built\-in default \fBSTATEPATH\fR\&. .SH "DIAGNOSTICS" .sp upsdrvctl will return a nonzero exit code if it encounters an error while performing the desired operation\&. This will also happen if a driver takes longer than the \fImaxstartdelay\fR period to enter the background\&. .SH "SEE ALSO" .sp \fBupsdrvsvcctl\fR(8), \fBnut-driver-enumerator\fR(8), \fBnutupsdrv\fR(8), \fBupsd\fR(8), \fBups.conf\fR(5) .SS "Internet resources:" .sp The NUT (Network UPS Tools) home page: https://www\&.networkupstools\&.org/historic/v2\&.8\&.4/