Bug 283900 - sysutils/apcupsd: Increase COMMLOST_TIMEOUT in pcnet.c
Summary: sysutils/apcupsd: Increase COMMLOST_TIMEOUT in pcnet.c
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Danilo G. Baio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-07 04:26 UTC by Steven Stallion
Modified: 2025-01-15 19:48 UTC (History)
0 users

See Also:
dbaio: maintainer-feedback+


Attachments
Proposed patch (1.46 KB, patch)
2025-01-07 04:27 UTC, Steven Stallion
no flags Details | Diff
Proposed patch (updated) (3.20 KB, patch)
2025-01-15 17:50 UTC, Steven Stallion
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Stallion 2025-01-07 04:26:04 UTC
While working on deprecating the sysutils/pcns port, I began converting hosts over to using sysutils/apcupsd instead. Since I've relied on PowerChute in the past, I configured apcupsd to use the pcnet driver as I have in the past before switching over to pcns.

I discovered that newer releases of the NMC firmware seems to periodically stop sending status broadcasts, which results in spurious COMMLOST events when using this driver. I've reported this behavior upstream to the apcupsd-users mailing list, however there does not seem to be much movement. I don't expect to receive much of a response given that the last release of apcupsd was made over eight years ago.

I'm hoping that by including this patch in the sysutils/apcupsd port, sysutils/pcns users will have a clear path forward after the port is removed at the end of the month.

Thanks in advance!
Comment 1 Steven Stallion 2025-01-07 04:27:17 UTC
Created attachment 256494 [details]
Proposed patch
Comment 2 Steven Stallion 2025-01-07 04:27:41 UTC
apcupsd-users thread can be found here: https://sourceforge.net/p/apcupsd/mailman/message/59114143/
Comment 3 Steven Stallion 2025-01-15 15:39:12 UTC
Ping!
Comment 4 Danilo G. Baio freebsd_committer freebsd_triage 2025-01-15 15:58:02 UTC
Hi, do you use the pre-built packages from the FreeBSD CDN, or do you build your ports/packages yourself? I'm asking because I'm considering adding this as an optional patch, and I'm not sure if it will help you. Note that we are not the APCUPSD upstream.

BTW, nice report and investigation.
Comment 5 Steven Stallion 2025-01-15 16:05:30 UTC
(In reply to Danilo G. Baio from comment #4)

Thanks! On these systems I usually use packages from the CDN and resort to using ports only when I need to customize behavior. I was hoping to resolve this upstream, but the project hasn't been touched in years. The good news is this is a very small adjustment to behavior that resolves a longstanding issue in the pcnet driver (there are unresolved reports for this problem). That said, I was hoping by moving this into ports I could avoid maintaining _EXTRA_PATCHES.
Comment 6 Danilo G. Baio freebsd_committer freebsd_triage 2025-01-15 16:12:39 UTC
(In reply to Steven Stallion from comment #5)

So, let's do this:
Send the patch to the project's mailing list to formalize it.
And also include it here as an extra patch, with an option enabled by default. This won't harm users; on the contrary.
This way, we are not modifying the project on our own.
Comment 7 Steven Stallion 2025-01-15 16:17:40 UTC
(In reply to Danilo G. Baio from comment #6)

Will do!
Comment 8 Steven Stallion 2025-01-15 17:50:05 UTC
Created attachment 256721 [details]
Proposed patch (updated)
Comment 9 Steven Stallion 2025-01-15 17:51:08 UTC
(In reply to Danilo G. Baio from comment #6)

I've updated the apcupsd-users mailing list thread and I have also attached an updated patch. Thanks again for taking a look!
Comment 10 Danilo G. Baio freebsd_committer freebsd_triage 2025-01-15 19:35:44 UTC
(In reply to Steven Stallion from comment #9)

Great, I'll run some build tests and then proceed to push the changes.
Comment 11 commit-hook freebsd_committer freebsd_triage 2025-01-15 19:45:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7f625a5cf6959cb84bb2f112583ea9cc6bb7c7fb

commit 7f625a5cf6959cb84bb2f112583ea9cc6bb7c7fb
Author:     Steven Stallion <sstallion@gmail.com>
AuthorDate: 2025-01-15 19:35:15 +0000
Commit:     Danilo G. Baio <dbaio@FreeBSD.org>
CommitDate: 2025-01-15 19:41:11 +0000

    sysutils/apcupsd: Add patch to increase the PCNET commlost timeout

    PR:             283900
    Reviewed by:    dbaio

 sysutils/apcupsd/Makefile                               | 12 +++++++-----
 sysutils/apcupsd/files/extra-patch-pcnet-commlost (new) | 17 +++++++++++++++++
 2 files changed, 24 insertions(+), 5 deletions(-)
Comment 12 Danilo G. Baio freebsd_committer freebsd_triage 2025-01-15 19:45:58 UTC
Committed, thanks!
Comment 13 Steven Stallion 2025-01-15 19:47:17 UTC
(In reply to Danilo G. Baio from comment #12)

Thank you!