ntpdate script doesn't load configuration file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ntp (Ubuntu) |
Expired
|
Low
|
Unassigned |
Bug Description
Binary package hint: ntpdate
ntpdate script (located in /etc/network/
1) OS: Ubuntu 11.04 (natty)
2) Package version: 1:4.2.6.
3) Load configuration file
4) Configuration file isn't loaded
Solution:
Add these lines to script (/etc/network/
if [ -r /etc/default/
. /etc/default/
fi
Complete script:
#!/bin/sh
set -e
PATH=/sbin:
# This is a heuristic: The idea is that if a static interface is brought
# up, that is a major event, and we can put in some extra effort to fix
# the system time. Feel free to change this, especially if you regularly
# bring up new network interfaces.
if [ "$METHOD" = static ]; then
OPTS="-b"
fi
if [ "$METHOD" = loopback ]; then
exit 0
fi
# Check whether ntpdate was removed but not purged; it's useless to wait for
# it in that case.
if [ ! -x /usr/sbin/
exit 0
fi
if [ -r /etc/default/
. /etc/default/
fi
(
# This is for the case that /usr will be mounted later.
if [ -r /lib/udev/
. /lib/udev/
fi
LOCKFILE=
# Avoid running more than one at a time
if [ -x /usr/bin/
fi
invoke-rc.d --quiet ntp stop >/dev/null 2>&1 || true
/usr/sbin/
invoke-rc.d --quiet ntp start >/dev/null 2>&1 || true
if [ -x /usr/bin/
kill $LOCKTOUCHPID
fi
) &
Thank you for opening this bug and helping make Ubuntu better.
The /etc/network/ if-up.d/ ntpdate script *does* load the necessary configuration. This is done by the ntpdate-debian script calling within.
Can you please expand on why it did not work for you?