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

This commit is contained in:
James Valleroy authored and Sunil Mohan Adapa committed 2015-01-03 14:43:50 +05:30
1 parent b98a9ad84d
commit 219b7ff862
1 file changed
+8 -5
+8 -5
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