Move service enable/disable in kickstart to per-RHEL config file
authorMartin Schwenke <martin@meltin.net>
Mon, 16 Jun 2014 10:14:20 +0000 (20:14 +1000)
committerMartin Schwenke <martin@meltin.net>
Tue, 17 Jun 2014 01:23:01 +0000 (11:23 +1000)
Signed-off-by: Martin Schwenke <martin@meltin.net>
config.d/00base.defconf
templates/RHEL5.services [new file with mode: 0644]
templates/RHEL6.services [new file with mode: 0644]
templates/nas-kickstart.cfg

index e5530adc7ffd94d5cacc8e962df3074530ceee3f..ee750ff9d181e3da3355b42d5255406934f0ac66 100644 (file)
@@ -411,6 +411,11 @@ rhel_get_packages ()
     echo "$installdir/templates/RHEL${RHEL_VERSION%%.*}.packages"
 }
 
+rhel_get_services ()
+{
+    echo "$installdir/templates/RHEL${RHEL_VERSION%%.*}.services"
+}
+
 rhel_post_config_hook ()
 {
     if [ "$ISO" = "@uto" ] ; then
@@ -436,6 +441,10 @@ rhel_post_config_hook ()
     if [ "$RHEL_PACKAGES" = "@uto" ] ; then
        RHEL_PACKAGES=$(rhel_get_packages) || exit $?
     fi
+
+    if [ "$RHEL_SERVICES" = "@uto" ] ; then
+       RHEL_SERVICES=$(rhel_get_services) || exit $?
+    fi
 }
 
 register_hook post_config_hooks rhel_post_config_hook
@@ -448,6 +457,8 @@ defconf RHEL_VERSION "6.2" \
 
 defconf RHEL_PACKAGES "@uto"
 
+defconf RHEL_SERVICES "@uto"
+
 defconf ISO_DIR "/virtual/ISO" \
        "<dir>" "directory for ISO images, prepended to $ISO if not absolute"
 
diff --git a/templates/RHEL5.services b/templates/RHEL5.services
new file mode 100644 (file)
index 0000000..a02f91e
--- /dev/null
@@ -0,0 +1,32 @@
+echo "Turn off some services..."
+chkconfig atd off
+chkconfig avahi-daemon off
+chkconfig avahi-dnsconfd off
+chkconfig bluetooth off
+chkconfig cpuspeed off
+chkconfig cups off
+chkconfig dhcdbd off
+chkconfig dund off
+chkconfig firstboot off
+chkconfig haldaemon off
+chkconfig hidd off
+chkconfig ip6tables off
+chkconfig ipmi off
+chkconfig iptables off
+chkconfig irda off
+chkconfig kudzu off
+chkconfig nfslock off
+chkconfig nscd off
+chkconfig pand off
+chkconfig pcscd off
+chkconfig restorecond off
+chkconfig rhnsd off
+chkconfig sendmail off
+chkconfig setroubleshoot off
+chkconfig smartd off
+chkconfig xfs off
+chkconfig yum-updatesd off
+chkconfig gpm off
+
+echo "Turn on some services..."
+chkconfig multipathd on
diff --git a/templates/RHEL6.services b/templates/RHEL6.services
new file mode 100644 (file)
index 0000000..a02f91e
--- /dev/null
@@ -0,0 +1,32 @@
+echo "Turn off some services..."
+chkconfig atd off
+chkconfig avahi-daemon off
+chkconfig avahi-dnsconfd off
+chkconfig bluetooth off
+chkconfig cpuspeed off
+chkconfig cups off
+chkconfig dhcdbd off
+chkconfig dund off
+chkconfig firstboot off
+chkconfig haldaemon off
+chkconfig hidd off
+chkconfig ip6tables off
+chkconfig ipmi off
+chkconfig iptables off
+chkconfig irda off
+chkconfig kudzu off
+chkconfig nfslock off
+chkconfig nscd off
+chkconfig pand off
+chkconfig pcscd off
+chkconfig restorecond off
+chkconfig rhnsd off
+chkconfig sendmail off
+chkconfig setroubleshoot off
+chkconfig smartd off
+chkconfig xfs off
+chkconfig yum-updatesd off
+chkconfig gpm off
+
+echo "Turn on some services..."
+chkconfig multipathd on
index 2ac15345b959e1fa9e012c1d8e9f37d947a7e6f9..8f8ecd86b9cfff1eaac4e7ec15dd08d6ebddf39d 100644 (file)
@@ -45,38 +45,7 @@ part swap --ondisk=@@SYSTEM_DISK_PREFIX@@a --size=@@SWAPSIZE@@
 (
 set -x
 
-echo "Turn off some services..."
-chkconfig atd off
-chkconfig avahi-daemon off
-chkconfig avahi-dnsconfd off
-chkconfig bluetooth off
-chkconfig cpuspeed off
-chkconfig cups off
-chkconfig dhcdbd off
-chkconfig dund off
-chkconfig firstboot off
-chkconfig haldaemon off
-chkconfig hidd off
-chkconfig ip6tables off
-chkconfig ipmi off
-chkconfig iptables off
-chkconfig irda off
-chkconfig kudzu off
-chkconfig nfslock off
-chkconfig nscd off
-chkconfig pand off
-chkconfig pcscd off
-chkconfig restorecond off
-chkconfig rhnsd off
-chkconfig sendmail off
-chkconfig setroubleshoot off
-chkconfig smartd off
-chkconfig xfs off
-chkconfig yum-updatesd off
-chkconfig gpm off
-
-echo "Turn on some services..."
-chkconfig multipathd on
+@@@RHEL_SERVICES@@@
 
 for i in @@EXTRA_CHKCONFIGS@@ ; do
     chkconfig ${i%:*} ${i#*:}