From 6be4672a8cccfa9b80cdf9dca7b7acf43c41ce71 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 31 Jan 2011 14:50:15 +0100 Subject: [PATCH] yet another attempt .. --- config.planetlab/bootstrapfs.post | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/config.planetlab/bootstrapfs.post b/config.planetlab/bootstrapfs.post index a5d79e90..e26a1d75 100644 --- a/config.planetlab/bootstrapfs.post +++ b/config.planetlab/bootstrapfs.post @@ -26,15 +26,17 @@ chroot ${vdir} /sbin/chkconfig vservers-default off || : chroot ${vdir} /sbin/chkconfig vprocunhide on || : # turn OFF selinux if set -if [ -f ${vdir}/etc/sysconfig/selinux ] ; then - selinuxrpm=$(chroot ${vdir} rpm -qf /etc/sysconfig/selinux) +# this may happen accidentally if you mention too much stuff in bootstrapfs.pkgs +for file in /etc/sysconfig/selinux /sbin/load_policy; do + [ -f ${vdir}/${file} ] || { echo "$file not found in $vdir - fine" ; continue; } + selinuxrpm=$(chroot ${vdir} rpm -qf ${file}) if [ -z "$selinuxrpm" ] ; then - echo WARNING : could not turn off SElinux + echo "SElinux: warning : could not rpm for file $file" else echo "Force-removing package ${selinuxrpm}" chroot ${vdir} rpm -e --nodeps ${selinuxrpm} fi -fi +done # Disable splaying of cron. echo > ${vdir}/etc/sysconfig/crontab -- 2.47.0