<div dir="ltr">I noticed there wasn't a step-tickers in the init script. I wonder if it's builtin to the daemon start. step-tickers is meant to do the initial time set to avoid the starting with too far out of date bit.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 5, 2015 at 12:37 PM, der.hans <span dir="ltr"><<a href="mailto:PLUGd@lufthans.com" target="_blank">PLUGd@lufthans.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 04. Sep, 2015 schwätzte Tejeev Patel so:<br>
<br>
moin moin TJ,<br>
<br>
what James said in regards to debugging ntp :).<br>
<br>
Here are some other things to check.<br>
<br>
Is there some ntp process already running?<br>
<br>
ps auxw | grep ntp<br>
<br>
Is there a config file in /etc/default/ that has an entry to not start<br>
ntp?<br>
<br>
Is ntpdate installed and configured to prevent ntpd from starting?<br>
<br>
As James mentioned, ntp will refuse to change the time if it's off too<br>
much. Check to see if the systems are within a couple of minutes of the<br>
actual time.<br>
<br>
Verify your hardware clock is set to UTC.<br>
<br>
Make sure your OS is set at the proper offset from UTC, e.g. you're set to<br>
now and AZ time zone, rather than now and eastern time zone.<br>
<br>
If the boxen are servers they should be set to UTC. Star date blah, blah,<br>
blah and all that.<br>
<br>
cioa,<br>
<br>
der.hans<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
I've got all of my servers running ntp to sync time, and though most are<br>
running fine without a hitch, I seem to have an issue where for some reason<br>
the service just doesn't start on some of them. Same install procedure on<br>
all servers. No errors in syslog or ntp for days, even when server has<br>
been rebooted in that time.<br>
The service just isn't running and I don't know why. I've included the<br>
ntp.conf and the init script below.<br>
<br>
Any help would be appreciated.<br>
<br>
Thanks,<br>
TJ<br>
<br>
##############################################################################################<br></span>
*ntp.conf*<div><div class="h5"><br>
##############################################################################################<br>
<br>
# This file has been modified by adding our two ntp servers. commenting out<br>
all the pool servers<br>
# and redirecting ntp logs to an ntp logfile. File is distributed via<br>
# cp.get_file salt command and then the ntp service is restarted via a<br>
cmd.run<br>
# -TJ 2015/08/14<br>
<br>
<br>
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help<br>
driftfile /var/lib/ntp/ntp.drift<br>
logfile /var/log/ntpd.log<br>
<br>
# Enable this if you want statistics to be logged.<br>
#statsdir /var/log/ntpstats/<br>
<br>
statistics loopstats peerstats clockstats<br>
filegen loopstats file loopstats type day enable<br>
filegen peerstats file peerstats type day enable<br>
filegen clockstats file clockstats type day enable<br>
<br>
# You do need to talk to an NTP server or two (or three).<br>
#server 67.40.67.44 iburst<br>
<br>
# <a href="http://pool.ntp.org" rel="noreferrer" target="_blank">pool.ntp.org</a> maps to about 1000 low-stratum NTP servers. Your server will<br>
# pick a different set every time it starts up. Please consider joining the<br>
# pool: <<a href="http://www.pool.ntp.org/join.html" rel="noreferrer" target="_blank">http://www.pool.ntp.org/join.html</a>><br>
#server <a href="http://0.debian.pool.ntp.org" rel="noreferrer" target="_blank">0.debian.pool.ntp.org</a> iburst dynamic<br>
#server <a href="http://1.debian.pool.ntp.org" rel="noreferrer" target="_blank">1.debian.pool.ntp.org</a> iburst dynamic<br>
#server <a href="http://2.debian.pool.ntp.org" rel="noreferrer" target="_blank">2.debian.pool.ntp.org</a> iburst dynamic<br>
#server <a href="http://3.debian.pool.ntp.org" rel="noreferrer" target="_blank">3.debian.pool.ntp.org</a> iburst dynamic<br>
<br></div></div>
server *[Our central ntp server ip] *dynamic prefer<br>
server *[Our backup ntp server ip] *dynamic<div><div class="h5"><br>
<br>
<br>
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html<br>
for<br>
# details. The web page <<br>
<a href="http://support.ntp.org/bin/view/Support/AccessRestrictions" rel="noreferrer" target="_blank">http://support.ntp.org/bin/view/Support/AccessRestrictions</a>><br>
# might also be helpful.<br>
#<br>
# Note that "restrict" applies to both servers and clients, so a<br>
configuration<br>
# that might be intended to block requests from certain clients could also<br>
end<br>
# up blocking replies from your own upstream servers.<br>
# By default, exchange time with everybody, but don't allow configuration.<br>
restrict -4 default kod notrap nomodify nopeer noquery<br>
restrict -6 default kod notrap nomodify nopeer noquery<br>
<br>
# Local users may interrogate the ntp server more closely.<br>
restrict 127.0.0.1<br>
restrict ::1<br>
<br>
# Clients from this (example!) subnet have unlimited access, but only if<br>
# cryptographically authenticated.<br>
#restrict 192.168.123.0 mask 255.255.255.0 notrust<br>
<br>
# If you want to provide time to your local subnet, change the next line.<br>
# (Again, the address is an example only.)<br>
#broadcast 192.168.123.255<br>
<br>
# If you want to listen to time broadcasts on your local subnet, de-comment<br>
the<br>
# next lines. Please do this only if you trust everybody on the network!<br>
#disable auth<br>
#broadcastclient<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
##############################################################################################<br></div></div>
*init.d/ntp*<div><div class="h5"><br>
##############################################################################################<br>
<br>
GNU nano 2.2.6 File:<br>
/etc/init.d/ntp<br>
<br>
<br>
#!/bin/sh<br>
<br>
### BEGIN INIT INFO<br>
# Provides: ntp<br>
# Required-Start: $network $remote_fs $syslog<br>
# Required-Stop: $network $remote_fs $syslog<br>
# Default-Start: 2 3 4 5<br>
# Default-Stop:<br>
# Short-Description: Start NTP daemon<br>
### END INIT INFO<br>
<br>
PATH=/sbin:/bin:/usr/sbin:/usr/bin<br>
<br>
. /lib/lsb/init-functions<br>
<br>
DAEMON=/usr/sbin/ntpd<br>
PIDFILE=/var/run/ntpd.pid<br>
<br>
test -x $DAEMON || exit 5<br>
<br>
if [ -r /etc/default/ntp ]; then<br>
. /etc/default/ntp<br>
fi<br>
<br>
if [ -e /var/lib/ntp/ntp.conf.dhcp ]; then<br>
NTPD_OPTS="$NTPD_OPTS -c /var/lib/ntp/ntp.conf.dhcp"<br>
fi<br>
<br>
<br>
LOCKFILE=/var/lock/ntpdate<br>
<br>
lock_ntpdate() {<br>
if [ -x /usr/bin/lockfile-create ]; then<br>
lockfile-create $LOCKFILE<br>
lockfile-touch $LOCKFILE &<br>
LOCKTOUCHPID="$!"<br>
fi<br>
}<br>
<br>
unlock_ntpdate() {<br>
if [ -x /usr/bin/lockfile-create ] ; then<br>
kill $LOCKTOUCHPID<br>
lockfile-remove $LOCKFILE<br>
fi<br>
}<br>
<br>
RUNASUSER=ntp<br>
UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true<br>
if test "$(uname -s)" = "Linux"; then<br>
NTPD_OPTS="$NTPD_OPTS -u $UGID"<br>
fi<br>
<br>
case $1 in<br>
start)<br>
log_daemon_msg "Starting NTP server" "ntpd"<br>
if [ -z "$UGID" ]; then<br>
log_failure_msg "user \"$RUNASUSER\" does not exist"<br>
exit 1<br>
fi<br>
lock_ntpdate<br>
start-stop-daemon --start --quiet --oknodo --pidfile<br>
$PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS<br>
status=$?<br>
unlock_ntpdate<br>
log_end_msg $status<br>
;;<br>
stop)<br>
log_daemon_msg "Stopping NTP server" "ntpd"<br>
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE<br>
log_end_msg $?<br>
rm -f $PIDFILE<br>
;;<br>
restart|force-reload)<br>
$0 stop && sleep 2 && $0 start<br>
;;<br>
try-restart)<br>
if $0 status >/dev/null; then<br>
$0 restart<br>
else<br>
exit 0<br>
fi<br>
;;<br>
reload)<br>
exit 3<br>
;;<br>
status)<br>
status_of_proc $DAEMON "NTP server"<br>
;;<br>
*)<br>
echo "Usage: $0<br>
{start|stop|restart|try-restart|force-reload|status}"<br>
exit 2<br>
;;<br>
esac<br>
<br>
</div></div></blockquote><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
# <a href="http://www.LuftHans.com/" rel="noreferrer" target="_blank">http://www.LuftHans.com/</a> <a href="http://www.PhxLinux.org/" rel="noreferrer" target="_blank">http://www.PhxLinux.org/</a><br>
# "The Constitution is not an instrument for the government to restrain the<br>
# people, it is an instrument for the people to restrain the government -<br>
# lest it come to dominate our lives and interests." -- Patrick Henry</font></span><br>---------------------------------------------------<br>
PLUG-discuss mailing list - <a href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br>
To subscribe, unsubscribe, or to change your mail settings:<br>
<a href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" rel="noreferrer" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">James McPhee<br><a href="mailto:jmcphe@gmail.com" target="_blank">jmcphe@gmail.com</a></div>
</div>