I kept wondering why the version number in /etc/apcupsd/apcupsd.conf was much older than my package version, and did not seem to be affected by any changes in my USE flags (as the upstream package's apcupsd.conf.in file would seem to indicate it would), then I realized the Gentoo ebuild is replacing the file generated by the upstream package's configure step with this static copy: https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-power/apcupsd/files/apcupsd.conf You can see this in the ebuild's src_install(), the following line: doins "${FILESDIR}"/apcupsd.conf The static file's Git log shows it was committed first in 2015 and never updated since: https://gitweb.gentoo.org/repo/gentoo.git/log/sys-power/apcupsd/files/apcupsd.conf The log messages do not indicate why it was created, and there have been several new apcupsd versions since. Please remove this static config file and the corresponding line from the ebuild. It may also be a good time to review whether the patches are still relevant -- they all seem to be for much older apcupsd versions and maybe they're no longer necessary (or worse, are breaking thing).
The only setting in Gentoo's override config that seems to me like obviously a good idea is the override for the NISIP option. Upstream's default is 0.0.0.0, but Gentoo's override of only binding to 127.0.0.1 is safer. This could perhaps be accomplished with some kind of post-installation patch rather than a complete config replacement.
Ack. This can be easy solved by using a configure parameter. No need to copy that config.
(In reply to Conrad Kostecki from comment #2) > Ack. This can be easy solved by using a configure parameter. No need to copy > that config. Please forgive my confusion -- are you suggesting this is easily solvable for an end user, or that this is easily solvable for the ebuild maintainer(s)?
(In reply to Michael Yagliyan from comment #3) > (In reply to Conrad Kostecki from comment #2) > > Ack. This can be easy solved by using a configure parameter. No need to copy > > that config. > > Please forgive my confusion -- are you suggesting this is easily solvable > for an end user, or that this is easily solvable for the ebuild > maintainer(s)? For the maintainer. I will finish my PR and then it will be the case, that new versions (-r4) will install generated apcupsd.conf with NISIP set to 127.0.0.1.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85f08b2beefc799a843a3c84f309cf44a3316a93 commit 85f08b2beefc799a843a3c84f309cf44a3316a93 Author: Conrad Kostecki <conikost@gentoo.org> AuthorDate: 2025-01-23 23:49:58 +0000 Commit: Conrad Kostecki <conikost@gentoo.org> CommitDate: 2025-01-23 23:51:12 +0000 sys-power/apcupsd: update EAPI 7 -> 8 Also changed: * Sorted use flags * Use generated apcupsd.conf * Set NISIP via configure * Remove runlevel check from apcupsd.powerfail * Patch for LTO * Dropped PAGER workaround Closes: https://bugs.gentoo.org/418177 Closes: https://bugs.gentoo.org/832350 Closes: https://bugs.gentoo.org/941584 Closes: https://github.com/gentoo/gentoo/pull/40199 Signed-off-by: Conrad Kostecki <conikost@gentoo.org> sys-power/apcupsd/apcupsd-3.14.14-r4.ebuild | 160 ++++++++++++++++++++++ sys-power/apcupsd/files/apcupsd-3.14.14-lto.patch | 29 ++++ sys-power/apcupsd/files/apcupsd.powerfail.init-r1 | 17 +++ 3 files changed, 206 insertions(+)