Description of problem: Spec file for tendrl-api package doesn't contain any %post, %preun and %postun scripts to notify systemd about the performed changes. So for example, after uninstalling tendrl-api, `systemctl status tendrl-api` command return: Failed to get properties: Access denied instead of expected: Unit tendrl-api.service could not be found. And there are some other situations when the systemd is in slightly inconsistent state after install/uninstall of tendrl-api package. Version-Release number of selected component (if applicable): tendrl-api-1.5.4-4.el7rhgs.noarch Actual results: tendrl-api.spec file doesn't contain any pre/post in/uninstall scripts to notify systemd about the changes Expected results: tendrl-api.spec file should contain required pre/post in/uninstall scripts to notify systemd about the changes Additional info: For example (and for inspiration), httpd.spec file contains following definitions: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ %post %systemd_post httpd.service htcacheclean.service %preun %systemd_preun httpd.service htcacheclean.service %postun %systemd_postun ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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