Your IP : 216.73.216.170


Current Path : /var/www/iplanru/data/www/intesco.ru/d59ed/
Upload File :
Current File : /var/www/iplanru/data/www/intesco.ru/d59ed/ntp.tar

etc/init.d/ntp000066600000003426150771265500007251 0ustar00#!/bin/sh

### 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: 
# Short-Description: Start NTP daemon
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin

. /lib/lsb/init-functions

DAEMON=/usr/sbin/ntpd
PIDFILE=/var/run/ntpd.pid

test -x $DAEMON || exit 5

if [ -r /etc/default/ntp ]; then
	. /etc/default/ntp
fi

if [ -e /var/lib/ntp/ntp.conf.dhcp ]; then
	NTPD_OPTS="$NTPD_OPTS -c /var/lib/ntp/ntp.conf.dhcp"
fi


LOCKFILE=/var/lock/ntpdate

lock_ntpdate() {
	if [ -x /usr/bin/lockfile-create ]; then
		lockfile-create $LOCKFILE
		lockfile-touch $LOCKFILE &
		LOCKTOUCHPID="$!"
	fi
}

unlock_ntpdate() {
	if [ -x /usr/bin/lockfile-create ] ; then
		kill $LOCKTOUCHPID
		lockfile-remove $LOCKFILE
	fi
}

RUNASUSER=ntp
UGID=$(getent passwd $RUNASUSER | cut -f 3,4 -d:) || true
if test "$(uname -s)" = "Linux"; then
        NTPD_OPTS="$NTPD_OPTS -u $UGID"
fi

case $1 in
	start)
		log_daemon_msg "Starting NTP server" "ntpd"
		if [ -z "$UGID" ]; then
			log_failure_msg "user \"$RUNASUSER\" does not exist"
			exit 1
		fi
		lock_ntpdate
  		start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --startas $DAEMON -- -p $PIDFILE $NTPD_OPTS
		status=$?
		unlock_ntpdate
		log_end_msg $status
  		;;
	stop)
		log_daemon_msg "Stopping NTP server" "ntpd"
  		start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
		log_end_msg $?
		rm -f $PIDFILE
  		;;
	restart|force-reload)
		$0 stop && sleep 2 && $0 start
  		;;
	try-restart)
		if $0 status >/dev/null; then
			$0 restart
		else
			exit 0
		fi
		;;
	reload)
		exit 3
		;;
	status)
		status_of_proc $DAEMON "NTP server"
		;;
	*)
		echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
		exit 2
		;;
esac
ntp.drift000066600000000006150771463730006414 0ustar000.000
etc/cron.daily/ntp000066600000002202150771466140010120 0ustar00#!/bin/sh

# The default Debian ntp.conf enables logging of various statistics to
# the /var/log/ntpstats directory.  The daemon automatically changes
# to a new datestamped set of files at midnight, so all we need to do
# is delete old ones, and compress the ones we're keeping so disk
# usage is controlled.

statsdir=$(cat /etc/ntp.conf | grep -v '^#' | sed -n 's/statsdir \([^ ][^ ]*\)/\1/p')

if [ -n "$statsdir" ] && [ -d "$statsdir" ]; then
	# only keep a week's depth of these
	find "$statsdir" -type f -mtime +7 -exec rm {} \;

	# compress whatever is left to save space
	cd "$statsdir"
	ls loopstats.???????? peerstats.???????? > /dev/null 2>&1
	if [ $? -eq 0 ]; then
		# Note that gzip won't compress the file names that
		# are hard links to the live/current files, so this
		# compresses yesterday and previous, leaving the live
		# log alone.  We supress the warnings gzip issues
		# about not compressing the linked file.
		gzip --best --quiet loopstats.???????? peerstats.???????? 
		return=$?
		case $return in
		    2)
			exit 0			# squash all warnings
			;;
		    *)
			exit $return	 	# but let real errors through
			;;
		esac
	fi
fi
etc/dhcp/dhclient-exit-hooks.d/ntp000066600000002342150772405370013104 0ustar00NTP_CONF=/etc/ntp.conf
NTP_DHCP_CONF=/var/lib/ntp/ntp.conf.dhcp


ntp_server_restart() {
	invoke-rc.d ntp try-restart
}


ntp_servers_setup_remove() {
	if [ ! -e $NTP_DHCP_CONF ]; then
		return
	fi
	rm -f $NTP_DHCP_CONF
	ntp_server_restart
}


ntp_servers_setup_add() {
	if [ -e $NTP_DHCP_CONF ] && [ "$new_ntp_servers" = "$old_ntp_servers" ]; then
		return
	fi

	if [ -z "$new_ntp_servers" ]; then
		ntp_servers_setup_remove
		return
	fi

	tmp=$(mktemp "$NTP_DHCP_CONF.XXXXXX") || return
	chmod --reference=$NTP_CONF $tmp
	chown --reference=$NTP_CONF $tmp

	(
	  echo "# This file was copied from $NTP_CONF with the server options changed"
	  echo "# to reflect the information sent by the DHCP server.  Any changes made"
	  echo "# here will be lost at the next DHCP event.  Edit $NTP_CONF instead."
	  echo
	  echo "# NTP server entries received from DHCP server"
	  for server in $new_ntp_servers; do
		echo "server $server iburst"
	  done
	  echo
	  sed -r -e '/^ *(server|peer).*$/d' $NTP_CONF
	) >>$tmp
	
	mv $tmp $NTP_DHCP_CONF

	ntp_server_restart
}


ntp_servers_setup() {
	case $reason in
		BOUND|RENEW|REBIND|REBOOT)
			ntp_servers_setup_add
			;;
		EXPIRE|FAIL|RELEASE|STOP)
			ntp_servers_setup_remove
			;;
	esac
}


ntp_servers_setup
etc/default/ntp000066600000000017150772606150007502 0ustar00NTPD_OPTS='-g'