[Fedora-spins] [spin-kickstarts] update system disablement for systemd, drop some dead wood

Bruno Wolff III bruno at fedoraproject.org
Sat Oct 15 22:07:52 UTC 2011


commit 5ad2a6e42b1f7605d58a367c30c37341fe2a4684
Author: Adam Williamson <awilliam at redhat.com>
Date:   Sat Oct 1 08:37:06 2011 -0500

    update system disablement for systemd, drop some dead wood
    
    Signed-off-by: Bruno Wolff III <bruno at wolff.to>

 fedora-live-base.ks |   32 ++++++++++++--------------------
 fedora-live-mini.ks |   34 +++++++++++++++-------------------
 2 files changed, 27 insertions(+), 39 deletions(-)
---
diff --git a/fedora-live-base.ks b/fedora-live-base.ks
index 476377d..0b14fec 100644
--- a/fedora-live-base.ks
+++ b/fedora-live-base.ks
@@ -185,37 +185,29 @@ action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser
 passwd -d liveuser > /dev/null
 
 # turn off firstboot for livecd boots
-chkconfig --level 345 firstboot off 2>/dev/null
-# We made firstboot a native systemd service, so it can no longer be turned
-# off with chkconfig. It should be possible to turn it off with systemctl, but
-# that doesn't work right either. For now, this is good enough: the firstboot
-# service will start up, but this tells it not to run firstboot. I suspect the
-# other services 'disabled' below are not actually getting disabled properly,
-# with systemd, but we can look into that later. - AdamW 2010/08 F14Alpha
-echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
+systemctl --no-reload disable firstboot-text.service 2> /dev/null || :
+systemctl --no-reload disable firstboot-graphical.service 2> /dev/null || :
+systemctl stop firstboot-text.service 2> /dev/null || :
+systemctl stop firstboot-graphical.service 2> /dev/null || :
 
 # don't use prelink on a running live image
 sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || :
 
-# don't start yum-updatesd for livecd boots
-chkconfig --level 345 yum-updatesd off 2>/dev/null || :
-
 # turn off mdmonitor by default
-chkconfig --level 345 mdmonitor off 2>/dev/null || :
-
-# turn off setroubleshoot on the live image to preserve resources
-chkconfig --level 345 setroubleshoot off 2>/dev/null || :
+systemctl --no-reload disable mdmonitor.service 2> /dev/null || :
+systemctl --no-reload disable mdmonitor-takeover.service 2> /dev/null || :
+systemctl stop mdmonitor.service 2> /dev/null || :
+systemctl stop mdmonitor-takeover.service 2> /dev/null || :
 
 # don't enable the gnome-settings-daemon packagekit plugin
 gsettings set org.gnome.settings-daemon.plugins.updates active 'false' || :
 
 # don't start cron/at as they tend to spawn things which are
 # disk intensive that are painful on a live image
-chkconfig --level 345 crond off 2>/dev/null || :
-chkconfig --level 345 atd off 2>/dev/null || :
-
-# Stopgap fix for RH #217966; should be fixed in HAL instead
-touch /media/.hal-mtab
+systemctl --no-reload disable crond.service 2> /dev/null || :
+systemctl --no-reload disable atd.service 2> /dev/null || :
+systemctl stop crond.service 2> /dev/null || :
+systemctl stop atd.service 2> /dev/null || :
 
 # and hack so that we eject the cd on shutdown if we're using a CD...
 if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then
diff --git a/fedora-live-mini.ks b/fedora-live-mini.ks
index 6eca342..75a1e21 100644
--- a/fedora-live-mini.ks
+++ b/fedora-live-mini.ks
@@ -155,6 +155,9 @@ exists() {
 
 touch /.liveimg-configured
 
+# Make sure we don't mangle the hardware clock on shutdown
+ln -sf /dev/null /etc/systemd/system/hwclock-save.service
+
 # mount live image
 if [ -b \`readlink -f /dev/live\` ]; then
    mkdir -p /mnt/live
@@ -253,22 +256,19 @@ action "Adding live user" useradd \$USERADDARGS -c "Live System User" liveuser
 passwd -d liveuser > /dev/null
 
 # turn off firstboot for livecd boots
-chkconfig --level 345 firstboot off 2>/dev/null
-
-# The above doesn't works so we need to do this... GRR systemctl
-echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
+systemctl --no-reload disable firstboot-text.service 2> /dev/null || :
+systemctl --no-reload disable firstboot-graphical.service 2> /dev/null || :
+systemctl stop firstboot-text.service 2> /dev/null || :
+systemctl stop firstboot-graphical.service 2> /dev/null || :
 
 # don't use prelink on a running live image
 sed -i 's/PRELINKING=yes/PRELINKING=no/' /etc/sysconfig/prelink &>/dev/null || :
 
-# don't start yum-updatesd for livecd boots
-chkconfig --level 345 yum-updatesd off 2>/dev/null
-
 # turn off mdmonitor by default
-chkconfig --level 345 mdmonitor off 2>/dev/null
-
-# turn off setroubleshoot on the live image to preserve resources
-chkconfig --level 345 setroubleshoot off 2>/dev/null
+systemctl --no-reload disable mdmonitor.service 2> /dev/null || :
+systemctl --no-reload disable mdmonitor-takeover.service 2> /dev/null || :
+systemctl stop mdmonitor.service 2> /dev/null || :
+systemctl stop mdmonitor-takeover.service 2> /dev/null || :
 
 # don't do packagekit checking by default
 gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string /apps/gnome-packagekit/frequency_get_updates never >/dev/null
@@ -285,14 +285,10 @@ gconftool-2 --direct --config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults
 
 # don't start cron/at as they tend to spawn things which are
 # disk intensive that are painful on a live image
-chkconfig --level 345 crond off 2>/dev/null
-chkconfig --level 345 atd off 2>/dev/null
-
-# Stopgap fix for RH #217966; should be fixed in HAL instead
-touch /media/.hal-mtab
-
-# workaround clock syncing on shutdown that we don't want (#297421)
-sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
+systemctl --no-reload disable crond.service 2> /dev/null || :
+systemctl --no-reload disable atd.service 2> /dev/null || :
+systemctl stop crond.service 2> /dev/null || :
+systemctl stop atd.service 2> /dev/null || :
 
 # and hack so that we eject the cd on shutdown if we're using a CD...
 if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then


More information about the spins mailing list