]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Adding and using snippet tpl.240.rc.local.sh
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 8 Nov 2023 16:48:54 +0000 (17:48 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 8 Nov 2023 16:48:54 +0000 (17:48 +0100)
etc/cobbler-distros.d/almalinux-8.yaml
etc/cobbler-distros.d/centos-7.yaml
etc/cobbler-distros.d/centos-stream-8.yaml
etc/cobbler-distros.d/centos-stream-9.yaml
etc/cobbler-distros.d/oel-7.yaml
etc/cobbler-distros.d/rhel-9.yaml
etc/cobbler-distros.d/rocky-8.yaml
snippets/tpl.240.rc.local.sh [new file with mode: 0644]

index 035378bcb639f845c63e0e716b0ec11254b75992..87a7c6e3d74c53977adc5e75edd5c1a6606f076d 100644 (file)
@@ -68,6 +68,7 @@ cobbler-distros:
       - 'tpl.210.bashrc-el8.sh'
       - 'tpl.220.locales-el8.sh'
       - 'tpl.230.vimrc-el8.sh'
+      - 'tpl.240.rc.local.sh'
       - 'tpl.250.pkgs-el8.sh'
       - 'tpl.280.dist-upgrade.sh'
       - 'tpl.300.create-motd.sh'
index 01108a10fdd1e0841c40b1b6865cd50ecc7db27e..f24aa0d79a3a260e2ce892829c737f3f423eb0ae 100644 (file)
@@ -47,6 +47,7 @@ cobbler-distros:
       - 'tpl.175.repos_el7.sh'
       - 'tpl.200.init-repos.sh'
       - 'tpl.225.vimrc-el7.sh'
+      - 'tpl.240.rc.local.sh'
       - 'tpl.250.pkgs-el7.sh'
       - 'tpl.280.dist-upgrade.sh'
       - 'tpl.320.root-ssh-login.sh'
index 34d1156488b7009b9f713e31f0df50d7fac32682..1d8acf1359983035973e47458c76b708f3e1044c 100644 (file)
@@ -52,6 +52,7 @@ cobbler-distros:
       - 'tpl.185.repos_el8.sh'
       - 'tpl.200.init-repos.sh'
       - 'tpl.230.vimrc-el8.sh'
+      - 'tpl.240.rc.local.sh'
       - 'tpl.250.pkgs-el8.sh'
       - 'tpl.280.dist-upgrade.sh'
       - 'tpl.320.root-ssh-login.sh'
index e7bc6d492fc813665cbcd571e91691a6d14b4d70..368839ef35538d2ac4df38eebf264d9824d64404 100644 (file)
@@ -68,6 +68,7 @@ cobbler-distros:
       - 'tpl.210.bashrc-el8.sh'
       - 'tpl.220.locales-el8.sh'
       - 'tpl.230.vimrc-el8.sh'
+      - 'tpl.240.rc.local.sh'
       - 'tpl.250.pkgs-el8.sh'
       - 'tpl.280.dist-upgrade.sh'
       - 'tpl.300.create-motd.sh'
index 4e7ab442b3e18050e3a123fc56d46aea3733ef27..61eac7700c9b47143dfb156e0ffe818728ca77ea 100644 (file)
@@ -52,6 +52,7 @@ cobbler-distros:
       - 'tpl.175.repos_el7.sh'
       - 'tpl.200.init-repos.sh'
       - 'tpl.225.vimrc-el7.sh'
+      - 'tpl.240.rc.local.sh'
       - 'tpl.250.pkgs-el7.sh'
       - 'tpl.270.remove-uek.sh'
       - 'tpl.280.dist-upgrade.sh'
index 4fda09b83e49f1592e057f17b9cdbb52e34ee692..a7887a3b1fc876bf84e0886fdc4b048b39e9a4a0 100644 (file)
@@ -48,6 +48,7 @@ cobbler-distros:
       - 'tpl.195.repos_el9.sh'
       - 'tpl.200.init-repos.sh'
       - 'tpl.231.vimrc-centos9.sh'
+      - 'tpl.240.rc.local.sh'
       - 'tpl.280.dist-upgrade.sh'
       - 'tpl.320.root-ssh-login.sh'
       - 'tpl.400.chrony.sh'
index 217d1e46d1cdf3d050268c7a6acaf913c1f14400..4803cb403a795cde9f6d5a68e6448d2a6af12771 100644 (file)
@@ -68,6 +68,7 @@ cobbler-distros:
       - 'tpl.210.bashrc-el8.sh'
       - 'tpl.220.locales-el8.sh'
       - 'tpl.230.vimrc-el8.sh'
+      - 'tpl.240.rc.local.sh'
       - 'tpl.250.pkgs-el8.sh'
       - 'tpl.280.dist-upgrade.sh'
       - 'tpl.300.create-motd.sh'
diff --git a/snippets/tpl.240.rc.local.sh b/snippets/tpl.240.rc.local.sh
new file mode 100644 (file)
index 0000000..4ec7f77
--- /dev/null
@@ -0,0 +1,46 @@
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+manage_rc_local() {
+
+    echo -e "\e[0Ksection_start:$( date +%s ):ks_manage_rc_local[collapsed=true]\r\e[0KManaging /etc/rc.d/rc.local ..."
+    echo
+    echo "${HASH_LINE}"
+    echo "Calling manage_rc_local() ..."
+    echo
+
+    if [[ -d /etc/rc.d ]] ; then
+        echo "Creating /etc/rc.d/rc.local ..."
+        cat <<-EOF >/etc/rc.d/rc.local
+                       #!/bin/bash
+                       # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
+                       #
+                       # It is highly advisable to create own systemd services or udev rules
+                       # to run scripts during boot instead of using this file.
+                       #
+                       # In contrast to previous versions due to parallel execution during boot
+                       # this script will NOT be run after all other services.
+                       #
+                       # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
+                       # that this script will be executed during boot.
+
+                       # touch /var/lock/subsys/local
+
+                       EOF
+
+        chmod --verbose 0744 /etc/rc.d/rc.local
+        echo
+
+        echo "Created /etc/rc.d/rc.local:"
+        echo "----------- snip -----------"
+        cat /etc/rc.d/rc.local
+        echo "----------- snip -----------"
+
+    fi
+
+    echo -e "\e[0Ksection_end:$( date +%s ):ks_manage_rc_local\r\e[0K"
+}
+
+#end raw
+## vim: ts=4 et list