From 49abc027832e86a0b919ea6e2ddf2fa2e24a2979 Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 20 Jan 2017 16:32:04 -0600 Subject: Use flag ENABLED in /etc/default like other MTS services --- recipes-support/ntp/files/ntpd-init.patch | 36 +++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'recipes-support/ntp') diff --git a/recipes-support/ntp/files/ntpd-init.patch b/recipes-support/ntp/files/ntpd-init.patch index 136edac..41c7549 100644 --- a/recipes-support/ntp/files/ntpd-init.patch +++ b/recipes-support/ntp/files/ntpd-init.patch @@ -1,6 +1,6 @@ diff -Naur old/ntpd new/ntpd --- old/ntpd 2017-01-17 16:26:47.427368196 -0600 -+++ new/ntpd 2017-01-17 16:32:15.366116859 -0600 ++++ new/ntpd 2017-01-20 16:26:52.154738981 -0600 @@ -1,6 +1,8 @@ -#! /bin/sh +#! /bin/bash @@ -51,13 +51,37 @@ diff -Naur old/ntpd new/ntpd } stopdaemon(){ echo -n "Stopping ntpd: " -@@ -34,6 +55,9 @@ +@@ -34,24 +55,27 @@ case "$1" in start) -+ if ((NTPD_ENABLED != 1)) ; then -+ exit 0 -+ fi - settick +- settick ++ if ! [[ $ENABLED =~ ^[yY][eE][sS]$ ]] ; then ++ exit 0 ++ fi ++ settick + startdaemon -g + ;; + stop) +- stopdaemon ++ stopdaemon + ;; + force-reload) +- stopdaemon +- settick ++ stopdaemon ++ settick startdaemon -g ;; + restart) +- # Don't reset the tick here ++ # Don't reset the tick here + stopdaemon + startdaemon -g + ;; + reload) +- # Must do this by hand, but don't do -g ++ # Must do this by hand, but don't do -g + stopdaemon + startdaemon + ;; -- cgit v1.2.3