Files
apcupsd/apcupsd.hibernate
Antonio Teixeira 4789aa9d95 Accepting request 1186572 from home:manfred999
Build fix for Leap 15.6:

- remove obsolete text concerning apcupsd-early-powerdown in README.SUSE
- do not use /sbin/service, call systemctl directly
- Leap 15.6 also needs util-linux-tty-tools
- Patch configure to show correct GCC version (not configure.in, autoreconf fails)
- Use %make_build in spec file

OBS-URL: https://build.opensuse.org/request/show/1186572
OBS-URL: https://build.opensuse.org/package/show/hardware/apcupsd?expand=0&rev=104
2024-07-10 14:16:41 +00:00

16 lines
586 B
Bash

#!/bin/bash
# Always stop apcupsd before sleep, but do not initiate powerdown for hybrid-sleep.
if [ "$1" = pre ] && ( [ "$2" = hibernate ] || [ "$2" = hybrid-sleep ] ) ; then
/usr/bin/systemctl stop apcupsd.service
fi
if [ "$1" = pre ] && [ "$2" = hibernate ] ; then
# FIXME: All hibernate quirks are called in parallel. To be on a safest side, we should initiate powerdown grace period when they terminate.
sleep 5
/etc/apcupsd/apccontrol killpower
fi
if [ "$1" = post ] && ( [ "$2" = hibernate ] || [ "$2" = hybrid-sleep ] ) ; then
/usr/bin/systemctl start apcupsd.service
fi