diff options
Diffstat (limited to 'recipes-support/ntp/files/ntpd-init.patch')
-rw-r--r-- | recipes-support/ntp/files/ntpd-init.patch | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/recipes-support/ntp/files/ntpd-init.patch b/recipes-support/ntp/files/ntpd-init.patch index 41c7549..9516084 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-20 16:26:52.154738981 -0600 +--- old/ntpd 2017-02-02 18:00:38.415645575 -0600 ++++ new/ntpd 2017-02-02 19:01:39.766215168 -0600 @@ -1,6 +1,8 @@ -#! /bin/sh +#! /bin/bash @@ -51,16 +51,28 @@ diff -Naur old/ntpd new/ntpd } stopdaemon(){ echo -n "Stopping ntpd: " -@@ -34,24 +55,27 @@ +@@ -34,24 +55,38 @@ case "$1" in start) - settick +- startdaemon -g + if ! [[ $ENABLED =~ ^[yY][eE][sS]$ ]] ; then + exit 0 + fi ++ if [[ -n "$CONFIGFILE" ]] ; then ++ CONFIGOPT="-c ${CONFIGFILE}" ++ STATSDIR=$(grep "^statsdir" ${CONFIGFILE} | sed -r 's/[^[:space:]]+[[:space:]]//') ++ if ((${#STATSDIR} > 0)) && ! [[ -d ${STATSDIR} ]] ; then ++ echo Make ${STATSDIR} ++ mkdir -m 0755 -p ${STATSDIR} ++ fi ++ if [[ -d ${STATSDIR} ]] ; then ++ chown ntp:ntp ${STATSDIR} >/dev/null 2>&1 ++ fi ++ fi + settick - startdaemon -g ++ startdaemon -g $CONFIGOPT ;; stop) - stopdaemon |