summaryrefslogtreecommitdiff
path: root/source/n/ntp/rc.ntpd
diff options
context:
space:
mode:
Diffstat (limited to 'source/n/ntp/rc.ntpd')
-rw-r--r--source/n/ntp/rc.ntpd11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/n/ntp/rc.ntpd b/source/n/ntp/rc.ntpd
index 2db421f6..7cf3d50b 100644
--- a/source/n/ntp/rc.ntpd
+++ b/source/n/ntp/rc.ntpd
@@ -12,11 +12,13 @@ ntpd_start() {
# Stop ntpd:
ntpd_stop() {
echo -n "Stopping NTP daemon..."
- kill $(cat /var/run/ntpd.pid)
+ if [ -r /var/run/ntpd.pid ]; then
+ kill -HUP $(cat /var/run/ntpd.pid)
+ rm -f /var/run/ntpd.pid
+ else
+ killall -HUP -q ntpd
+ fi
echo
- sleep 1
- rm -f /var/run/ntpd.pid
- killall ntpd 2> /dev/null
}
# Restart ntpd:
@@ -32,6 +34,7 @@ ntpd_status() {
echo "ntpd is running."
else
echo "ntpd is stopped."
+ exit 1
fi
}