summaryrefslogtreecommitdiff
path: root/google_config
diff options
context:
space:
mode:
authorZach Marano <zmarano@google.com>2017-12-19 15:25:45 -0800
committerGitHub <noreply@github.com>2017-12-19 15:25:45 -0800
commitd1964c2724fb6275b4e14e215a8eb6215f5e268c (patch)
tree7bb84fa8cb14452606e0425ab1a0b297d9d0aa4e /google_config
parent31d9b1f94c87cd9b459e5a577277faf1876998cb (diff)
downloadgoogle-compute-image-packages-d1964c2724fb6275b4e14e215a8eb6215f5e268c.tar.gz
Update hostname script to correctly restart rsyslog. (#531)
- Add missing dependency for rsyslog to debian package.
Diffstat (limited to 'google_config')
-rwxr-xr-xgoogle_config/bin/google_set_hostname10
1 files changed, 5 insertions, 5 deletions
diff --git a/google_config/bin/google_set_hostname b/google_config/bin/google_set_hostname
index 64aa091..88d8f09 100755
--- a/google_config/bin/google_set_hostname
+++ b/google_config/bin/google_set_hostname
@@ -46,10 +46,10 @@ if [ -n "$new_host_name" ]; then
nmcli general hostname "${new_host_name%%.*}"
fi
- # Restart syslog to update the hostname if we're not using systemd.
- # systemd rsyslog jobs wait for networking to finish starting and consequently
- # syslog or rsyslog is running with the correct hostname.
- if [ ! -f /bin/systemctl ]; then
- pkill -HUP syslogd
+ # Restart rsyslog to update the hostname.
+ if [ -f /etc/init.d/rsyslog ]; then
+ /etc/init.d/rsyslog restart
+ elif [ -f /bin/systemctl ]; then
+ systemctl -q --no-block restart rsyslog
fi
fi