Hello community,

here is the log from the commit of package ntp for openSUSE:Factory checked in 
at 2014-04-05 14:43:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ntp (Old)
 and      /work/SRC/openSUSE:Factory/.ntp.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ntp"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ntp/ntp.changes  2014-02-15 17:17:28.000000000 
+0100
+++ /work/SRC/openSUSE:Factory/.ntp.new/ntp.changes     2014-04-05 
14:43:05.000000000 +0200
@@ -1,0 +2,33 @@
+Thu Apr  3 07:05:40 UTC 2014 - [email protected]
+
+- Remove empty insserv call whic hhad only caused an error message
+- Correct 50-ntp.list to include ntpd.service 
+
+-------------------------------------------------------------------
+Mon Mar 31 13:32:26 UTC 2014 - [email protected]
+
+- Restart nptd if failed or aborted (FATE#315133) 
+
+-------------------------------------------------------------------
+Thu Mar 27 18:07:16 UTC 2014 - [email protected]
+
+- Service unit files are no executables 
+
+-------------------------------------------------------------------
+Thu Mar 27 17:44:48 UTC 2014 - [email protected]
+
+- Use correct ntp-wait script from source tar ball (bnc#864193)
+- Implement new ntp-wait.service to provide time-sync.target
+- A few cleanups on the new start script of ntpd
+
+-------------------------------------------------------------------
+Thu Mar 27 10:38:23 CET 2014 - [email protected]
+
+- Add missing systemd %pre macro
+
+-------------------------------------------------------------------
+Tue Mar  4 10:57:57 UTC 2014 - [email protected]
+
+- Add systemd configuration and start script
+
+-------------------------------------------------------------------

Old:
----
  conf.ntp.init
  ntp-wait

New:
----
  conf.ntp-wait.service
  conf.ntpd.service
  conf.start-ntpd

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ntp.spec ++++++
--- /var/tmp/diff_new_pack.HHcs2y/_old  2014-04-05 14:43:06.000000000 +0200
+++ /var/tmp/diff_new_pack.HHcs2y/_new  2014-04-05 14:43:06.000000000 +0200
@@ -27,6 +27,14 @@
 BuildRequires:  readline-devel
 # to allow the postinst script to succeed
 BuildRequires:  pwdutils
+%if 0%{?suse_version} >= 1140
+BuildRequires:  pkgconfig(systemd)
+%{?systemd_requires}
+%if %{undefined _ntpunitsdir}
+%global _ntpunitsdir /usr/lib/systemd/ntp-units.d
+%endif
+%endif
+
 %define ntpfaqversion 3.4
 Url:            http://www.ntp.org/
 Version:        4.2.6p5
@@ -39,18 +47,19 @@
 # configuration
 Source1:        conf.logrotate.ntp
 Source2:        conf.ntp.conf
-Source3:        conf.ntp.init
+Source3:        conf.ntpd.service
 Source4:        conf.sysconfig.ntp
 Source5:        conf.sysconfig.syslog-ntp
 Source6:        conf.ntp.reg
 Source7:        %name.firewall
+Source8:        conf.start-ntpd
+Source9:        conf.ntp-wait.service
 # documentation
 Source10:       NTP-FAQ-%{ntpfaqversion}.tar.bz2
 Source11:       ntp.1.gz
 Source12:       README.SUSE
 Source13:       ntp-4.2.7-rh-manpages.tar.gz
 Source14:       ntp.xml
-Source16:       ntp-wait
 Patch1:         ntp-segfault_on_invalid_device.patch
 Patch4:         ntpd-maxmonmen.patch
 Patch10:        ntp-strcat.patch
@@ -68,7 +77,7 @@
 Obsoletes:      xntp <= 4.2.4p5
 Obsoletes:      xntp3
 Conflicts:      openntpd
-PreReq:         pwdutils %insserv_prereq  %fillup_prereq /usr/bin/diff 
/usr/bin/grep /sbin/chkconfig
+PreReq:         pwdutils %fillup_prereq /usr/bin/diff /usr/bin/grep 
/sbin/chkconfig
 Suggests:       logrotate
 Requires:       timezone
 
@@ -264,9 +273,10 @@
 #
 # boot scripts
 #
-%__install -D %{S:3} %{buildroot}/etc/init.d/ntp
+%__install -m 0644 -D %{S:3} %{buildroot}/%{_unitdir}/ntpd.service
+%__install -m 0644 -D %{S:9} %{buildroot}/%{_unitdir}/ntp-wait.service
 %__install -d %{buildroot}/usr/sbin
-ln -s ../../etc/init.d/ntp %{buildroot}/usr/sbin/rcntp
+%__install -m 755 -D %{S:8} %{buildroot}/usr/sbin/start-ntpd
 #
 # fillup sysconfig.ntp
 #
@@ -297,7 +307,12 @@
 #
 install -d %{buildroot}/usr/share/omc/svcinfo.d/
 install -m 644 %{S:14} %{buildroot}/usr/share/omc/svcinfo.d/
-install -m 755 %{S:16} %{buildroot}/usr/sbin/
+install -m 755 scripts/ntp-wait %{buildroot}/usr/sbin/
+
+%if %{defined _ntpunitsdir}
+%__install -d %{buildroot}%{_ntpunitsdir}
+echo ntpd.service > %{buildroot}%{_ntpunitsdir}/50-ntp.list
+%endif
 
 %clean
 %__rm -rf %{buildroot}
@@ -307,9 +322,13 @@
 /usr/sbin/useradd -r -o -g ntp -u 74 -s /bin/false -c "NTP daemon" -d 
/var/lib/ntp ntp 2> /dev/null || :
 /usr/sbin/usermod -g ntp ntp 2>/dev/null || :
 test -L /var/run/ntp  || rm -rf /var/run/ntp && :
+%service_add_pre ntpd.service
+%service_add_pre ntp-wait.service
 
 %preun
-%stop_on_removal ntp
+%service_del_preun ntpd.service
+%service_del_preun ntp-wait.service
+
 # no update? Then remove these files that aren't owned by the package
 if [ ${FIRST_ARG:-0} -eq 0 ]; then
      test -e /var/lib/ntp/drift/ntp.drift  && rm -f 
/var/lib/ntp/drift/ntp.drift
@@ -349,26 +368,29 @@
 if [ -f /var/lib/ntp/etc/ntp.conf.iburst ]; then
   chown --from=ntp:root root:ntp /var/lib/ntp/etc/ntp.conf.iburst
 fi
-if /sbin/chkconfig -c ntpd 3 ; then
-       %{insserv_force_if_yast ntp}
-fi
 %{fillup_only -n ntp }
 %{fillup_only -n syslog }
 if [ ! -f /var/log/ntp ]; then
        touch /var/log/ntp
        chmod 644 /var/log/ntp
 fi
+%service_add_post ntpd.service
+%service_add_post ntp-wait.service
 
 %postun
-%restart_on_update ntp
-%{insserv_cleanup}
+%service_del_postun ntpd.service
+%service_del_postun ntp-wait.service
 
 %files
 %defattr(-,root,root)
 %doc COPYRIGHT ChangeLog NEWS README* TODO WHERE-TO-START conf 
 %attr(0640,root,ntp) %config(noreplace) %{_sysconfdir}/ntp.conf
 %dir %{_sysconfdir}/slp.reg.d
-%{_sysconfdir}/init.d/ntp
+%{_unitdir}/ntpd.service
+%{_unitdir}/ntp-wait.service
+%if %{defined _ntpunitsdir}
+%{_ntpunitsdir}/50-ntp.list
+%endif
 %config(noreplace) %{_sysconfdir}/slp.reg.d/ntp.reg
 %config %{_sysconfdir}/logrotate.d/ntp
 %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/ntp

++++++ conf.ntp-wait.service ++++++
[Unit]
Description=Wait for ntpd to synchronize system clock
Requires=ntpd.service
After=ntpd.service

Wants=time-sync.target
Before=time-sync.target

[Service]
Type=oneshot
ExecStart=/usr/sbin/ntp-wait -s 0.2 -n 30000
RemainAfterExit=yes
StandardOutput=null

[Install]
WantedBy=multi-user.target
++++++ conf.ntpd.service ++++++
[Unit]
Description=NTP Server Daemon
Documentation=man:ntpd(1)
After=nss-lookup.target

Wants=network.target
After=network.target

[Service]
Type=forking
PIDFile=/var/run/ntp/ntpd.pid
ExecStart=/usr/sbin/start-ntpd start
RestartSec=11min
Restart=always

[Install]
WantedBy=multi-user.target
++++++ conf.start-ntpd ++++++
#! /bin/sh
# Copyright (c) 1995-2014 SuSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Peter Varkoly

# set default options
NTP_CONF="/etc/ntp.conf"
if [ ! -f ${NTP_CONF} ]; then
  echo -n "Time server configuration file, ${NTP_CONF} does not exist."
  exit 6
fi

NTPD_BIN="/usr/sbin/ntpd"
if [ ! -x ${NTPD_BIN} ]; then
  echo -n "Time server, ${NTPD_BIN} not installed!"
  exit 5
fi

NTPD_OPTIONS="-g -u ntp:ntp"
NTPD_RUN_CHROOTED="yes"

NTPDC_BIN="/usr/sbin/ntpdc"

NTP_KEYS=$(awk '/^keys/ { print $2 }' $NTP_CONF)
NTP_KEYID=$(awk '/^requestkey[[:blank:]]/ { print $2 }' $NTP_CONF)
NTP_PASSWD=$(test -n "$NTP_KEYS" -a -n "$NTP_KEYID" -a -r "$NTP_KEYS" && awk 
'$0 ~ key { print $3 }' key="^[[:blank:]]*$NTP_KEYID[[:blank:]]" $NTP_KEYS)

if [ -n "$NTP_KEYS" ]; then
  if test -z "$NTP_KEYID"; then
    echo -n "NTP key id not defined"
      exit 5
  fi
  if test -z "$NTP_PASSWD"; then
    echo -n "No password for requestkey set"
    exit 1
  fi
fi

# Override defaults, if we have the sysconfig file
test -f /etc/sysconfig/ntp && . /etc/sysconfig/ntp

function update_cmos() { return 0; }
# Now see if we have to fix the CMOS clock
if [ "$NTPD_FORCE_SYNC_ON_STARTUP" = yes -a "$1" = ntptimeset ] ; then
  test -f /etc/sysconfig/clock && . /etc/sysconfig/clock
  if test -r /proc/xen/capabilities ; then
    read -t1 caps < /proc/xen/capabilities
    test "$caps" = "${caps%control_d*}" && NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=no
  fi
  case "$(uname -i)" in
  s390*) NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=no
  esac
  if [ "$NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP" = yes ] ; then
    function update_cmos() {
      if test -e /dev/rtc ; then
        /sbin/hwclock --systohc $HWCLOCK
        return $?
      fi
      if test -z "$(/sbin/modprobe -l rtc_cmos)" ; then
        /sbin/hwclock --systohc $HWCLOCK
        return $?
      fi
      local temprules=/dev/.udev/rules.d
      local uevseqnum=/sys/kernel/uevent_seqnum
      local rule=$temprules/95-rtc-cmos.rules
      local -i start=0 end=0
      /bin/mkdir -m 0755 -p $temprules
      echo ACTION==\"add\", KERNEL==\"rtc0\", RUN=\"/sbin/hwclock --systohc 
$HWCLOCK --rtc=\$env{DEVNAME}\" > $rule
      test -e $uevseqnum && read -t 1 start < $uevseqnum
      if /sbin/modprobe -q rtc_cmos ; then
        test -e $uevseqnum && read -t 1 end < $uevseqnum
        if test $start -lt $end ; then
          /sbin/udevadm settle --quiet --seq-start=$start --seq-end=$end
        else
          /sbin/udevadm settle --quiet
        fi
      else
        rm -f $rule
        /sbin/hwclock --systohc $HWCLOCK
      fi
    }
  fi
fi

# set Default CHROOT path if not set but wanted
test "${NTPD_RUN_CHROOTED}" = "yes" && \
  CHROOT_PREFIX="/var/lib/ntp" || \
  CHROOT_PREFIX=""

# set default PID variables
NTPD_PID="${CHROOT_PREFIX}/var/run/ntp/ntpd.pid"

# Create if /var/run is on tmpfs
test -e /var/run/ntp || ln -s /var/lib/ntp/var/run/ntp /var/run

function ntpd_is_running() {
  $0 status >/dev/null
}

function parse_symlink() {
  if [ -c "$NTP_PARSE_DEVICE" ]; then
    if [ -n "$NTP_PARSE_LINK" ]; then
    ln -sf $NTP_PARSE_DEVICE $NTP_PARSE_LINK
    fi
  fi
}

function prepare_chroot() {
  for configfile in /etc/{localtime,ntp.keys} $NTP_CONF $NTPD_CHROOT_FILES; do
    test -d ${CHROOT_PREFIX}${configfile%/*} || mkdir -p 
${CHROOT_PREFIX}${configfile%/*}
    if [ -r ${configfile} ]
    then
        cp -aL ${configfile} ${CHROOT_PREFIX}${configfile%/*}
    else
        echo
        echo "Warning: ${configfile} not found or not readable"
    fi
  done
  mkdir -p ${CHROOT_PREFIX}/var/log
  mkdir -p ${CHROOT_PREFIX}/proc
  mount -t proc none -o ro,nosuid,nodev "${CHROOT_PREFIX}/proc" 2>/dev/null
  NTPD_OPTIONS="${NTPD_OPTIONS} -i ${CHROOT_PREFIX}"
}

function runtime_configuration() {
  for f in /var/run/ntp/servers*; do
    if [ -r ${f} ]; then
      . ${f}
      ntp_server="${ntp_server} ${RUNTIME_SERVERS}"
    fi
  done
  if [ -n "${ntp_server}" ]; then
    for s in ${ntp_server}; do
      add_runtime_server ${s}
    done
  fi
}

function add_runtime_server() {
  /usr/sbin/sntp -s $@
  NTPC_CMD="keyid $NTP_KEYID\npasswd $NTP_PASSWD\naddserver $@\n"
  NTPDC_LOG=$(echo -e "${NTPC_CMD}quit" | $NTPDC_BIN)
  logger -t $0 "runtime configuration: $NTPDC_LOG"
}

function reloaddevices {
  NTPC_CMD="keyid $NTP_KEYID\npasswd $NTP_PASSWD\nifreload\n"
  NTPDC_LOG=$(echo -e "${NTPC_CMD}quit" | $NTPDC_BIN)
  logger -t $0 "runtime configuration: $NTPDC_LOG"
}

function get_ntpd_ip_proto() {
  local -a OPTS
  read -ra OPTS <<< "$NTPD_OPTIONS"
  for i in "${OPTS[@]}"; do
    if [ "$i" = "-4" ] || [ "$i" = "-6" ]; then
      # first occurrence wins safely because ntpd couldn't handle more anyway
      echo "$i"
      return
    fi
  done
  echo ""
  return
}

case "$1" in
  start)
    if [ "$NTPD_FORCE_SYNC_ON_STARTUP" = "yes" ]; then
        # get the initial date from the timeservers configured in ntp.conf
        ntpd_is_running || $0 ntptimeset
    fi
    echo -n "Starting network time protocol daemon (NTPD)"
    # do we need a refclock symlink?
    parse_symlink
    # do we run chrooted?
    test "${NTPD_RUN_CHROOTED}" = "yes" && prepare_chroot

    $NTPD_BIN -p ${NTPD_PID#${CHROOT_PREFIX}} $NTPD_OPTIONS -c $NTP_CONF

    if [ -n "${NTP_KEYS}" ]; then
      runtime_configuration
    fi

  ;;
  addserver)
    if [ -z "${NTP_KEYS}" ]; then
      echo "Runtime configuration disabled, no key file specified."
      exit 1
    fi

    if test $# -lt 2; then
      echo "No servers to add specified"
      exit 1
    fi
    shift

    $0 status 2>&1 >/dev/null
    if test $? = 0;
    then
      add_runtime_server "$@"
    fi
  ;;
  ntptimeset)
    NTPD_PROTO="$( get_ntpd_ip_proto )"
    for i in $(gawk '/^server/ { if( $2 !~ "^127.127." ) print $2","$3 }' 
$NTP_CONF)
    do 
        IFS=',' read -ra SERVER <<< "$i"
        if [ ${SERVER[0]} = "-4" ] || [ ${SERVER[0]} = "-6" ]
        then
            if [ -z "${NTPD_PROTO}" ] || [ "${NTPD_PROTO}" = "${SERVER[0]}" ]
            then
                SNTP_OPT="${SERVER[0]} ${SERVER[1]}"
            else
                # ignore servers with conflicting proto
                continue
            fi
        else
            # here the usual case with empty NTPD_PROTO (default/yast config)
            SNTP_OPT="$NTPD_PROTO ${SERVER[0]}"
        fi
        sntp -t 2 -l /dev/null -s $SNTP_OPT 2> /dev/null && { 
SYNCHRONISED=$SNTP_OPT; break; };
    done
    if [ "$SYNCHRONISED" ]
    then
            echo "Time synchronized with $SYNCHRONISED"
            update_cmos
    else
            echo "Time could not be synchronized"
    fi
  ;;
  *)
    echo "Usage: $0 {start|addserver|ntptimeset}"
    exit 1
  ;;
esac



-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to