When shutting down the system use -p to make sure it's powered off. On my system without this change it just sits there waiting to be turned off, and I'd prefer it turned itself off rather than waiting for the UPS to kill the power feed. I can patch this locally if this isn't generally useful, but I'm not sure what benefit there is to using -h over -p anyway? Port maintainer (itetcu@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 1.00.2014.03.16 (mode: change, diff: SVN)
Responsible Changed From-To: freebsd-ports-bugs->itetcu Over to maintainer (via the GNATS Auto Assign Tool)
Alternatively, maybe the port could treat ${PREFIX}/etc/apcupsd/apccontrol as a user-editable config file and not add it to the pkg-plist? (ie. treat it like other config files with a .sample one and testing for changes on package removal). Then it'd make it possible to make changes like this and preserve them. Tim. -- Tim Bishop http://www.bishnet.net/tim/ PGP Key: 0x6C226B37FDF38D55
Created attachment 144481 [details] Revised patch Here is a revised patch. Rather than making the specific change that I wanted it seems better to make all these configuration files user changeable without getting them overwritten during a package upgrade.
Maintainer reset.
Hi Tim. The sample files are fine, but in apccontrol I think it's not. > # WARNING: the apccontrol file will be overwritten every time you update your > # apcupsd, doing `make install'. Your own customized scripts will _not_ be > # overwritten. If you wish to make changes to this file (discouraged), you > # should change apccontrol.sh.in and then rerun the configure process. What about an option to change this behavior before building? POWEROFF The system is halted and the power is turned off (hardware support required) at the specified time. [./platforms/freebsd/apccontrol.in] ${SHUTDOWN} -h now --> ${SHUTDOWN} -p now Regards.
(In reply to Danilo G. Baio from comment #5) I no longer have an APC UPS to test, nor do I really remember what I was trying to achieve 4 years ago. Maybe just changing -h to -p at build time is enough, as you say. Tim.
I also don't understand the benefit of using -h instead of -p. In apccontrol, it's suggested that you can achieve this by creating a script called "/usr/local/etc/apcupsd/doshutdown", so this is what I've been doing to get the desired effect: #!/bin/sh shutdown -p now exit 99
(In reply to Tim Bishop from comment #6) Ok, thank you. I will take a look on this and open a review with another PR's (patches). Regards.
A commit references this bug: Author: dbaio Date: Mon Jun 19 22:45:58 UTC 2017 New revision: 443914 URL: https://svnweb.freebsd.org/changeset/ports/443914 Log: sysutils/apcupsd: Several improvements Add support for running multiple instances of apcupsd[1] Add an option to use `shutdown -p` rather than `shutdown -h`[2] Set as @sample several scripts that can be customized[3] Add an option for build with MODBUS USB driver support (Enabled by default)[4] Set LICENSE_FILE [5] Sort OPTIONS and make a small adjustment in pkg-message Take maintainer'ship PR: 180336 [1] PR: 187924 [2][3] PR: 215809 [4] PR: 220002 [5] Submitted by: leres@ee.lbl.gov [1] Submitted by: tdb [3] Submitted by: ipluta@wp.pl [4] Submitted by: takefu@airport.fm [5] Approved by: garga (mentor) Differential Revision: https://reviews.freebsd.org/D11224 Changes: head/sysutils/apcupsd/Makefile head/sysutils/apcupsd/files/apcupsd.in head/sysutils/apcupsd/files/patch-platforms_etc_Makefile head/sysutils/apcupsd/files/pkg-message.in head/sysutils/apcupsd/pkg-plist
Committed, thanks.