Installation of Sensu package on AIX fails on pre_rm script. Following command is used to install the package: installp -aYF -Q -d /var/tmp/sensu-1.1.2-1.powerpc.bff sensu
+-----------------------------------------------------------------------------+
Installing Software...
+-----------------------------------------------------------------------------+
installp: APPLYING software for:
sensu 1.1.2.1
Failure occurred during pre_rm.
Failure occurred during rminstal.
Finished processing all filesets. (Total time: 1 secs).
There is a function in sensu.pre_rm script to stop sensu-client. To ignore failure of stopsrc, when Sensu is not installed or not running, it sets +e flag, however looks like this is only valid within the function as the script fails because of non-zero return code of stop_sensu_services.
stop_sensu_services()
{
set -e
set +e
stopsrc -s sensu-client > /dev/null 2>&1
}
This is because set +e is in effect within the function and it does not exit after stopsrc fails, but it exits because function stop_sensu_services fails (non-zero return code and set -e is set for the script). Looks like this is different behavior than bash where set +e in function is global.
The simple fix would be changing stop_sensu_services for AIX to
Installation of Sensu package on AIX fails on
pre_rm
script. Following command is used to install the package:installp -aYF -Q -d /var/tmp/sensu-1.1.2-1.powerpc.bff sensu
There is a function in
sensu.pre_rm
script to stop sensu-client. To ignore failure ofstopsrc
, when Sensu is not installed or not running, it sets+e
flag, however looks like this is only valid within the function as the script fails because of non-zero return code ofstop_sensu_services
.This is because
set +e
is in effect within the function and it does not exit afterstopsrc
fails, but it exits because functionstop_sensu_services
fails (non-zero return code andset -e
is set for the script). Looks like this is different behavior than bash whereset +e
in function is global.The simple fix would be changing
stop_sensu_services
for AIX to