Bug 1526375
Summary: | tendrl-api rpm %post, %preun, %postun scripts should correctly handle systemd service | ||
---|---|---|---|
Product: | [Red Hat Storage] Red Hat Gluster Storage | Reporter: | Daniel Horák <dahorak> |
Component: | web-admin-tendrl-api | Assignee: | Shirshendu Mukherjee <smukherj> |
Status: | CLOSED ERRATA | QA Contact: | Daniel Horák <dahorak> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rhgs-3.3 | CC: | nthomas, rhs-bugs, smukherj |
Target Milestone: | --- | ||
Target Release: | RHGS 3.4.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | tendrl-ansible-1.6.1-2.el7rhgs.noarch.rpm, tendrl-api-1.6.1-1.el7rhgs.noarch.rpm, tendrl-commons-1.6.1-1.el7rhgs.noarch.rpm, tendrl-monitoring-integration-1.6.1-1.el7rhgs.noarch.rpm, tendrl-node-agent-1.6.1-1.el7, tendrl-ui-1.6.1-1.el7rhgs.noarch.rpm, | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-09-04 07:00:31 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1503134 |
Description
Daniel Horák
2017-12-15 10:04:55 UTC
Tested and verified with:
tendrl-api-1.6.3-3.el7rhgs.src.rpm
The specfile now contains expected macros:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%post
%systemd_post tendrl-api.service
%preun
%systemd_preun tendrl-api.service
%postun
%systemd_postun_with_restart tendrl-api.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
And they are correctly expanded to post/preun/postun scripts:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# rpm -q tendrl-api --scripts
<<truncated>>
postinstall scriptlet (using /bin/sh):
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl preset tendrl-api.service >/dev/null 2>&1 || :
fi
preuninstall scriptlet (using /bin/sh):
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable tendrl-api.service > /dev/null 2>&1 || :
systemctl stop tendrl-api.service > /dev/null 2>&1 || :
fi
postuninstall scriptlet (using /bin/sh):
systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
systemctl try-restart tendrl-api.service >/dev/null 2>&1 || :
fi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Also case with uninstalling tendrl-api and trying to get status of tendrl-api
service fails with correct error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# systemctl status tendrl-api
Unit tendrl-api.service could not be found.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> VERIFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:2616 |