Page MenuHomeFreeBSD

sysutils/apcupsd: Several improvements
ClosedPublic

Authored by dbaio on Jun 15 2017, 6:33 PM.

Details

Summary
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
Test Plan
$ portlint -C
WARN: Makefile: SHUTDOWN_POWEROFF is listed in OPTIONS_DEFINE, but no PORT_OPTIONS:MSHUTDOWN_POWEROFF appears.
WARN: Makefile: possible use of absolute pathname "/sbin/shutdown".
WARN: /usr/home/dbaio/ports/sysutils/apcupsd/distinfo: [1]: TIMESTAMP is over 30 days old
0 fatal errors and 3 warnings found.

poudriere testport:

10.3-RELEASE-p19 amd64
10.3-RELEASE-p19 i386
11.0-RELEASE-p10 amd64
11.0-RELEASE-p10 i386
12.0-CURRENT 1200031 amd64
12.0-CURRENT 1200031 i386

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dbaio created this revision.Jun 15 2017, 6:33 PM
tdb added a subscriber: tdb.Jun 15 2017, 8:02 PM

Maybe SHUTDOWN_POWEROFF should be on by default?

dbaio added a comment.Jun 15 2017, 9:25 PM

Hi.

I left this option disabled because it will change the comportment in power outages for many users that are using the shutdown -h behavior.

For instance, with IBM servers, If a power failure occurs while the server is turned on, the server will restart automatically when power is restored. And with some systems in the halt state, that is what will happen.

From APC: Computer will not automatically reboot after UPS has shutdown and restarted

ALWAYS ON: When power is cycled on, the computer will automatically turn on and boot up.
ALWAYS OFF: When power is cycled on, the computer will stay off until the user manually hits the On/Off soft switch.
LAST STATE: When power is cycled on, the computer will either come on or stay off depending on whether it was On or Off when the power was lost.

More info here.
IBM

Changing this for shutdown -p now worries me because of this, and IMHO, it seems to be a POLA violation.

Makes any sense?

I'm open for discussion.

Regards.

tdb added a comment.Jun 16 2017, 9:17 AM

Ok, yup, you make some very good points. Your current plan having it as a default off option makes the most sense.

garga accepted this revision.Jun 19 2017, 11:10 AM
This revision is now accepted and ready to land.Jun 19 2017, 11:10 AM
This revision was automatically updated to reflect the committed changes.