diff --git a/cdist/conf/type/__jail/manifest b/cdist/conf/type/__jail/manifest index d73c3cbf..fad6a3a1 100755 --- a/cdist/conf/type/__jail/manifest +++ b/cdist/conf/type/__jail/manifest @@ -1,8 +1,6 @@ #!/bin/sh -e # # 2012 Jake Guffey (jake.guffey at eprotex.com) -# 2026 Shannon Prickett -# 2026 Nico Schottelius # # This file is part of cdist. # @@ -45,7 +43,7 @@ for property in *; do set -- "$@" "--$property" "$(cat "$property")" done -if grep -q '^[[:digit:]]\{2,\}\.' "$__global/explorer/os_version" ; then # Version > 9.x +if grep -q '^10\.' "$(cat "$__global/explorer/os_version")" ; then # Version is 10.x __jail_freebsd10 "$@" else __jail_freebsd9 "$@" @@ -53,3 +51,4 @@ fi # Debug #set +x + diff --git a/cdist/conf/type/__start_on_boot/explorer/state b/cdist/conf/type/__start_on_boot/explorer/state index b7a6cf0f..d2400359 100644 --- a/cdist/conf/type/__start_on_boot/explorer/state +++ b/cdist/conf/type/__start_on_boot/explorer/state @@ -37,7 +37,7 @@ if [ "$init" = 'systemd' ]; then else case "$os" in - debian|openwrt|devuan) + openwrt|devuan) state="absent" for file in "/etc/rc$runlevel.d/S"??"$name" do @@ -48,33 +48,12 @@ else fi done ;; - ubuntu) - state="absent" - for file in "/etc/rc$runlevel.d/S"??"$name" - do - if [ -f "$file" ] - then - state="present" - break - fi - done - [ -f "/etc/init/${name}.conf" ] && state="present" - ;; - - amazon|scientific|centos|fedora|owl|redhat) + owl) state=$(chkconfig --level "$runlevel" "$name" || echo absent) [ "$state" ] || state="present" ;; - suse) - # check for target if set, usable for boot. services in runlevel B - if [ "$target_runlevel" != 'default' ]; then - runlevel="$target_runlevel" - fi - # suses chkconfig has the same name, but works different ... - state=$(chkconfig --check "$name" "$runlevel" || echo absent) - [ "$state" ] || state="present" - ;; + gentoo|alpine) state="absent" for d in /etc/runlevels/*; do @@ -84,10 +63,12 @@ else fi done ;; + freebsd) state="absent" service -e | grep "/$name$" && state="present" ;; + openbsd) state='absent' # OpenBSD 5.7 and higher diff --git a/cdist/conf/type/__start_on_boot/gencode-remote b/cdist/conf/type/__start_on_boot/gencode-remote index c900933f..c9597bb7 100755 --- a/cdist/conf/type/__start_on_boot/gencode-remote +++ b/cdist/conf/type/__start_on_boot/gencode-remote @@ -36,24 +36,10 @@ case "$state_should" in present) if [ "$init" = 'systemd' ]; then # this handles ALL linux distros with systemd - # e.g. archlinux, gentoo in some cases, new RHEL and SLES versions + # e.g. debian, fedora, archlinux, gentoo in some cases, new RHEL and SLES versions echo "systemctl -q enable '$name'" else case "$os" in - debian) - case "$os_version" in - [1-7]*) - echo "update-rc.d '$name' defaults >/dev/null" - ;; - 8*) - echo "systemctl enable '$name'" - ;; - *) - echo "Unsupported version $os_version of $os" >&2 - exit 1 - ;; - esac - ;; devuan) echo "update-rc.d '$name' defaults >/dev/null" ;; @@ -62,7 +48,7 @@ case "$state_should" in echo "rc-update add '$name' '$target_runlevel'" ;; - amazon|scientific|centos|fedora|owl|redhat|suse) + owl) echo "chkconfig '$name' on" ;; @@ -73,10 +59,6 @@ case "$state_should" in echo "'/etc/init.d/$name' enable || [ -f /etc/rc.d/S??'$name' ]" ;; - ubuntu) - echo "update-rc.d '$name' defaults >/dev/null" - ;; - freebsd) : # handled in manifest ;; @@ -102,7 +84,7 @@ case "$state_should" in else case "$os" in - debian|ubuntu|devuan) + devuan) echo "update-rc.d -f '$name' remove" ;; @@ -110,7 +92,7 @@ case "$state_should" in echo "rc-update del '$name' '$target_runlevel'" ;; - centos|fedora|owl|redhat|suse) + owl) echo "chkconfig '$name' off" ;; diff --git a/cdist/conf/type/__start_on_boot/man.rst b/cdist/conf/type/__start_on_boot/man.rst index f8afe94b..a8fbf0a8 100644 --- a/cdist/conf/type/__start_on_boot/man.rst +++ b/cdist/conf/type/__start_on_boot/man.rst @@ -11,10 +11,6 @@ DESCRIPTION This cdist type allows you to enable or disable stuff to be started at boot of your operating system. -Warning: This type has not been tested intensively and is not fully -supported. - - REQUIRED PARAMETERS ------------------- None. @@ -24,6 +20,7 @@ OPTIONAL PARAMETERS ------------------- state Either "present" or "absent", defaults to "present" + target_runlevel Runlevel which should be modified, defaults to "default" (only used on gentoo systems). @@ -51,6 +48,7 @@ SEE ALSO AUTHORS ------- Nico Schottelius +Timothée Floure COPYING diff --git a/cdist/conf/type/__timezone/gencode-remote b/cdist/conf/type/__timezone/gencode-remote index d8612986..b685c990 100755 --- a/cdist/conf/type/__timezone/gencode-remote +++ b/cdist/conf/type/__timezone/gencode-remote @@ -34,12 +34,3 @@ case "$os" in echo "echo \"$timezone_should\" > /etc/timezone" ;; esac - -case "$os" in - openwrt) - cat <