Skip to content

Follow-up to upsdrvctl status on Windows, add LOGOUT to local socket protocol#2572

Merged
jimklimov merged 16 commits intonetworkupstools:masterfrom
jimklimov:issue-2568-win
Aug 1, 2024
Merged

Follow-up to upsdrvctl status on Windows, add LOGOUT to local socket protocol#2572
jimklimov merged 16 commits intonetworkupstools:masterfrom
jimklimov:issue-2568-win

Conversation

@jimklimov
Copy link
Copy Markdown
Member

@jimklimov jimklimov commented Aug 1, 2024

Address lack of signals, properly close connections, add LOGOUT to dstate (local socket protocol).

Follows up primarily from issue #2567 / PR #2568 but also touches on some other recent work like #1949

UPDATE: Also completes upsdrvsvcctl status, tested with Debian Linux systemd and OpenIndiana SMF

…NG or not program using PID from *either* PID file or socket protocol [networkupstools#2567]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…etworkupstools#2567]

Now that the driver Unix socket / Windows named pipe connections
can come and go (sibling drivers, `upsdrvctl status`...) it is not
pretty to see logged messages about an unexpected connection loss.
Having it coincide with a LOGOUT is better for troubleshooting.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… LOGOUT command [networkupstools#2567]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… the connection - close later [networkupstools#2567]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…es, and add master in the end too [networkupstools#1949]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov added enhancement documentation Windows NUT protocols portability We want NUT to build and run everywhere possible labels Aug 1, 2024
@jimklimov jimklimov added this to the 2.8.3 milestone Aug 1, 2024
@jimklimov jimklimov requested a review from aquette August 1, 2024 03:09
…vs. sendsignalpid(), unite via pidAlive [networkupstools#2567]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… so not complain about disconnection faults [networkupstools#2567]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…le, like ENUMERATOR is used [networkupstools#2567]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…an option to display binary version (and fix the script one in help) [networkupstools#2567]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…lete the "upsdrvsvcctl status" feature [networkupstools#2567]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov
Copy link
Copy Markdown
Member Author

jimklimov commented Aug 1, 2024

With recent additions for upsdrvsvcctl status:

  • systemd
:; (cd ./scripts/upsdrvsvcctl/ && make upsdrvsvcctl && ./upsdrvsvcctl status )
make: 'upsdrvsvcctl' is up to date.
SVC_NAME                                      SVC_STATE UPSNAME              UPSDRV     RUNNING PF_PID  S_RESPONSIVE    S_PID   S_STATUS
nut-driver@dummy.service                masked,inactive dummy             dummy-ups     N/A     -3      NOT_RESPONSIVE  N/A
nut-driver@eco650.service                enabled,active eco650           usbhid-ups     RUNNING 2999513 RESPONSIVE      2999513 "OL"

:; upsdrvsvcctl status dummy
SVC_NAME                                      SVC_STATE UPSNAME              UPSDRV     RUNNING PF_PID  S_RESPONSIVE    S_PID   S_STATUS
nut-driver@dummy.service                masked,inactive dummy             dummy-ups     N/A     -3      NOT_RESPONSIVE  N/A
  • SMF (testing just the scripts and upsdrvctl tool against an older NUT build, so driver does not talk socket protocol):
:; NUT_ALTPIDPATH=/var/run/nut NUT_CONFPATH=/etc/nut UPSDRVCTL=`pwd`/drivers/upsdrvctl ENUMERATOR=`pwd`/scripts/upsdrvsvcctl/nut-driver-enumerator.sh  ./scripts/upsdrvsvcctl/upsdrvsvcctl status

SVC_NAME                                  SVC_STATE     UPSNAME              UPSDRV     RUNNING PF_PID  S_RESPONSIVE    S_PID   S_STATUS
svc:/system/power/nut-driver:dummy           online     dummy             dummy-ups     RUNNING 8093    NOT_RESPONSIVE  N/A

…RATOR and UPSDRVCTL when testing [networkupstools#2567]

Signed-off-by: Jim Klimov <jim@jimklimov.com>
…ork type too [networkupstools#2567]

Signed-off-by: Jim Klimov <jim@jimklimov.com>
@jimklimov jimklimov added Solaris/illumos Solaris and illumos systems (OpenIndiana, OmniOS, SmartOS, TribbliX...) Linux Some issues are specific to Linux as a platform labels Aug 1, 2024
@AppVeyorBot
Copy link
Copy Markdown

@networkupstools networkupstools deleted a comment from AppVeyorBot Aug 1, 2024
@jimklimov jimklimov merged commit 7b5ca36 into networkupstools:master Aug 1, 2024
@jimklimov jimklimov deleted the issue-2568-win branch August 1, 2024 14:55
@jimklimov jimklimov restored the issue-2568-win branch April 15, 2025 09:51
@jimklimov jimklimov deleted the issue-2568-win branch April 15, 2025 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation enhancement Linux Some issues are specific to Linux as a platform NUT protocols portability We want NUT to build and run everywhere possible Solaris/illumos Solaris and illumos systems (OpenIndiana, OmniOS, SmartOS, TribbliX...) Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants