From 5eb9fec550907d3ae65ce9ef62849093afc7c9f4 Mon Sep 17 00:00:00 2001 From: Dennis Camera Date: Sun, 27 Oct 2019 15:14:09 +0100 Subject: [PATCH] [__hostname] Add support for Slackware --- cdist/conf/type/__hostname/gencode-remote | 2 +- cdist/conf/type/__hostname/manifest | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cdist/conf/type/__hostname/gencode-remote b/cdist/conf/type/__hostname/gencode-remote index 90312fad..1e798036 100755 --- a/cdist/conf/type/__hostname/gencode-remote +++ b/cdist/conf/type/__hostname/gencode-remote @@ -66,7 +66,7 @@ in "&& hostnamectl set-hostname '$name_should'" \ "|| hostname '$name_should'" ;; - centos|fedora|redhat|scientific|freebsd|netbsd|gentoo|void) + centos|fedora|redhat|scientific|freebsd|netbsd|gentoo|slackware|void) echo "hostname '$name_should'" ;; macosx) diff --git a/cdist/conf/type/__hostname/manifest b/cdist/conf/type/__hostname/manifest index 64f90492..8b4d26b1 100755 --- a/cdist/conf/type/__hostname/manifest +++ b/cdist/conf/type/__hostname/manifest @@ -41,7 +41,7 @@ else case $os in # RedHat-derivatives and BSDs - centos|fedora|redhat|scientific|freebsd|netbsd|openbsd) + centos|fedora|redhat|scientific|freebsd|netbsd|openbsd|slackware) # Hostname is FQDN name_should="${__target_host}" ;; @@ -130,6 +130,12 @@ in openbsd) echo "$name_should" | __file /etc/myname --source - ;; + slackware) + # We write the FQDN into /etc/HOSTNAME. + # But /etc/rc.d/rc.M will only read the first component from this file + # and set it as the running hostname on boot. + echo "$name_should" | __file /etc/HOSTNAME --source - + ;; suse) # We write into /etc/HOSTNAME for backwards-compatibility. Modern SuSE # has hostnamectl anyway and symlinks /etc/HOSTNAME to /etc/hostname.