Skip to content

Driver main.c: use Unix socket protocol to kill off "Duplicate other instance" #2392

@jimklimov

Description

@jimklimov

Currently we use PID files where available, or skip that if not (and possibly fail to start the new driver program as a result, if the device is held by the older copy). Follows up from investigation for #2384

Enhance the upsdrvquery*() based protocol (see #1903, #1922 and later) with an INSTCMD driver.exit for similar effect as a SIGTERM from the sibling program, where we do not have a caller's explicit request for the old driver instance to try reloading and keep running (and/or exit if reload failed so a systemd unit would restart it) - so by default the caller wants its shiny new instance of the driver program to remain the one running after the dust settles.

OS based privileges for signalling or accessing the Unix socket (or Windows pipe) are deemed equivalently safe for these two approaches.

CC @clepple @aquette : WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    NUT protocolsenhancementservice/daemon start/stopGeneral subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions