diff --git a/debs/SPECS/3.10.0/wazuh-agent/debian/postrm b/debs/SPECS/3.10.0/wazuh-agent/debian/postrm index 6287122a36..8584e4298d 100644 --- a/debs/SPECS/3.10.0/wazuh-agent/debian/postrm +++ b/debs/SPECS/3.10.0/wazuh-agent/debian/postrm @@ -22,7 +22,7 @@ case "$1" in rm -rf ${WAZUH_TMP_DIR} fi - if [ -d /run/systemd/system ] ; then + if [ -d /run/systemd/system ]; then systemctl disable wazuh-agent > /dev/null 2>&1 systemctl daemon-reload systemctl reset-failed diff --git a/debs/SPECS/3.10.0/wazuh-manager/debian/postrm b/debs/SPECS/3.10.0/wazuh-manager/debian/postrm index 506c661f3a..8566f5e7fa 100644 --- a/debs/SPECS/3.10.0/wazuh-manager/debian/postrm +++ b/debs/SPECS/3.10.0/wazuh-manager/debian/postrm @@ -25,8 +25,6 @@ case "$1" in rm -rf ${WAZUH_TMP_DIR} fi - - if [ -d /run/systemd/system ] ; then systemctl disable wazuh-manager > /dev/null 2>&1 systemctl daemon-reload diff --git a/debs/SPECS/3.11.0/wazuh-agent/debian/postrm b/debs/SPECS/3.11.0/wazuh-agent/debian/postrm index 6287122a36..681104f1e2 100644 --- a/debs/SPECS/3.11.0/wazuh-agent/debian/postrm +++ b/debs/SPECS/3.11.0/wazuh-agent/debian/postrm @@ -22,7 +22,8 @@ case "$1" in rm -rf ${WAZUH_TMP_DIR} fi - if [ -d /run/systemd/system ] ; then + + if [ -d /run/systemd/system ]; then systemctl disable wazuh-agent > /dev/null 2>&1 systemctl daemon-reload systemctl reset-failed diff --git a/debs/SPECS/3.11.0/wazuh-manager/debian/postrm b/debs/SPECS/3.11.0/wazuh-manager/debian/postrm index 506c661f3a..65f5b0d813 100644 --- a/debs/SPECS/3.11.0/wazuh-manager/debian/postrm +++ b/debs/SPECS/3.11.0/wazuh-manager/debian/postrm @@ -27,7 +27,7 @@ case "$1" in - if [ -d /run/systemd/system ] ; then + if [ -d /run/systemd/system ]; then systemctl disable wazuh-manager > /dev/null 2>&1 systemctl daemon-reload systemctl reset-failed diff --git a/debs/SPECS/3.11.3/wazuh-agent/debian/postinst b/debs/SPECS/3.11.3/wazuh-agent/debian/postinst index 974b8807e2..77e0bf167d 100644 --- a/debs/SPECS/3.11.3/wazuh-agent/debian/postinst +++ b/debs/SPECS/3.11.3/wazuh-agent/debian/postinst @@ -142,7 +142,7 @@ case "$1" in # Service if [ -f /etc/init.d/wazuh-agent ]; then - if [ -d /run/systemd/system ]; then + if [ ! -z "$(file /sbin/init |grep 'systemd')" ]; then systemctl enable wazuh-agent > /dev/null 2>&1 fi update-rc.d wazuh-agent defaults > /dev/null 2>&1 diff --git a/debs/SPECS/3.11.3/wazuh-agent/debian/postrm b/debs/SPECS/3.11.3/wazuh-agent/debian/postrm index 6287122a36..60b6cce1a7 100644 --- a/debs/SPECS/3.11.3/wazuh-agent/debian/postrm +++ b/debs/SPECS/3.11.3/wazuh-agent/debian/postrm @@ -22,7 +22,7 @@ case "$1" in rm -rf ${WAZUH_TMP_DIR} fi - if [ -d /run/systemd/system ] ; then + if [ ! -z "$(file /sbin/init |grep 'systemd')" ]; then systemctl disable wazuh-agent > /dev/null 2>&1 systemctl daemon-reload systemctl reset-failed diff --git a/debs/SPECS/3.11.3/wazuh-manager/debian/postinst b/debs/SPECS/3.11.3/wazuh-manager/debian/postinst index e9d2b54c1a..14cfa2250f 100644 --- a/debs/SPECS/3.11.3/wazuh-manager/debian/postinst +++ b/debs/SPECS/3.11.3/wazuh-manager/debian/postinst @@ -348,7 +348,7 @@ case "$1" in # Service if [ -x /etc/init.d/wazuh-manager ]; then - if [ -d /run/systemd/system ]; then + if [ ! -z "$(file /sbin/init |grep 'systemd')" ]; then systemctl daemon-reload systemctl enable wazuh-manager > /dev/null 2>&1 fi diff --git a/debs/SPECS/3.11.3/wazuh-manager/debian/postrm b/debs/SPECS/3.11.3/wazuh-manager/debian/postrm index 506c661f3a..44cded9f3f 100644 --- a/debs/SPECS/3.11.3/wazuh-manager/debian/postrm +++ b/debs/SPECS/3.11.3/wazuh-manager/debian/postrm @@ -27,7 +27,7 @@ case "$1" in - if [ -d /run/systemd/system ] ; then + if [ ! -z "$(file /sbin/init |grep 'systemd')" ]; then systemctl disable wazuh-manager > /dev/null 2>&1 systemctl daemon-reload systemctl reset-failed diff --git a/debs/SPECS/3.12.0/wazuh-agent/debian/postinst b/debs/SPECS/3.12.0/wazuh-agent/debian/postinst index 974b8807e2..77e0bf167d 100644 --- a/debs/SPECS/3.12.0/wazuh-agent/debian/postinst +++ b/debs/SPECS/3.12.0/wazuh-agent/debian/postinst @@ -142,7 +142,7 @@ case "$1" in # Service if [ -f /etc/init.d/wazuh-agent ]; then - if [ -d /run/systemd/system ]; then + if [ ! -z "$(file /sbin/init |grep 'systemd')" ]; then systemctl enable wazuh-agent > /dev/null 2>&1 fi update-rc.d wazuh-agent defaults > /dev/null 2>&1 diff --git a/debs/SPECS/3.12.0/wazuh-agent/debian/postrm b/debs/SPECS/3.12.0/wazuh-agent/debian/postrm index 6287122a36..60b6cce1a7 100644 --- a/debs/SPECS/3.12.0/wazuh-agent/debian/postrm +++ b/debs/SPECS/3.12.0/wazuh-agent/debian/postrm @@ -22,7 +22,7 @@ case "$1" in rm -rf ${WAZUH_TMP_DIR} fi - if [ -d /run/systemd/system ] ; then + if [ ! -z "$(file /sbin/init |grep 'systemd')" ]; then systemctl disable wazuh-agent > /dev/null 2>&1 systemctl daemon-reload systemctl reset-failed diff --git a/debs/SPECS/3.12.0/wazuh-manager/debian/postinst b/debs/SPECS/3.12.0/wazuh-manager/debian/postinst index e9d2b54c1a..14cfa2250f 100644 --- a/debs/SPECS/3.12.0/wazuh-manager/debian/postinst +++ b/debs/SPECS/3.12.0/wazuh-manager/debian/postinst @@ -348,7 +348,7 @@ case "$1" in # Service if [ -x /etc/init.d/wazuh-manager ]; then - if [ -d /run/systemd/system ]; then + if [ ! -z "$(file /sbin/init |grep 'systemd')" ]; then systemctl daemon-reload systemctl enable wazuh-manager > /dev/null 2>&1 fi diff --git a/debs/SPECS/3.12.0/wazuh-manager/debian/postrm b/debs/SPECS/3.12.0/wazuh-manager/debian/postrm index 506c661f3a..44cded9f3f 100644 --- a/debs/SPECS/3.12.0/wazuh-manager/debian/postrm +++ b/debs/SPECS/3.12.0/wazuh-manager/debian/postrm @@ -27,7 +27,7 @@ case "$1" in - if [ -d /run/systemd/system ] ; then + if [ ! -z "$(file /sbin/init |grep 'systemd')" ]; then systemctl disable wazuh-manager > /dev/null 2>&1 systemctl daemon-reload systemctl reset-failed