Commit 1023c107 authored by Mike Hibler's avatar Mike Hibler

Fix the Emulab save-yer-drift path in Ubuntu 14.

Somehow I wound up out in these weeds... Tracking the drift has apparently
never been done in Ubuntu14.
parent e5757c12
......@@ -42,6 +42,7 @@ my $HISTORY = ".bash_history";
my $MAILDIR = "/var/spool/mail";
my $NTPDRIFT1 = "/etc/ntp/drift";
my $NTPDRIFT2 = "/var/lib/ntp/drift";
my $NTPDRIFT3 = "/var/lib/ntp/ntp.drift";
my $SFSUSERS = "/etc/sfs/sfs_users";
my $SFSHOSTKEY = "/etc/sfs/sfs_host_key";
my $SSHDCONFIG = "/etc/ssh/sshd_config";
......@@ -354,6 +355,9 @@ print "Resetting NTP drift ...\n";
my $driftfile = $NTPDRIFT1;
if (! -f $driftfile) {
$driftfile = $NTPDRIFT2;
if (! -f $driftfile) {
$driftfile = $NTPDRIFT3;
}
}
if (-f $driftfile) {
open(DRIFT, ">$driftfile") or
......
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2016 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -64,6 +64,7 @@ simple-install: common-install script-install bin-install
dir-install:
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/dhcp
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/init
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/init.d
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/network
$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/rsyslog.d
......@@ -97,6 +98,7 @@ sysetc-fixup:
$(INSTALL) -m 644 $(SRCDIR)/rsyslog-emulab.conf $(SYSETCDIR)/rsyslog.d/60-emulab.conf
$(INSTALL) -m 755 $(SRCDIR)/rc.local $(SYSETCDIR)/rc.local
$(INSTALL) -m 644 $(SRCDIR)/interfaces $(SYSETCDIR)/network/interfaces
$(INSTALL) -m 755 $(SRCDIR)/ntp $(SYSETCDIR)/init.d/
script-install: dir-install $(SCRIPTS)
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) script-install)
......
#!/bin/sh
### BEGIN INIT INFO
# Provides: ntp
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: Start NTP daemon
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
. /lib/lsb/init-functions
#
# Emulab specific start up script.
#
# This script replaces the standard /etc/init.d/ntp script.
# Make sure that the NTP service is enabled!
# Be sure to reinstall this script if you ever update the NTP package.
#
DAEMON=/usr/local/etc/emulab/ntpstart
RDAEMON=/usr/sbin/ntpd
PIDFILE=/var/run/ntpd.pid
test -x $DAEMON || exit 5
test -x $RDAEMON || exit 5
if [ -r /etc/default/ntp ]; then
. /etc/default/ntp
fi
if [ -e /var/lib/ntp/ntp.conf.dhcp ]; then
NTPD_OPTS="$NTPD_OPTS -c /var/lib/ntp/ntp.conf.dhcp"
fi
LOCKFILE=/var/lock/ntpdate
lock_ntpdate() {
if [ -x /usr/bin/lockfile-create ]; then
lockfile-create $LOCKFILE
lockfile-touch $LOCKFILE &
LOCKTOUCHPID="$!"
fi
}
unlock_ntpdate() {
if [ -x /usr/bin/lockfile-create ] ; then
kill $LOCKTOUCHPID
lockfile-remove $LOCKFILE
fi
}
RUNASUSER=ntp
UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true
if test "$(uname -s)" = "Linux"; then
NTPD_OPTS="$NTPD_OPTS -u $UGID"
fi
case $1 in
start)
log_daemon_msg "Starting NTP server" "ntpd"
if [ -z "$UGID" ]; then
log_failure_msg "user \"$RUNASUSER\" does not exist"
exit 1
fi
lock_ntpdate
start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- $RDAEMON -p $PIDFILE $NTPD_OPTS
status=$?
unlock_ntpdate
log_end_msg $status
;;
stop)
log_daemon_msg "Stopping NTP server" "ntpd"
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
log_end_msg $?
rm -f $PIDFILE
;;
restart|force-reload)
$0 stop && sleep 2 && $0 start
;;
try-restart)
if $0 status >/dev/null; then
$0 restart
else
exit 0
fi
;;
reload)
exit 3
;;
status)
status_of_proc $RDAEMON "NTP server"
;;
*)
echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
exit 2
;;
esac
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment