From 2bd0ef7c610f0a44e59590e6c951325b541add8a Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 1 Sep 2022 14:15:09 -0700 Subject: [PATCH] config: Drop ability to set hostname on systems without systemd We depend on systemd for many things anyway and this code path is never tested. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- actions/hostname-change | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/actions/hostname-change b/actions/hostname-change index 3b578d026..c5bdee448 100755 --- a/actions/hostname-change +++ b/actions/hostname-change @@ -3,15 +3,6 @@ hostname="$1" -if [ -d /run/systemd/system ] ; then - hostnamectl set-hostname --transient --static "$hostname" -else - echo "$hostname" > /etc/hostname - if [ -x /etc/init.d/hostname.sh ] ; then - invoke-rc.d hostname.sh start - else - service hostname start - fi -fi +hostnamectl set-hostname --transient --static "$hostname" service avahi-daemon restart