From 920ff4f5757dc79ff8f4b12e60ce0908cc0593afeb9732de39692bc9b284e88d Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski Date: Tue, 10 Sep 2013 13:05:48 +0000 Subject: [PATCH] - Fixed to reload syslog on hostname changes using systemctl as there is no /etc/init.d/syslog script since syslog-service-2.0 (bnc#830467). OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=111 --- dhclient-script | 12 ++++++++---- dhcp.changes | 7 +++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/dhclient-script b/dhclient-script index 04de396..cc5db97 100644 --- a/dhclient-script +++ b/dhclient-script @@ -256,7 +256,7 @@ set_hostname() if [ -x /usr/bin/host ] ; then if out=`host -W 2 "$new_ip_address" 2>/dev/null` ; then _hostname="`echo "$out" | sed 's:^.* ::; s:\..*::; s:.*[)]::'`" - [[ ${_hostname} =~ ${rx_host} ]] || unset _hostname + [[ ${_hostname} =~ ${rx_host} ]] || unset _hostname if [ "x${_hostname}" != "x" -a \ "x${_hostname}" != "x${current_hostname}" ]; then hostname "${_hostname}" @@ -279,7 +279,11 @@ set_hostname() commit_cached_config_data $interface # reload syslog so it knows the new hostname - /etc/init.d/syslog reload + if test -x /usr/sbin/systemctl ; then + /usr/sbin/systemctl reload syslog.service + else + /etc/init.d/syslog reload + fi fi fi } @@ -311,7 +315,7 @@ dhclient) # STARTMODE eval `grep --no-filename \ '^[[:space:]]*STARTMODE=' \ - "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null` + "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null` tmp_startmode=`read_cached_config_data startmode $INTERFACE` [ -n "$tmp_startmode" ] && STARTMODE="$tmp_startmode" @@ -360,7 +364,7 @@ dhclient6) # STARTMODE eval `grep --no-filename \ '^[[:space:]]*STARTMODE=' \ - "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null` + "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null` tmp_startmode=`read_cached_config_data startmode $INTERFACE` [ -n "$tmp_startmode" ] && STARTMODE="$tmp_startmode" else diff --git a/dhcp.changes b/dhcp.changes index 1b57756..be020c1 100644 --- a/dhcp.changes +++ b/dhcp.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Sep 10 13:04:10 UTC 2013 - mt@suse.com + +- Fixed to reload syslog on hostname changes using systemctl as + there is no /etc/init.d/syslog script since syslog-service-2.0 + (bnc#830467). + ------------------------------------------------------------------- Fri Apr 26 09:27:19 UTC 2013 - mmeister@suse.com