From 0c7cb26bf4d5784884eeb68657b894ebb9be8d41 Mon Sep 17 00:00:00 2001 From: dfolcha Date: Thu, 22 Aug 2019 10:00:23 +0200 Subject: [PATCH 01/11] Changed check for systemd --- debs/SPECS/3.10.0/wazuh-agent/debian/postinst | 2 +- ova/generate_ova.sh | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/debs/SPECS/3.10.0/wazuh-agent/debian/postinst b/debs/SPECS/3.10.0/wazuh-agent/debian/postinst index 3047ee48d5..77a7eed756 100644 --- a/debs/SPECS/3.10.0/wazuh-agent/debian/postinst +++ b/debs/SPECS/3.10.0/wazuh-agent/debian/postinst @@ -144,7 +144,7 @@ case "$1" in # Service if [ -f /etc/init.d/wazuh-agent ]; then - if [ -d /run/systemd/system ]; then + if [ "$(file /sbin/init)"~="systemd" ]; then systemctl enable wazuh-agent > /dev/null 2>&1 fi update-rc.d wazuh-agent defaults > /dev/null 2>&1 diff --git a/ova/generate_ova.sh b/ova/generate_ova.sh index 11f33dd73a..c0c72f522b 100755 --- a/ova/generate_ova.sh +++ b/ova/generate_ova.sh @@ -200,13 +200,22 @@ main() { CHECKSUM_DIR="${OUTPUT_DIR}" fi - if [[ "${BUILD}" == true ]] && [[ "${HAVE_VERSION}" == true ]] && [[ "${HAVE_ELK_VERSION}" == true ]] && [[ "${HAVE_STATUS}" == true ]]; then + echo "${BUILD}" + echo "${HAVE_VERSION}" + echo "${HAVE_ELK_VERSION}" + echo "${HAVE_STATUS}" + + if [ "${BUILD}" = true ]] && [ "${HAVE_VERSION}" = true ] && [ "${HAVE_ELK_VERSION}" = true ] && [ "${HAVE_STATUS}" = true ]; then check_version ${WAZUH_VERSION} ${ELK_VERSION} ${STATUS} OVA_VERSION="${WAZUH_VERSION}_${ELK_VERSION}" echo "Version to build: ${WAZUH_VERSION}-${ELK_VERSION} with ${STATUS} repository." build_ova ${WAZUH_VERSION} ${OVA_VERSION} else + echo "${BUILD}" + echo "${HAVE_VERSION}" + echo "${HAVE_ELK_VERSION}" + echo "${HAVE_STATUS}" echo "ERROR: Need more parameters." help 1 fi From d9732962cb79f6c2b7c5a523e14166439f72bc60 Mon Sep 17 00:00:00 2001 From: dfolcha Date: Thu, 22 Aug 2019 15:06:33 +0200 Subject: [PATCH 02/11] Fixed missing [] --- debs/SPECS/3.10.0/wazuh-agent/debian/postinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debs/SPECS/3.10.0/wazuh-agent/debian/postinst b/debs/SPECS/3.10.0/wazuh-agent/debian/postinst index 77a7eed756..75ed0c66ee 100644 --- a/debs/SPECS/3.10.0/wazuh-agent/debian/postinst +++ b/debs/SPECS/3.10.0/wazuh-agent/debian/postinst @@ -2,7 +2,7 @@ # postinst script for wazuh-agent # Wazuh, Inc 2016 -set -e +set -ex case "$1" in configure) @@ -144,7 +144,7 @@ case "$1" in # Service if [ -f /etc/init.d/wazuh-agent ]; then - if [ "$(file /sbin/init)"~="systemd" ]; then + if [[ "$(file /sbin/init)" =~ "systemd" ]]; then systemctl enable wazuh-agent > /dev/null 2>&1 fi update-rc.d wazuh-agent defaults > /dev/null 2>&1 From 1669231d4d8bbcbd74b707cc17d52b2fbc1e3049 Mon Sep 17 00:00:00 2001 From: dfolcha Date: Thu, 22 Aug 2019 16:26:12 +0200 Subject: [PATCH 03/11] Adapt to sh syntax --- debs/SPECS/3.10.0/wazuh-agent/debian/postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debs/SPECS/3.10.0/wazuh-agent/debian/postinst b/debs/SPECS/3.10.0/wazuh-agent/debian/postinst index 75ed0c66ee..2a3876998a 100644 --- a/debs/SPECS/3.10.0/wazuh-agent/debian/postinst +++ b/debs/SPECS/3.10.0/wazuh-agent/debian/postinst @@ -144,7 +144,7 @@ case "$1" in # Service if [ -f /etc/init.d/wazuh-agent ]; then - if [[ "$(file /sbin/init)" =~ "systemd" ]]; 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 From dc86f0eb38cb7f3642e4fa5b1e1bcb2a0a14fed1 Mon Sep 17 00:00:00 2001 From: dfolcha Date: Fri, 23 Aug 2019 14:27:26 +0200 Subject: [PATCH 04/11] Aplied postinstall changes to manager --- debs/SPECS/3.10.0/wazuh-manager/debian/postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debs/SPECS/3.10.0/wazuh-manager/debian/postinst b/debs/SPECS/3.10.0/wazuh-manager/debian/postinst index 1c34fe07eb..c55affa9d1 100644 --- a/debs/SPECS/3.10.0/wazuh-manager/debian/postinst +++ b/debs/SPECS/3.10.0/wazuh-manager/debian/postinst @@ -284,7 +284,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 From 125fe4220d0d8f789dc8832d4b2d2c370e66761d Mon Sep 17 00:00:00 2001 From: dfolcha Date: Fri, 23 Aug 2019 14:59:50 +0200 Subject: [PATCH 05/11] Aply changes in postinstallation script to manager and reverted changes to OVA --- debs/SPECS/3.10.0/wazuh-agent/debian/postinst | 2 +- ova/generate_ova.sh | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/debs/SPECS/3.10.0/wazuh-agent/debian/postinst b/debs/SPECS/3.10.0/wazuh-agent/debian/postinst index 2b76e9b4e6..cba7b52496 100644 --- a/debs/SPECS/3.10.0/wazuh-agent/debian/postinst +++ b/debs/SPECS/3.10.0/wazuh-agent/debian/postinst @@ -2,7 +2,7 @@ # postinst script for wazuh-agent # Wazuh, Inc 2016 -set -ex +set -e case "$1" in configure) diff --git a/ova/generate_ova.sh b/ova/generate_ova.sh index c0c72f522b..11f33dd73a 100755 --- a/ova/generate_ova.sh +++ b/ova/generate_ova.sh @@ -200,22 +200,13 @@ main() { CHECKSUM_DIR="${OUTPUT_DIR}" fi - echo "${BUILD}" - echo "${HAVE_VERSION}" - echo "${HAVE_ELK_VERSION}" - echo "${HAVE_STATUS}" - - if [ "${BUILD}" = true ]] && [ "${HAVE_VERSION}" = true ] && [ "${HAVE_ELK_VERSION}" = true ] && [ "${HAVE_STATUS}" = true ]; then + if [[ "${BUILD}" == true ]] && [[ "${HAVE_VERSION}" == true ]] && [[ "${HAVE_ELK_VERSION}" == true ]] && [[ "${HAVE_STATUS}" == true ]]; then check_version ${WAZUH_VERSION} ${ELK_VERSION} ${STATUS} OVA_VERSION="${WAZUH_VERSION}_${ELK_VERSION}" echo "Version to build: ${WAZUH_VERSION}-${ELK_VERSION} with ${STATUS} repository." build_ova ${WAZUH_VERSION} ${OVA_VERSION} else - echo "${BUILD}" - echo "${HAVE_VERSION}" - echo "${HAVE_ELK_VERSION}" - echo "${HAVE_STATUS}" echo "ERROR: Need more parameters." help 1 fi From aca0c5d31a7e907d5e84482ecc20ebdc6427275d Mon Sep 17 00:00:00 2001 From: dfolcha Date: Mon, 2 Sep 2019 15:06:57 +0200 Subject: [PATCH 06/11] Apply same changes to postremove --- debs/SPECS/3.10.0/wazuh-agent/debian/postrm | 4 ++-- debs/SPECS/3.10.0/wazuh-manager/debian/postrm | 2 +- debs/SPECS/3.11.0/wazuh-agent/debian/postrm | 4 ++-- debs/SPECS/3.11.0/wazuh-manager/debian/postrm | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/debs/SPECS/3.10.0/wazuh-agent/debian/postrm b/debs/SPECS/3.10.0/wazuh-agent/debian/postrm index af836c56a6..7bcf9bd480 100644 --- a/debs/SPECS/3.10.0/wazuh-agent/debian/postrm +++ b/debs/SPECS/3.10.0/wazuh-agent/debian/postrm @@ -23,7 +23,7 @@ case "$1" in 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 @@ -57,7 +57,7 @@ case "$1" in delgroup ossec > /dev/null 2>&1 fi rm -rf ${DIR}/* - + ;; upgrade) diff --git a/debs/SPECS/3.10.0/wazuh-manager/debian/postrm b/debs/SPECS/3.10.0/wazuh-manager/debian/postrm index ddb15decd0..c57bdf5015 100644 --- a/debs/SPECS/3.10.0/wazuh-manager/debian/postrm +++ b/debs/SPECS/3.10.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 diff --git a/debs/SPECS/3.11.0/wazuh-agent/debian/postrm b/debs/SPECS/3.11.0/wazuh-agent/debian/postrm index af836c56a6..7bcf9bd480 100644 --- a/debs/SPECS/3.11.0/wazuh-agent/debian/postrm +++ b/debs/SPECS/3.11.0/wazuh-agent/debian/postrm @@ -23,7 +23,7 @@ case "$1" in 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 @@ -57,7 +57,7 @@ case "$1" in delgroup ossec > /dev/null 2>&1 fi rm -rf ${DIR}/* - + ;; upgrade) diff --git a/debs/SPECS/3.11.0/wazuh-manager/debian/postrm b/debs/SPECS/3.11.0/wazuh-manager/debian/postrm index ddb15decd0..c57bdf5015 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 [ ! -z "$(file /sbin/init |grep "systemd")" ]; then systemctl disable wazuh-manager > /dev/null 2>&1 systemctl daemon-reload systemctl reset-failed From 7d748422db9284a94fe766694b01b202a4e991c1 Mon Sep 17 00:00:00 2001 From: dfolcha Date: Mon, 9 Sep 2019 11:15:03 +0200 Subject: [PATCH 07/11] Included changes in manager postinstallation script into 3.11.0 SPECS --- debs/SPECS/3.11.0/wazuh-manager/debian/postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debs/SPECS/3.11.0/wazuh-manager/debian/postinst b/debs/SPECS/3.11.0/wazuh-manager/debian/postinst index 59415f37ba..31cb1a57e1 100644 --- a/debs/SPECS/3.11.0/wazuh-manager/debian/postinst +++ b/debs/SPECS/3.11.0/wazuh-manager/debian/postinst @@ -332,7 +332,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 From b331dac1086993bb4095058d886b0edf9892ae6d Mon Sep 17 00:00:00 2001 From: dfolcha Date: Mon, 9 Sep 2019 11:19:23 +0200 Subject: [PATCH 08/11] Included changes in agent postinstallation script into 3.11.0 SPECS --- debs/SPECS/3.11.0/wazuh-agent/debian/postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debs/SPECS/3.11.0/wazuh-agent/debian/postinst b/debs/SPECS/3.11.0/wazuh-agent/debian/postinst index 0ba51cd42d..cba7b52496 100644 --- a/debs/SPECS/3.11.0/wazuh-agent/debian/postinst +++ b/debs/SPECS/3.11.0/wazuh-agent/debian/postinst @@ -140,7 +140,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 From 84e8454a614c1ae803ba35a05c3c8222f13bb82b Mon Sep 17 00:00:00 2001 From: DFolchA Date: Mon, 23 Sep 2019 09:52:25 +0200 Subject: [PATCH 09/11] Delete spaces that were not needed --- debs/SPECS/3.10.0/wazuh-agent/debian/postinst | 2 +- debs/SPECS/3.10.0/wazuh-agent/debian/postrm | 2 +- debs/SPECS/3.10.0/wazuh-manager/debian/postinst | 2 +- debs/SPECS/3.11.0/wazuh-agent/debian/postrm | 4 ---- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/debs/SPECS/3.10.0/wazuh-agent/debian/postinst b/debs/SPECS/3.10.0/wazuh-agent/debian/postinst index 2b670e2259..9a05e5faf4 100644 --- a/debs/SPECS/3.10.0/wazuh-agent/debian/postinst +++ b/debs/SPECS/3.10.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 [ -d /run/systemd/system ]; 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.10.0/wazuh-agent/debian/postrm b/debs/SPECS/3.10.0/wazuh-agent/debian/postrm index d0230ef47d..85fc0bc23f 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/postinst b/debs/SPECS/3.10.0/wazuh-manager/debian/postinst index 82ec395522..7b90d9383c 100644 --- a/debs/SPECS/3.10.0/wazuh-manager/debian/postinst +++ b/debs/SPECS/3.10.0/wazuh-manager/debian/postinst @@ -339,7 +339,7 @@ case "$1" in # Service if [ -x /etc/init.d/wazuh-manager ]; then - if [ -d /run/systemd/system ] ; then + if [ -d /run/systemd/system ]; then systemctl daemon-reload systemctl enable wazuh-manager > /dev/null 2>&1 fi diff --git a/debs/SPECS/3.11.0/wazuh-agent/debian/postrm b/debs/SPECS/3.11.0/wazuh-agent/debian/postrm index f2f29a57b7..2c73048fa4 100644 --- a/debs/SPECS/3.11.0/wazuh-agent/debian/postrm +++ b/debs/SPECS/3.11.0/wazuh-agent/debian/postrm @@ -22,12 +22,8 @@ case "$1" in rm -rf ${WAZUH_TMP_DIR} fi -<<<<<<< HEAD if [ ! -z "$(file /sbin/init |grep "systemd")" ]; then -======= - if [ -d /run/systemd/system ] ; then ->>>>>>> e16192ef9ebe2c410f06529c2691d1b566e4ef09 systemctl disable wazuh-agent > /dev/null 2>&1 systemctl daemon-reload systemctl reset-failed From 6765088880328ba825528bf1164578088b3bf8fa Mon Sep 17 00:00:00 2001 From: dfolcha Date: Fri, 24 Jan 2020 17:47:39 +0100 Subject: [PATCH 10/11] Fix mistake with " --- debs/SPECS/3.11.3/wazuh-agent/debian/postinst | 2 +- debs/SPECS/3.11.3/wazuh-agent/debian/postrm | 2 +- debs/SPECS/3.11.3/wazuh-manager/debian/postinst | 2 +- debs/SPECS/3.11.3/wazuh-manager/debian/postrm | 2 +- debs/SPECS/3.12.0/wazuh-agent/debian/postinst | 2 +- debs/SPECS/3.12.0/wazuh-agent/debian/postrm | 2 +- debs/SPECS/3.12.0/wazuh-manager/debian/postinst | 2 +- debs/SPECS/3.12.0/wazuh-manager/debian/postrm | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) 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 From 83a635252ec4d5a95bb95b27771bfcc33a22589d Mon Sep 17 00:00:00 2001 From: dfolcha Date: Mon, 27 Jan 2020 09:23:03 +0100 Subject: [PATCH 11/11] Remove changes from old files --- debs/SPECS/3.11.0/wazuh-agent/debian/postinst | 2 +- debs/SPECS/3.11.0/wazuh-agent/debian/postrm | 2 +- debs/SPECS/3.11.0/wazuh-manager/debian/postinst | 2 +- debs/SPECS/3.11.0/wazuh-manager/debian/postrm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debs/SPECS/3.11.0/wazuh-agent/debian/postinst b/debs/SPECS/3.11.0/wazuh-agent/debian/postinst index 0fa1c13a02..974b8807e2 100644 --- a/debs/SPECS/3.11.0/wazuh-agent/debian/postinst +++ b/debs/SPECS/3.11.0/wazuh-agent/debian/postinst @@ -142,7 +142,7 @@ case "$1" in # Service if [ -f /etc/init.d/wazuh-agent ]; then - if [ ! -z "$(file /sbin/init |grep "systemd")" ]; then + if [ -d /run/systemd/system ]; 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.0/wazuh-agent/debian/postrm b/debs/SPECS/3.11.0/wazuh-agent/debian/postrm index 0e2f3c182b..681104f1e2 100644 --- a/debs/SPECS/3.11.0/wazuh-agent/debian/postrm +++ b/debs/SPECS/3.11.0/wazuh-agent/debian/postrm @@ -23,7 +23,7 @@ case "$1" in fi - if [ ! -z "$(file /sbin/init |grep "systemd")" ]; 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/postinst b/debs/SPECS/3.11.0/wazuh-manager/debian/postinst index e3f6892247..e9d2b54c1a 100644 --- a/debs/SPECS/3.11.0/wazuh-manager/debian/postinst +++ b/debs/SPECS/3.11.0/wazuh-manager/debian/postinst @@ -348,7 +348,7 @@ case "$1" in # Service if [ -x /etc/init.d/wazuh-manager ]; then - if [ ! -z "$(file /sbin/init |grep "systemd")" ]; then + if [ -d /run/systemd/system ]; then systemctl daemon-reload systemctl enable wazuh-manager > /dev/null 2>&1 fi diff --git a/debs/SPECS/3.11.0/wazuh-manager/debian/postrm b/debs/SPECS/3.11.0/wazuh-manager/debian/postrm index 788137f56f..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 [ ! -z "$(file /sbin/init |grep "systemd")" ]; then + if [ -d /run/systemd/system ]; then systemctl disable wazuh-manager > /dev/null 2>&1 systemctl daemon-reload systemctl reset-failed