Репозитории ALT
S: | 4.2.8p15-alt4 |
5.1: | 4.2.4-alt5.p7 |
4.1: | 4.2.4-alt3.p4.M41.2 |
4.0: | 4.2.2-alt1.p4.3 |
3.0: | 4.1.2-alt3 |
+backports: | 4.2.4-alt0.M30.3.p4 |
Группа :: Система/Настройка/Прочее
Пакет: ntp
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
#!/bin/sh
#
# ntpd This shell script takes care of starting and stopping
# ntpd (NTPv4 daemon).
#
# chkconfig: 2345 55 10
# description: ntpd is the NTPv4 daemon.
### 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: 0 1 6
# Short-Description: Start NTP daemon
# Description: Enable NTP daemon.
### END INIT INFO
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
SourceIfNotEmpty /etc/sysconfig/network
# Source service configuration.
SourceIfNotEmpty /etc/sysconfig/ntpd
if [ ! -n "$NTPD_USER" ] ; then
NTPD_USER="ntpd"
NTPD_GROUP="ntpd"
NTPD_OPTIONS="$NTPD_OPTIONS --user=$NTPD_USER:$NTPD_GROUP"
fi
NTPDATE=/usr/sbin/ntpdate
NTPD=/usr/sbin/ntpd
PIDFILE=/var/run/ntpd.pid
LOCKFILE=/var/lock/subsys/ntpd
RETVAL=0
start()
{
is_yes "$NETWORKING" || return 0
# Adjust time to make life easy for ntpd.
if grep -qvs '^#' /etc/ntp/step-tickers; then
action $"Synchronizing with time server:" \
"$NTPDATE" -s -b -p 8 $NTPDATE_OPTIONS -u "`/bin/sed -e 's/#.*//' /etc/ntp/step-tickers`"
fi
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user "$NTPD_USER" -- ntpd -p "$PIDFILE" $NTPD_OPTIONS
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user "$NTPD_USER" -- ntpd
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
status)
status --expect-user "$NTPD_USER" -- ntpd
NTPTRACE=/usr/sbin/ntptrace
if [ -f "$NTPTRACE" ]; then
$NTPTRACE localhost
fi
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status}"
RETVAL=1
esac
exit $RETVAL