RHEL 9 - Services are not being removed when uninstalling if the service is running

Posted on

When using Ansible and removing packages (yum) I'm noticing that for RHEL7 and RHEL8 when I uninstall a package with a service that is running the systemd service file is removed however, with RHEL9 if the service is not first stopped the service file will remain and Ansible reports that the service still exists in ansible_facts.services. In order to cleanly remove it, I either have to first stop the service and then remove it or I have to manually delete the .service file and then do a daemon-reload. On occasion, I even have to do a reset-failed to get it to remove the service completely. Again, this only happens on RHEL9, RHEL7 and RHEL8 are working properly.

Responses