trying another approach to turning off selinux
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 31 Jan 2011 12:18:04 +0000 (13:18 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Mon, 31 Jan 2011 12:18:04 +0000 (13:18 +0100)
the other one won't work as /etc/selinux/targeted is not installed
sounds like even when selinux is turned off, this is required (to turn
off the bloody thing, go figure)

config.planetlab/bootstrapfs.post

index 46acda3..5149e9e 100644 (file)
@@ -26,8 +26,10 @@ chroot ${vdir} /sbin/chkconfig vservers-default off || :
 chroot ${vdir} /sbin/chkconfig vprocunhide on || :
 
 # turn OFF selinux if set
-selinuxconf=${vdir}/etc/sysconfig/selinux
-[ -f ${selinuxconf} ] && sed -i -e 's,^SELINUX[ \t]*=.*$,SELINUX=disabled,' ${selinuxconf}
+if [ -f ${vdir}/etc/sysconfig/selinux ] ; then
+    selinuxrpm=$(chroot ${vdir} rpm -qf /etc/sysconfig/selinux)
+    chroot ${vdir} rpm -e --nodeps ${rpm}
+fi
 
 # Disable splaying of cron.
 echo > ${vdir}/etc/sysconfig/crontab