#!/bin/sh | |
touch() { | |
( : >$1 ) | |
} | |
case "$1" in | |
start) | |
# If using nfsroot, the default /var/empty/ntp is sometimes | |
# not owned by root and thus makes ntpd angry. Fix it. But | |
# only if it's not already mounted. | |
if ! touch /var/empty/ntp/junkfile 2>/dev/null; then | |
mount -t tmpfs none /var/empty/ntp | |
chmod 500 /var/empty/ntp | |
fi | |
babysit 60 ntpd -sd -w /tmp/ntp.synced 2>&1 | logos ntpd & | |
;; | |
stop) | |
pkillwait -x ntpd | |
;; | |
restart) | |
$0 stop; $0 start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
esac |