Apply patch from Sunil to correctly set hostname in systemd environment.

This commit is contained in:
James Valleroy 2014-12-18 21:09:27 -05:00 committed by Sunil Mohan Adapa
parent b98a9ad84d
commit 219b7ff862

View File

@ -18,12 +18,15 @@
hostname="$1"
echo "$hostname" > /etc/hostname
if [ -x /etc/init.d/hostname.sh ] ; then
invoke-rc.d hostname.sh start
if [ -d /run/systemd/system ] ; then
hostnamectl set-hostname --transient --static "$hostname"
else
service hostname start
echo "$hostname" > /etc/hostname
if [ -x /etc/init.d/hostname.sh ] ; then
invoke-rc.d hostname.sh start
else
service hostname start
fi
fi
hostname "$hostname"
service avahi-daemon restart