From 4b371e4ed152f4c118aa71cf99d7dc2a9ef93d0282250b3c4c83ef91183ca3e6 Mon Sep 17 00:00:00 2001 From: Marcus Rueckert Date: Tue, 11 May 2010 21:52:37 +0000 Subject: [PATCH] Accepting request 34235 from home:pbleser:Utilities Copy from home:pbleser:Utilities/chrony via accept of submit request 34235 revision 1. Request was accepted with message: reviewed ok OBS-URL: https://build.opensuse.org/request/show/34235 OBS-URL: https://build.opensuse.org/package/show/network:time/chrony?expand=0&rev=1 --- .gitattributes | 23 ++++++++ .gitignore | 1 + chrony-1.24.tar.bz2 | 3 + chrony-config.patch | 97 +++++++++++++++++++++++++++++++ chrony.init | 114 ++++++++++++++++++++++++++++++++++++ chrony.spec | 138 ++++++++++++++++++++++++++++++++++++++++++++ chrony.sysconfig | 26 +++++++++ 7 files changed, 402 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 chrony-1.24.tar.bz2 create mode 100644 chrony-config.patch create mode 100644 chrony.init create mode 100644 chrony.spec create mode 100644 chrony.sysconfig diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/chrony-1.24.tar.bz2 b/chrony-1.24.tar.bz2 new file mode 100644 index 0000000..0f771e4 --- /dev/null +++ b/chrony-1.24.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7171c4ebd88d4b8c1d2e3c0a05db93a86623f7ae8bae49cc6d7441c6468228c +size 279081 diff --git a/chrony-config.patch b/chrony-config.patch new file mode 100644 index 0000000..47e02ff --- /dev/null +++ b/chrony-config.patch @@ -0,0 +1,97 @@ +--- examples/chrony.conf.example.orig 2010-03-07 17:42:07.000000000 +0100 ++++ examples/chrony.conf.example 2010-03-07 23:59:35.000000000 +0100 +@@ -43,9 +43,45 @@ + # you can access at + # http://www.eecis.udel.edu/~mills/ntp/servers.htm. + ++server 0.pool.ntp.org ++server 1.pool.ntp.org ++server 2.pool.ntp.org ++server 3.pool.ntp.org ++ ++# for Europe: ++! server 0.europe.pool.ntp.org ++! server 1.europe.pool.ntp.org ++! server 2.europe.pool.ntp.org ++! server 3.europe.pool.ntp.org ++ ++# for Asia: ++! server 0.asia.pool.ntp.org ++! server 1.asia.pool.ntp.org ++! server 2.asia.pool.ntp.org ++! server 3.asia.pool.ntp.org ++ ++# for North America: ++! server 0.north-america.pool.ntp.org ++! server 1.north-america.pool.ntp.org ++! server 2.north-america.pool.ntp.org ++! server 3.north-america.pool.ntp.org ++ ++# for South America: ++! server 0.south-america.pool.ntp.org ++! server 1.south-america.pool.ntp.org ++! server 2.south-america.pool.ntp.org ++! server 3.south-america.pool.ntp.org ++ ++# for Oceania: ++! server 0.oceania.pool.ntp.org ++! server 1.oceania.pool.ntp.org ++! server 2.oceania.pool.ntp.org ++! server 3.oceania.pool.ntp.org ++ ++# for your own ISP (preferred): ++! server ntp.skynet.be + ! server ntp0.your-isp.com + ! server ntp1.your-isp.com +-! server ntp.public-server.org + + # However, for dial-up use you probably want these instead. The word + # 'offline' means that the server is not visible at boot time. Use +@@ -89,7 +125,7 @@ + # immediately so that it doesn't gain or lose any more time. You + # generally want this, so it is uncommented. + +-driftfile /etc/chrony.drift ++driftfile /var/lib/chrony/chrony.drift + + # If you want to use the program called chronyc to configure aspects of + # chronyd's operation once it is running (e.g. tell it the Internet link +@@ -122,14 +158,14 @@ + # Enable these two options to use this. + + ! dumponexit +-! dumpdir /var/log/chrony ++! dumpdir /var/lib/chrony + + # chronyd writes its process ID to a file. If you try to start a second + # copy of chronyd, it will detect that the process named in the file is + # still running and bail out. If you want to change the path to the PID + # file, uncomment this line and edit it. The default path is shown. + +-! pidfile /var/run/chronyd.pid ++pidfile /var/run/chronyd.pid + + ####################################################################### + ### INITIAL CLOCK CORRECTION +@@ -153,8 +189,8 @@ + # produce some graphs of your system's timekeeping performance, or you + # need help in debugging a problem. + +-! logdir /var/log/chrony +-! log measurements statistics tracking ++logdir /var/log/chrony ++log measurements statistics tracking + + # If you have real time clock support enabled (see below), you might want + # this line instead: +--- examples/chrony.keys.example.orig 2010-03-07 17:41:49.000000000 +0100 ++++ examples/chrony.keys.example 2010-03-07 17:42:01.000000000 +0100 +@@ -12,7 +12,7 @@ + ####################################################################### + # A valid key line looks like this + +-1 a_key ++1 change_me_to_a_secret + + # It must consist of an integer, followed by whitespace, followed by a block of + # text with no spaces in it. (You cannot put a space in a key). If you wanted diff --git a/chrony.init b/chrony.init new file mode 100644 index 0000000..3eb0df5 --- /dev/null +++ b/chrony.init @@ -0,0 +1,114 @@ +#!/bin/sh +# +# openSUSE system startup script for chronyd +# Copyright (C) 2010 Pascal Bleser +# +# This library is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or (at +# your option) any later version. +# +# This library 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 +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, +# USA. +# +# /etc/init.d/chronyd +# and its symbolic link +# /usr/sbin/rcchronyd +# +### BEGIN INIT INFO +# Provides: chronyd +# Required-Start: $syslog $remote_fs $network $time +# Should-Start: $time ypbind +# Required-Stop: $syslog $remote_fs $network $time +# Should-Stop: ypbind +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: Chrony daemon providing system clock synchronization +# Description: Start the chrony daemon to manage the system clock +### END INIT INFO + +SERVICE=chronyd + +# Check for missing binaries (stale symlinks should not happen) +# Note: Special treatment of stop for LSB conformance +CHRONYD_BIN=/usr/sbin/FOO +test -x "$CHRONYD_BIN" || { echo "$CHRONYD_BIN not installed"; + if [ "$1" = "stop" ]; then exit 0; + else exit 5; fi; } + +# Check for existence of needed config file and read it +CHRONYD_CONFIG="/etc/sysconfig/chronyd" +test -r "$CHRONYD_CONFIG" || { echo "$CHRONYD_CONFIG not existing"; + if [ "$1" = "stop" ]; then exit 0; + else exit 6; fi; } + +# Read config +. "$CHRONYD_CONFIG" + +CHRONYD_USER=chrony + +. /etc/rc.status +rc_reset # Reset status of this service + +case "$1" in + start) + CHRONY_OPTIONS="" + [ "$CHRONY_IPV4" = "yes" -a "$CHRONY_IPV6" = "no" ] && CHRONY_OPTIONS="$CHRONY_OPTIONS -4" + [ "$CHRONY_IPV4" = "no" -a "$CHRONY_IPV6" = "yes" ] && CHRONY_OPTIONS="$CHRONY_OPTIONS -6" + [ "$CHRONY_LOCK_IN_RAM" = "yes" ] && CHRONY_OPTIONS="$CHRONY_OPTIONS -m" + echo -n "Starting $SERVICE " + /sbin/startproc "$CHRONYD_BIN" -u "$CHRONYD_USER" $CHRONY_OPTIONS + rc_status -v + ;; + stop) + echo -n "Shutting down $SERVICE " + /sbin/killproc -TERM "$CHRONYD_BIN" + rc_status -v + ;; + try-restart|condrestart) + if test "$1" = "condrestart"; then + echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" + fi + $0 status + if test $? = 0; then + $0 restart + else + rc_reset # Not running is not a failure. + fi + rc_status + ;; + restart) + $0 stop + $0 start + rc_status + ;; + force-reload) + echo -n "Reload service $SERVICE " + $0 try-restart + rc_status + ;; + reload) + rc_failed 3 + rc_status -v + ;; + status) + echo -n "Checking for service $SERVICE " + /sbin/checkproc "$CHRONYD_BIN" + rc_status -v + ;; + probe) + test /etc/chronyd.conf -nt /var/run/chronyd.pid && echo reload + ;; + *) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" + exit 1 + ;; +esac +rc_exit diff --git a/chrony.spec b/chrony.spec new file mode 100644 index 0000000..0659135 --- /dev/null +++ b/chrony.spec @@ -0,0 +1,138 @@ +# norootforbuild + +Name: chrony +Version: 1.24 +Release: 0 +Summary: System Clock Synchronization Client and Server +# http://download.tuxfamily.org/chrony/chrony-%{version}.tar.gz +Source: chrony-%{version}.tar.bz2 +Source1: chrony.init +Source2: chrony.sysconfig +Patch1: chrony-config.patch +URL: http://chrony.tuxfamily.org/ +Group: Productivity/Networking/Other +License: GNU General Public License version 2 or later (GPL v2 or later) +BuildRoot: %{_tmppath}/build-%{name}-%{version} +BuildRequires: texinfo +BuildRequires: readline-devel +BuildRequires: libcap-devel +BuildRequires: ncurses-devel +BuildRequires: gcc make glibc-devel +%if 0%{?suse_version} >= 1030 +BuildRequires: licenses +Requires: licenses +%endif +PreReq: %install_info_prereq +PreReq: %fillup_prereq +PreReq: %insserv_prereq +PreReq: /usr/sbin/groupadd +PreReq: /usr/sbin/useradd + +%description +Chrony is a pair of programs which are used to maintain the accuracy of the +system clock on a computer. The two programs are called chronyd and chronyc. + +Chronyd is a daemon which runs in background on the system. It obtains +measurements via the network of the system clock’s offset relative to time +servers on other systems and adjusts the system time accordingly. For isolated +systems, the user can periodically enter the correct time by hand (using +Chronyc). In either case, Chronyd determines the rate at which the computer +gains or loses time, and compensates for this. Chronyd implements the NTP +protocol and can act as either a client or a server. + +Chronyc provides a user interface to Chronyd for monitoring its performance and +configuring various settings. It can do so while running on the same computer +as the Chronyd instance it is controlling or a different computer. + +%prep +%setup -q +%patch1 + +%build +# not autoconf: +./configure \ + --prefix="%{_prefix}" \ + --exec-prefix="%{_exec_prefix}" \ + --sysconfdir="%{_sysconfdir}" \ + --bindir="%{_bindir}" \ + --sbindir="%{_sbindir}" \ + --datarootdir="%{_datadir}" \ + --infodir="%{_infodir}" \ + --mandir="%{_mandir}" \ + --docdir="%{_docdir}/%{name}" + +%__make %{?jobs:-j%{jobs}} \ + CC="%__cc" \ + CFLAGS="%{optflags} -Wall" \ + prefix="%{_prefix}" + +%__make chrony.txt prefix="%{_prefix}" +%__make chrony.info prefix="%{_prefix}" + +%install +%makeinstall +%__rm -rf "%{buildroot}%{_docdir}/%{name}" + +%__install -d "%{buildroot}%{_infodir}" +%__install -m0644 chrony.info "%{buildroot}%{_infodir}"/ + +%__install -D -m0755 "%{SOURCE1}" "%{buildroot}/etc/init.d/chronyd" +%__install -d "%{buildroot}/usr/sbin" +%__ln_s ../../etc/init.d/chronyd "%{buildroot}/usr/sbin/rcchronyd" + +%__install -D -m0644 "%{SOURCE2}" "%{buildroot}%{_var}/adm/fillup-templates/sysconfig.chronyd" + +%__install -d "%{buildroot}%{_var}/lib/chrony" +%__install -d "%{buildroot}%{_var}/log/chrony" + +h=/usr/share/doc/licenses/md5/$(md5sum COPYING|cut -f1 -d" ") +test -e "$h" && %__ln_s -f "$h" . + +%__install -d "%{buildroot}%{_sysconfdir}" +%__install -m0644 examples/chrony.conf.example "%{buildroot}%{_sysconfdir}/chrony.conf" +%__install -m0600 examples/chrony.keys.example "%{buildroot}%{_sysconfdir}/chrony.keys" + +%pre +/usr/sbin/groupadd -r chrony || : +/usr/sbin/useradd -r -g chrony -c "Chrony Daemon" -d "%{_var}/lib/chrony" chrony || : + +%post +%{fillup_only -an chronyd} +%install_info --info-dir="%{_infodir}" "%{_infodir}/chrony.info%{ext_info}" + +%preun +%stop_on_removal chronyd + +%postun +%restart_on_update chronyd +%insserv_cleanup +%install_info_delete --info-dir="%{_infodir}" "%{_infodir}/chrony.info%{ext_info}" + +%clean +%__rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +%doc README chrony.txt COPYING +%doc examples +%config(noreplace) %{_sysconfdir}/chrony.conf +%config(noreplace) %{_sysconfdir}/chrony.keys +%{_bindir}/chronyc +%{_sbindir}/chronyd +%doc %{_mandir}/man1/chrony.1%{ext_man} +%doc %{_mandir}/man1/chronyc.1%{ext_man} +%doc %{_mandir}/man5/chrony.conf.5%{ext_man} +%doc %{_mandir}/man8/chronyd.8%{ext_man} +%doc %{_infodir}/chrony.info%{ext_info} +%config /etc/init.d/chronyd +/usr/sbin/rcchronyd +%{_var}/adm/fillup-templates/sysconfig.chronyd +%attr(0750,chrony,chrony) %{_var}/lib/chrony +%attr(0750,chrony,chrony) %{_var}/log/chrony + +%changelog +# vim: set sw=3 ts=3 noet: +# Local Variables: +# mode: rpm-spec +# tab-width: 3 +# End: diff --git a/chrony.sysconfig b/chrony.sysconfig new file mode 100644 index 0000000..689c7e3 --- /dev/null +++ b/chrony.sysconfig @@ -0,0 +1,26 @@ +## Path: Network/Chrony +## Description: Chrony time synchronization settings +## Type: yesno +## Default: "yes" +## ServiceRestart: chronyd +# +# Resolve hostnames with IPv4 +# +CHRONY_IPV4="yes" + +## Type: yesno +## Default: "yes" +## ServiceRestart: chronyd +# +# Resolve hostnames with IPv6 +# +CHRONY_IPV6="yes" + +## Type: yesno +## Default: "yes" +## ServiceRestart: chronyd +# +# Lock the chrony daemon process into RAM, preventing it from swapping out +# +CHRONY_LOCK_IN_RAM="no" +