Mail archive
alpine-aports

Re: [alpine-aports] [PATCH] main/sntpc: add cron / fix initd

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Mon, 5 Sep 2016 12:47:49 +0200

On Fri, 2 Sep 2016 15:22:46 +0000
Stuart Cardall <developer_at_it-offshore.co.uk> wrote:

> diff --git a/main/sntpc/sntpc.cron b/main/sntpc/sntpc.cron
> new file mode 100644
> index 0000000..13b18b5
> --- /dev/null
> +++ b/main/sntpc/sntpc.cron
> _at_@ -0,0 +1,6 @@
> +#!/bin/sh
> +
> +# cron job for automatic ntp updates
> +sleep $(expr $RANDOM % 7200)
> +exec /etc/init.d/sntpc restart
> +
> diff --git a/main/sntpc/sntpc.initd b/main/sntpc/sntpc.initd
> index f22af44..35ef891 100644
> --- a/main/sntpc/sntpc.initd
> +++ b/main/sntpc/sntpc.initd
> _at_@ -25,7 +25,7 @@ start() {
>
> stop() {
> ebegin "Stopping ${NAME}"
> - start-stop-daemon --stop --quiet \
> + start-stop-daemon --stop --quiet --quiet \
> --exec ${DAEMON}
> eend $?
> }


I think this is wrong. You should run sntpc as daemon not as cronjob.

To update the clock every 5 mins:

  sntpc -i 600

-nc


---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon Sep 05 2016 - 12:47:49 GMT