summaryrefslogtreecommitdiff
path: root/openntpd
diff options
context:
space:
mode:
authorAlan Mizrahi <alan+crux@mizrahi.com.ve>2016-08-15 16:14:46 +0900
committerAlan Mizrahi <alan+crux@mizrahi.com.ve>2016-08-15 16:14:46 +0900
commit465870f28f49bd193150933ff0ce192709ce1bbc (patch)
tree36274644f4b63d30323e5933a8e22a71bc12293c /openntpd
parent66db977c26ac8c6260a57b8e3190eb51f952ced2 (diff)
downloadopt-465870f28f49bd193150933ff0ce192709ce1bbc.tar.gz
opt-465870f28f49bd193150933ff0ce192709ce1bbc.tar.xz
openntpd: 5.7p4 -> 6.0p1
Diffstat (limited to 'openntpd')
-rw-r--r--openntpd/.md5sum4
-rw-r--r--openntpd/Pkgfile6
-rw-r--r--openntpd/ntpd74
3 files changed, 23 insertions, 61 deletions
diff --git a/openntpd/.md5sum b/openntpd/.md5sum
index 865d2be0f..dbe8249f4 100644
--- a/openntpd/.md5sum
+++ b/openntpd/.md5sum
@@ -1,3 +1,3 @@
-a153057cd7706ecedc4276628dfaca40 ntpd
+eaccae193775e4b1a1fd89894e42aad0 ntpd
+9388979cc2713551bfbdfb3864291abe openntpd-6.0p1.tar.gz
b4514b06835b472754573e4a549a4644 openntpd-paths.patch
-9d818a143fbc5d830203fa2f4b4c6a2a openntpd-5.7p4.tar.gz
diff --git a/openntpd/Pkgfile b/openntpd/Pkgfile
index ace99013d..72520a35d 100644
--- a/openntpd/Pkgfile
+++ b/openntpd/Pkgfile
@@ -4,10 +4,10 @@
# Packager: Matt Housh, jaeger at morpheus dot net
name=openntpd
-version=5.7p4
+version=6.0p1
release=4
source=(
-ftp://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/$name-$version.tar.gz
+http://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/$name-$version.tar.gz
ntpd
openntpd-paths.patch
)
@@ -23,7 +23,7 @@ build() {
--sysconfdir=/etc \
--localstatedir=/var \
--with-privsep-user=ntp \
- --with-cacert=/etc/ssl/cert.pem
+ --disable-https-constraint
make
make DESTDIR=$PKG install
diff --git a/openntpd/ntpd b/openntpd/ntpd
index 91d93721e..a3ce56701 100644
--- a/openntpd/ntpd
+++ b/openntpd/ntpd
@@ -1,74 +1,36 @@
-#!/bin/bash
+#!/bin/sh
+#
+# /etc/rc.d/ntpd: start/stop ntp daemon
+#
-NAME=ntpd
-USER=root
-CONFIG=
+PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+
+USER="root"
RUNDIR="/var/run/openntpd"
PIDFILE="$RUNDIR/openntpd.pid"
-STARTCMD="/usr/sbin/ntpd -s -p $PIDFILE"
-STOPCMD=
-STOPTIMEOUT=120
-
-function getpid() {
- if [ -z "$PIDFILE" ]; then
- pid="$(pgrep -xfn "$STARTCMD")"
- else
- if [ -f "$PIDFILE" ]; then
- pid=$(< $PIDFILE)
- if [ ! -d /proc/"$pid" ]; then
- echo "$NAME: removing stale pidfile $PIDFILE" >&2
- rm -f "$PIDFILE"
- unset pid
- fi
- fi
- fi
- echo "$pid"
-}
+PROG="/usr/sbin/ntpd"
+ARGS="-s -p $PIDFILE"
case $1 in
start)
- pid=$(getpid)
install -d -m 755 -o $USER $RUNDIR || exit 1
- if [ -n "$pid" ]; then
- echo "$NAME already running with pid $pid" >&2
- exit 1
- fi
- eval "$STARTCMD"
+ start-stop-daemon --start --pidfile $PIDFILE --exec $PROG -- $ARGS
;;
stop)
- pid=$(getpid)
- if [ -n "$pid" ]; then
- if [ -n "$STOPCMD" ]; then
- eval "$STOPCMD"
- else
- kill "$pid"
- fi
- t=$(printf '%(%s)T' -1)
- tend=$((t+STOPTIMEOUT))
- while [ -d /proc/$pid -a $t -lt $tend ]; do
- sleep 0.5
- t=$(printf '%(%s)T' -1)
- done
- if [ -d /proc/"$pid" ]; then
- echo "$NAME still running with pid $pid" >&2
- else
- [ -n "$PIDFILE" ] && rm -f "$PIDFILE"
- fi
- else
- echo "$NAME is not running" >&2
- fi
+ start-stop-daemon --stop --retry 60 --pidfile $PIDFILE
;;
restart)
$0 stop
$0 start
;;
status)
- pid=$(getpid)
- if [ -n "$pid" ]; then
- echo "$NAME is running with pid $pid"
- else
- echo "$NAME is not running"
- fi
+ start-stop-daemon --status --pidfile $PIDFILE
+ case $? in
+ 0) echo "$PROG running with pid: $(cat $PIDFILE)" ;;
+ 1) echo "$PROG not running, stale pidfile: $PIDFILE" ;;
+ 3) echo "$PROG not running" ;;
+ 4) echo "Unable to determine program status" ;;
+ esac
;;
*)
echo "usage: $0 [start|stop|restart|status]"

Generated by cgit