From dc0a3257fc1b13fc47439e5954ed5e633d7ad2a6 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 26 Sep 2022 16:04:32 -0300 Subject: [PATCH] NTPSec --- templates/etc/init.d/ntpd.j2 | 17 +++-------------- templates/etc/ntp.conf.j2 | 1 + 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/templates/etc/init.d/ntpd.j2 b/templates/etc/init.d/ntpd.j2 index cd99913..8b7783a 100755 --- a/templates/etc/init.d/ntpd.j2 +++ b/templates/etc/init.d/ntpd.j2 @@ -1,20 +1,9 @@ #!/sbin/openrc-run -DAEMON="/usr/sbin/ntpd" -PIDFILE="/var/run/ntpd.pid" +command="/usr/sbin/ntpd" +pidfile="/var/run/ntpd.pid" +command_args="-g" depend() { need net } - -start() { - ebegin "Starting NTPSec" - start-stop-daemon --start --exec "${DAEMON}" --pidfile "${PIDFILE}" -- -g - eend $? -} - -stop() { - ebegin "Stopping NTPSec" - start-stop-daemon --stop --pidfile "${PIDFILE}" - eend $? -} diff --git a/templates/etc/ntp.conf.j2 b/templates/etc/ntp.conf.j2 index 3415167..7fb26c0 100644 --- a/templates/etc/ntp.conf.j2 +++ b/templates/etc/ntp.conf.j2 @@ -1,3 +1,4 @@ # https://gist.github.com/jauderho/2ad0d441760fc5ed69d8d4e2d6b35f8d server time.cloudflare.com nts iburst driftfile /var/lib/ntp/ntp.drift +file pidfile filename /var/run/ntpd.pid type pid