Added the 'packages' disco ball that installs and removes packages for you from parameters. Minor fixups to disco-fs-diff. Fixed a bug in disco-ball where files would not get deleted, and .unionfs was rsynced back into /.

This commit is contained in:
2012-08-23 19:39:07 -04:00
parent c000ebba48
commit 68c32cadf3
5 changed files with 32 additions and 3 deletions

View File

@@ -0,0 +1 @@
yum remove -y -d 0 -e 0

View File

@@ -0,0 +1 @@
yum install -y -d 1 -e 0

View File

@@ -0,0 +1,25 @@
#!/bin/bash
#########################
#
# 00-installpkgs.sh
#
# For each package listed under $(hostname)/packages/[present|absent],
# install/remove the package there using the package management
# commands under $(hostname)/packages/commands/[present|absent].
#########################
HOSTNAME=$(hostname)
RETVAL=0
for op in present absent
do
PKGCMD=$(disco-param get ${HOSTNAME}/packages/commands/${op})
for pkgname in $(disco-param keys ${HOSTNAME}/packages/${op})
do
$PKGCMD $pkgname
RETVAL=$(expr $RETVAL + $?)
done
done
exit $RETVAL

View File

@@ -25,7 +25,7 @@ do
MD5_NEW=$(md5sum ${DISCOROOT}/scratchfs${FNAME} 2>/dev/null| cut -d " " -f 1) MD5_NEW=$(md5sum ${DISCOROOT}/scratchfs${FNAME} 2>/dev/null| cut -d " " -f 1)
STAT_NEW=$(chroot ${DISCOROOT}/chroot stat --format "owner='%G:%U', selinux='%C', md5='${MD5_NEW}'" /${FNAME} 2>/dev/null) STAT_NEW=$(chroot ${DISCOROOT}/chroot stat --format "owner='%G:%U', selinux='%C', md5='${MD5_NEW}'" /${FNAME} 2>/dev/null)
if [ ! -d ${FNAME} ] && [ ! -d ${DISCOROOT}/scratchfs${FNAME} ]; then if [ ! -d ${FNAME} ] && [ ! -d ${DISCOROOT}/scratchfs${FNAME} ]; then
diff -N ${FNAME} ${DISCOROOT}/scratchfs${FNAME} 2>/dev/null > /tmp/$$.diff diff -N ${FNAME} ${DISCOROOT}/scratchfs${FNAME} 2>/dev/null | grep -v "^Binary file" > /tmp/$$.diff
fi fi
echo "${LINE}, ${STAT_NEW}" echo "${LINE}, ${STAT_NEW}"
if [ -f /tmp/$$.diff ]; then if [ -f /tmp/$$.diff ]; then

View File

@@ -129,12 +129,14 @@ function spin() {
/usr/bin/time -f "$TIME" -o /var/disco/reports/${module}/diff disco-fs-diff /usr/bin/time -f "$TIME" -o /var/disco/reports/${module}/diff disco-fs-diff
if [ "$NOOP" == "" ]; then if [ "$NOOP" == "" ]; then
# Now for the real rsync back home # Now for the real rsync back home
rsync -aWH /var/disco/testfs/real/scratchfs/. /
cd /var/disco/testfs/real/scratchfs/.unionfs cd /var/disco/testfs/real/scratchfs/.unionfs
for file in $(find . -iname "_HIDDEN~" -type f); for file in $(find . -iname "*_HIDDEN~" | sed -e s/"^\."/""/g -e s/"_HIDDEN~$"/""/g);
do do
rm -rf /${file} rm -rf /${file}
done done
cd ..
rm -rf ./.unionfs
rsync -aWH /var/disco/testfs/real/scratchfs/. /
fi fi
rm -rf /var/disco/testfs/noop/scratchfs/* rm -rf /var/disco/testfs/noop/scratchfs/*
rm -rf /var/disco/testfs/real/scratchfs/* rm -rf /var/disco/testfs/real/scratchfs/*