From 15332d1248252d41a680929dafcb3db90dc2dd5f Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 10 Apr 2018 20:02:08 +0200 Subject: [PATCH] TT#26264 Use service(8) instead of directly calling /etc/init.d/ We are in the process of removing the obsolete init scripts, so trying to use them directly will make these operations not work at all. Change-Id: Iba96fdb28e04f8b313ea03825b915ec4a8612351 (cherry picked from commit ae0200e9ad5889b5a572c4e5ed8a0d0fec476ad0) --- templates/scripts/includes/deployment.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/templates/scripts/includes/deployment.sh b/templates/scripts/includes/deployment.sh index 7d77019..6da4b15 100644 --- a/templates/scripts/includes/deployment.sh +++ b/templates/scripts/includes/deployment.sh @@ -336,7 +336,7 @@ ensure_augtool_present() { #cat > /etc/rsyslog.d/logsend.conf << EOF #*.* @@192.168.51.28 #EOF -#/etc/init.d/rsyslog restart +#service rsyslog restart logit() { logger -t grml-deployment "$@" @@ -1164,7 +1164,7 @@ EOF fi # remote login ftw -/etc/init.d/ssh start >/dev/null & +service ssh start >/dev/null & echo "root:sipwise" | chpasswd ## partition disk @@ -1543,7 +1543,7 @@ if "$RETRIEVE_MGMT_CONFIG" && "$RESTART_NETWORK" ; then cp ${TARGET}/etc/hosts /etc/hosts echo 'Restarting networking' logit 'Restarting networking' - /etc/init.d/networking restart + service networking restart else # make sure we can access the management system which might be reachable # through a specific VLAN only @@ -1796,10 +1796,8 @@ EOT # make sure services are stopped . "$NGCP_SERVICES_FILE" for service in ${HA_NGCP_SERVICES} ${NGCP_SERVICES} ${NON_NGCP_SERVICES} ; do - if [ -f "${TARGET}/etc/init.d/${service}" ] ; then - echo "Stopping ${service} ..." - grml-chroot ${TARGET} "/etc/init.d/${service}" stop || true - fi + echo "Stopping ${service} ..." + grml-chroot ${TARGET} service "${service}" stop || true done # nuke files