diff --git a/shared/templates/template_BASH_service_disabled b/shared/templates/template_BASH_service_disabled index 6cf82cf2ce9..8b2bbbbd616 100644 --- a/shared/templates/template_BASH_service_disabled +++ b/shared/templates/template_BASH_service_disabled @@ -14,6 +14,7 @@ SYSTEMCTL_EXEC='/usr/bin/systemctl' {{%- endif %}} # Disable socket activation if we have a unit file for it if "$SYSTEMCTL_EXEC" list-unit-files | grep -q '^{{{ DAEMONNAME }}}.socket'; then + "$SYSTEMCTL_EXEC" stop '{{{ DAEMONNAME }}}.socket' "$SYSTEMCTL_EXEC" disable '{{{ DAEMONNAME }}}.socket' {{%- if MASK_SERVICE %}} "$SYSTEMCTL_EXEC" mask '{{{ DAEMONNAME }}}.socket' diff --git a/shared/templates/template_OVAL_service_disabled b/shared/templates/template_OVAL_service_disabled index e69891aac88..ac7d27c8818 100644 --- a/shared/templates/template_OVAL_service_disabled +++ b/shared/templates/template_OVAL_service_disabled @@ -15,12 +15,13 @@ - - {{%- if MASK_SERVICE %}} + {{%- else %}} + + {{%- endif %}} diff --git a/tests/data/group_services/group_avahi/group_disable_avahi_group/rule_service_avahi-daemon_disabled/service_disabled.pass.sh b/tests/data/group_services/group_avahi/group_disable_avahi_group/rule_service_avahi-daemon_disabled/service_disabled.pass.sh index f7d21f1dadd..dd7ec06b219 100644 --- a/tests/data/group_services/group_avahi/group_disable_avahi_group/rule_service_avahi-daemon_disabled/service_disabled.pass.sh +++ b/tests/data/group_services/group_avahi/group_disable_avahi_group/rule_service_avahi-daemon_disabled/service_disabled.pass.sh @@ -4,6 +4,9 @@ yum -y install avahi +systemctl stop avahi-daemon.service systemctl disable avahi-daemon.service +systemctl mask avahi-daemon.service + +systemctl stop avahi-daemon.socket systemctl disable avahi-daemon.socket -systemctl mask avahi-daemon