File sysconfig-0.81.5-netconfig-use_systemctl.patch of Package sysconfig

Upstream: yes
References: bnc#845792

Index: sysconfig-0.81.5/scripts/netconfig.d/nis
===================================================================
--- sysconfig-0.81.5.orig/scripts/netconfig.d/nis	2013-10-11 15:17:18.468338773 +0200
+++ sysconfig-0.81.5/scripts/netconfig.d/nis	2013-10-11 16:35:57.462096834 +0200
@@ -444,7 +444,9 @@ write_nisdomainname
 
 # here we should restart services if needed
 # => reload ypbind
-if [ -x $r/etc/init.d/ypbind ]; then
+if [ "$(cat /proc/1/comm)" = "systemd" ]; then
+    systemctl reload ypbind >/dev/null 2>&1
+elif [ -x $r/etc/init.d/ypbind ]; then
     $r/etc/init.d/ypbind reload >/dev/null 2>&1
 fi
 
Index: sysconfig-0.81.5/scripts/netconfig.d/ntp-runtime
===================================================================
--- sysconfig-0.81.5.orig/scripts/netconfig.d/ntp-runtime	2013-10-11 16:19:18.107435944 +0200
+++ sysconfig-0.81.5/scripts/netconfig.d/ntp-runtime	2013-10-14 15:01:30.194514004 +0200
@@ -226,8 +226,16 @@ do_runtime_update()
     NTP_CONF="/etc/ntp.conf"
     NTPDC_BIN="/usr/sbin/ntpdc"
 
+    local status
+    if [ "$(cat /proc/1/comm)" = "systemd" ]; then
+        systemctl status ntp >/dev/null 2>&1
+    elif [ -x $r/etc/init.d/ntp ]; then
+        $r/etc/init.d/ntp status >/dev/null 2>&1
+    fi
+    status=$?
+
     if [ -n "${NTP_SERVER_LIST[*]}" -a -f "${NTP_CONF}" ] && \
-         /etc/init.d/ntp status >/dev/null 2>/dev/null ; then
+         [ $status -eq 0 ]; then
         NTP_KEYS=$(awk -- '/^keys/ { print $2 }' $NTP_CONF 2>/dev/null)
         NTP_KEYID=$(awk -- '/^requestkey[[:blank:]]/ { print $2 }' $NTP_CONF 2>/dev/null)
         NTP_PASSWD=$(test -n "$NTP_KEYS" -a -n "$NTP_KEYID" -a -r "$NTP_KEYS" && \
openSUSE Build Service is sponsored by