What | Removed | Added |
---|---|---|
Status | IN_PROGRESS | RESOLVED |
Resolution | --- | FIXED |
I fixed the script.
Testcases:
Before each test case, I removed apcupsd. Then I did the config change and
installed apcupsd.
1) no /etc/sysconfig/shutdown
No config, nothing to do. No message. Test OK.
2) echo 'HALT_POWERDWN_INSERT=""' >/etc/sysconfig/shutdown
Config exists, but the line in question does not. No message. Test OK.
3) echo 'HALT_POWERDOWN_INSERT="/etc/init.d/apcupsd try-powerdown"'
>/etc/sysconfig/shutdown
Config exists, old line exists. Line is correctly changed. No message. Test OK.
4) echo 'HALT_POWERDOWN_INSERT=""' >/etc/sysconfig/shutdown
Config exists, variable is already empty. No message. Test OK.
5) echo 'HALT_POWERDOWN_INSERT="wrong"' >/etc/sysconfig/shutdown
Config exists, variable contains unknown value. Message:
apcupsd: WARNING: Unknown value of HALT_POWERDOWN_INSERT in
/etc/sysconfig/shutdown.
Keeping unchanged. If it still exists, it should be:
HALT_POWERDOWN_INSERT=""
Test OK.
I am submitting the fix to Factory only. The message has no side effects.