alterator-datetime-0.8/000075500000000000000000000000001114006535400151455ustar00rootroot00000000000000alterator-datetime-0.8/Makefile000064400000000000000000000003061114006535400166040ustar00rootroot00000000000000NAME=datetime all: clean: install: install-module install-data include /usr/share/alterator/build/module.mak install-data: install -d $(datadir)/install2 cp -a preinstall.d $(datadir)/install2 alterator-datetime-0.8/applications/000075500000000000000000000000001114006535400176335ustar00rootroot00000000000000alterator-datetime-0.8/applications/datetime.desktop000064400000000000000000000002651114006535400230250ustar00rootroot00000000000000[Desktop Entry] Type=Application Categories=X-Alterator-System Icon=datetime Terminal=false Name=Date/Time X-Alterator-URI=/datetime X-Alterator-Weight=20 X-Alterator-Help=datetime alterator-datetime-0.8/backend3/000075500000000000000000000000001114006535400166175ustar00rootroot00000000000000alterator-datetime-0.8/backend3/datetime000075500000000000000000000035011114006535400203400ustar00rootroot00000000000000#!/bin/sh alterator_api_version=1 ntpd_file=/etc/ntpd.conf datadir=/usr/share/alterator-datetime/ default_pool_file="$datadir/pools" rdelim='[[:space:]]\+' wdelim=' ' . alterator-sh-functions . shell-config read_pool() { shell_config_get "$ntpd_file" "servers" "$rdelim"|head -n1 } write_pool() { shell_config_del "$ntpd_file" "server" "$rdelim" shell_config_del "$ntpd_file" "servers" "$rdelim" shell_config_set "$ntpd_file" "servers" "$1" "$rdelim" "$wdelim" } read_runlevel() { sed -nr '/:initdefault:$/ {s,^id:([^:]+):.*,\1,;p}' /etc/inittab } on_message() { case "$in_action" in type) write_type_item ntp_pool hostname write_type_item date date write_type_item time time ;; read) #date&time write_string_param 'date' "$(date +%F)" write_string_param 'time' "$(date +%T)" #ntp write_string_param ntp_pool "$(read_pool)" ! [ "$(/usr/sbin/control ntpd)" = "server" ] write_bool_param ntp_accept "$?" local runlevel="$(read_runlevel)" ! LANG=C /sbin/chkconfig --list ntpd 2>/dev/null|fgrep -qsw "$runlevel:on" write_bool_param ntp_status "$?" ;; write) #date&time if [ -n "$in_date" -a -n "$in_time" ] && ! date --set="$in_date $in_time" 2>/dev/null >/dev/null; then write_error "`_ "unable to setup time"`" return fi #ntp [ -z "$in_ntp_pool" ] || write_pool "$in_ntp_pool" if test_bool "$in_ntp_accept";then /usr/sbin/control ntpd server >/dev/null 2>/dev/null else /usr/sbin/control ntpd client >/dev/null 2>/dev/null fi if test_bool "$in_ntp_status"; then /sbin/chkconfig ntpd on /sbin/service ntpd start >/dev/null 2>/dev/null else /sbin/chkconfig ntpd off /sbin/service ntpd condstop >/dev/null 2>/dev/null fi /sbin/service clock sync >/dev/null 2>/dev/null ;; esac } message_loop alterator-datetime-0.8/help/000075500000000000000000000000001114006535400160755ustar00rootroot00000000000000alterator-datetime-0.8/help/ru_RU/000075500000000000000000000000001114006535400171315ustar00rootroot00000000000000alterator-datetime-0.8/help/ru_RU/datetime.html000064400000000000000000000057051114006535400216220ustar00rootroot00000000000000 Дата и время

Дата и время

Системное время в Linux зависит от следующих факторов:

При запуске системы происходит активация системных часов и их синхронизация с аппаратными, кроме того, в определённых случаях учитывается значение часового пояса. При завершении работы системы происходит обратный процесс.

Аппаратные часы компьютера не идеальны, минимум раз в год придётся их «подводить». Но если у вас есть доступ к серверу точного времени, то рекомендуется им воспользоваться. Для этого достаточно отметить пункт «Получать точное время с NTP-сервера» и указать имя сервера.

В большинстве случаев вас устроит сервер pool.ntp.org. Tсть аналогичные серверы для целых регионов, например:

За более подробной информацией обращайтесь на сайт http://www.pool.ntp.org/.

Если синхронизация времени с NTP-сервером настроена, то ваш компьютер сможет сам работать как сервер точного времени. Для этого достаточно отметить соответствующий пункт «Работать как NTP-сервер».

alterator-datetime-0.8/preinstall.d/000075500000000000000000000000001114006535400175445ustar00rootroot00000000000000alterator-datetime-0.8/preinstall.d/20-datetime.sh000075500000000000000000000020311114006535400221120ustar00rootroot00000000000000#!/bin/sh -efu # ***** BEGIN LICENSE BLOCK ***** # * Copyright (C) 2007 Alexey Gladkov # * # * This program is free software; you can redistribute it and/or modify # * it under the terms of the GNU General Public License as published by # * the Free Software Foundation; either version 2 of the License, or # * (at your option) any later version. # * # * This program is distributed in the hope that it will be useful, # * but WITHOUT ANY WARRANTY; without even the implied warranty of # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # * GNU General Public License for more details. # * # * You should have received a copy of the GNU General Public License # * along with this program; if not, write to the Free Software # * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. # ***** END LICENSE BLOCK ***** . install2-init-functions [ ! -f /etc/ntpd.conf ] || cp -af /etc/ntpd.conf "$destdir/etc/" ! chkconfig --list ntpd |grep -qs '[0-9]:on' || run_chroot chkconfig ntpd on || : alterator-datetime-0.8/templates/000075500000000000000000000000001114006535400171435ustar00rootroot00000000000000alterator-datetime-0.8/templates/datetime/000075500000000000000000000000001114006535400207375ustar00rootroot00000000000000alterator-datetime-0.8/templates/datetime/index.html000064400000000000000000000027721114006535400227440ustar00rootroot00000000000000
Get time from NTP server: NTP server:
Work as NTP server

Current date: Current time:
 
alterator-datetime-0.8/ui/000075500000000000000000000000001114006535400155625ustar00rootroot00000000000000alterator-datetime-0.8/ui/datetime/000075500000000000000000000000001114006535400173565ustar00rootroot00000000000000alterator-datetime-0.8/ui/datetime/index.scm000064400000000000000000000041211114006535400211670ustar00rootroot00000000000000(document:surround "/std/frame") (define (update-datetime data) (date-set value (woo-get-option data 'date)) (time-set value (woo-get-option data 'time))) (define (write-datetime) (woo-catch/message (thunk (woo-write "/datetime" 'date (date-set value) 'time (time-set value) 'ntp_status (ntp-status value) 'ntp_accept (ntp-accept value) 'ntp_pool (ntp-pool value)) (update-datetime (woo-read-first "/datetime"))))) (gridbox columns "50;50" margin 20 (gridbox columns "50;50" colspan 2 align "left" (document:id ntp-status (checkbox text (_ "Get time from NTP server:") name "ntp_status")) (hbox (label name "ntp_pool" text (_ "NTP server:") visibility #f) (document:id ntp-pool (edit name "ntp_pool")))) (document:id ntp-accept (checkbox text (_ "Work as NTP server") widget-name "ntp_accept" name "ntp_accept")) (spacer) (separator colspan 2) (label text (_ "Current date:") align "center" name "date") (label text (_ "Current time:") align "center" name "time") (document:id date-set (dateedit expanded #t name "date")) (document:id time-set (timeedit expanded #t name "time")) (label colspan 2) (if (global 'frame:next-button) (spacer) (document:id apply-button (button text (_ "Apply") align "left" (when clicked (write-datetime))))) (spacer)) (frame:on-next (thunk (or (write-datetime) 'cancel))) (frame:on-back (thunk (or (write-datetime) 'cancel))) (effect-disable "ntp_pool" "ntp_status" #f) (effect-disable "ntp_accept" "ntp_status" #f) (effect-disable "date" "ntp_status" #t) (effect-disable "time" "ntp_status" #t) (document:root (when loaded (let ((data (woo-read-first "/datetime"))) (ntp-status value (woo-get-option data 'ntp_status)) (ntp-pool value (woo-get-option data 'ntp_pool)) (ntp-accept value (woo-get-option data 'ntp_accept)) (update-datetime data) (init-effect))))