Репозитории 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: 35 55 10
# description: ntpd is the NTPv4 daemon.
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
NTPDATE=/usr/sbin/ntpdate
NTPD=/usr/sbin/ntpd
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 --lockfile "$LOCKFILE" --expect-user ntpd -- ntpd $NTPD_OPTIONS
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --lockfile "$LOCKFILE" --expect-user ntpd -- 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 -- ntpd
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status}"
RETVAL=1
esac
exit $RETVAL