[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: NTP wont work as box is at 1980.



> On my laptop, I've added the -g switch to ntpd's startup, so the first
> time it syncs, it forcibly resets to the NTP time if that's out of
> bounds.  Doing this involved editing /etc/init.d/ntp-simple and adding
> '-- -g' to the end of the start-stop-daemon lines that start ntpd.

This is definitely the way to go but the script I am using is ntp.  Its
using start-stop-daemon, I have tried various things to pass the -g flag
across but with no avail.  I include the script below, any ideas?

Ben

#! /bin/sh
 
FLAGS="defaults 23"
 
test -f /usr/sbin/ntpd || exit 0
 
case "$1" in
        start)
                echo -n "Starting NTP server: ntpd"
                start-stop-daemon --start --quiet --exec
'/usr/sbin/ntpd'
                echo "."
                ;;
        stop)
                echo -n "Stopping NTP server: ntpd"
                start-stop-daemon --stop --quiet --exec /usr/sbin/ntpd
                echo "."
                ;;
        restart|force-reload)
                echo -n "Restarting NTP server: ntpd... "
                start-stop-daemon --stop --quiet --exec /usr/sbin/ntpd
                sleep 2
                start-stop-daemon --start --quiet --exec
'/usr/sbin/ntpd'
                echo "done."
                ;;
        *)
                echo "Usage: /etc/init.d/ntp
{start|stop|restart|force-reload}"
                exit 1
                ;;
esac
 
exit 0

-- 
****************************************************************
* Ben Edwards           Tel +44 (0)1179 553 551  ICQ 42000477  *
* Homepage - nothing of interest here   http://gurtlush.org.uk *
* Webhosting for the masses         http://www.serverone.co.uk *
* Critical Site Builder    http://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video      http://www.videonetwork.org *
* Fun corporate graphics             http://www.subvertise.org *
* Bristol Indymedia               http://bristol.indymedia.org *
* Bristol's radical news             http://www.bristle.org.uk *
****************************************************************



Reply to: