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