Date: Thu, 3 Nov 2011 12:24:45 +0000 (UTC) From: Mark Linimon <linimon@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r227057 - projects/portbuild/scripts Message-ID: <201111031224.pA3COjWT070355@svn.freebsd.org>
index | next in thread | raw e-mail
Author: linimon (doc,ports committer) Date: Thu Nov 3 12:24:44 2011 New Revision: 227057 URL: http://svn.freebsd.org/changeset/base/227057 Log: Make these scripts' error messages a bit more verbose. Modified: projects/portbuild/scripts/clean-chroot projects/portbuild/scripts/cleanup-chroots projects/portbuild/scripts/cleanup-tmp Modified: projects/portbuild/scripts/clean-chroot ============================================================================== --- projects/portbuild/scripts/clean-chroot Thu Nov 3 12:03:03 2011 (r227056) +++ projects/portbuild/scripts/clean-chroot Thu Nov 3 12:24:44 2011 (r227057) @@ -12,7 +12,7 @@ kill_procs() while [ ! -z "${pids}" ]; do pids=$(fstat -f "${dir}${mount}" | tail +2 | awk '{print $3}' | sort -u) if [ ! -z "${pids}" ]; then - echo "Killing off pids in ${dir}" + echo "clean-chroot: Killing off pids in ${dir}" ps -p $pids kill -KILL ${pids} 2> /dev/null sleep 2 @@ -27,11 +27,11 @@ cleanup_mount() { if [ -d ${chroot}${mount} ]; then mdir=$(fstat -f ${chroot}${mount} | head -2 | tail -1 | awk '{print $5}') if [ "${mdir}" = "MOUNT" ]; then - umount -f ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} on $(hostname) failed!" + umount -f ${chroot}${mount} || echo "clean-chroot: Cleanup of ${chroot}${mount} on $(hostname) failed!" fi if [ "${mdir}" = "${chroot}${mount}" ]; then kill_procs ${chroot} ${mount} - umount -f ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} on $(hostname) failed!" + umount -f ${chroot}${mount} || echo "clean-chroot: Cleanup of ${chroot}${mount} on $(hostname) failed!" fi fi } Modified: projects/portbuild/scripts/cleanup-chroots ============================================================================== --- projects/portbuild/scripts/cleanup-chroots Thu Nov 3 12:03:03 2011 (r227056) +++ projects/portbuild/scripts/cleanup-chroots Thu Nov 3 12:24:44 2011 (r227057) @@ -25,7 +25,7 @@ kill_procs() while [ ! -z "${pids}" ]; do pids=$(fstat -f "$dir" | tail +2 | awk '{print $3}' | sort -u) if [ ! -z "${pids}" ]; then - echo "Killing off pids in ${dir} on $(hostname)" + echo "cleanup-chroots: Killing off pids in ${dir} on $(hostname)" ps -p $pids kill -KILL ${pids} 2> /dev/null sleep 2 @@ -42,11 +42,11 @@ cleanup_mount() { if [ -d ${chroot}${mount} ]; then mdir=$(fstat -f ${chroot}${mount} | head -2 | tail -1 | awk '{print $5}') if [ "${mdir}" = "MOUNT" ]; then - umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} on $(hostname) failed!" + umount ${chroot}${mount} || echo "cleanup-chroots: Cleanup of ${chroot}${mount} on $(hostname) failed!" fi if [ "${mdir}" = "${chroot}${mount}" ]; then kill_procs ${chroot}${mount} - umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} on $(hostname) failed!" + umount ${chroot}${mount} || echo "cleanup-chroots: Cleanup of ${chroot}${mount} on $(hostname) failed!" fi fi } @@ -58,7 +58,7 @@ cleanup_all() { mounts=$(mount | grep ${chroot} | awk '{print $3}') if [ ! -z "${mounts}" ]; then if [ $VERBOSE ]; then - echo "trying to kill off mounts:" + echo "cleanup-chroots: trying to kill off mounts:" echo ${mounts} echo fi @@ -90,12 +90,12 @@ else fi if [ ! -z "${old_chroots}" ]; then - echo "non-empty chroots > 1 hr old found on $(hostname):" + echo "cleanup-chroots: non-empty chroots > 1 hr old found on $(hostname):" echo ${old_chroots} echo else if [ $VERBOSE ]; then - echo "no non-empty chroots > 1 hr old found on $(hostname)." + echo "cleanup-chroots: no non-empty chroots > 1 hr old found on $(hostname)." echo fi fi @@ -117,12 +117,12 @@ if [ ! -z "${old_chroots}" ]; then fi if [ ! -z "${stale_chroots}" ]; then - echo "non-empty, > 1 hr old stale chroots found on $(hostname):" + echo "cleanup-chroots: non-empty, > 1 hr old stale chroots found on $(hostname):" echo ${stale_chroots} echo else if [ $VERBOSE ]; then - echo "no non-empty, > 1 hr old stale chroots found on $(hostname)." + echo "cleanup-chroots: no non-empty, > 1 hr old stale chroots found on $(hostname)." echo fi fi @@ -162,12 +162,12 @@ for build in ${builds}; do done if [ ! -z "${stale_builds}" ]; then - echo "empty stale builds found on $(hostname):" + echo "cleanup-chroots: empty stale builds found on $(hostname):" echo ${stale_builds} echo else if [ $VERBOSE ]; then - echo "no empty stale builds found on $(hostname)." + echo "cleanup-chroots: no empty stale builds found on $(hostname)." echo fi fi @@ -178,7 +178,7 @@ if [ ! -z "${stale_builds}" ]; then # XXX MCL HACK! what I really want is "give me the next 2 subdirs after $build" mounts=$(mount | grep "${build}" | awk '{print $3}' | grep -E "/dev$") if [ $VERBOSE ]; then - echo "suspected stale mounts on $(hostname):" + echo "cleanup-chroots: suspected stale mounts on $(hostname):" echo ${mounts} echo fi Modified: projects/portbuild/scripts/cleanup-tmp ============================================================================== --- projects/portbuild/scripts/cleanup-tmp Thu Nov 3 12:03:03 2011 (r227056) +++ projects/portbuild/scripts/cleanup-tmp Thu Nov 3 12:24:44 2011 (r227057) @@ -30,37 +30,37 @@ old_script_caches=$(find /tmp/2* -type d old_setupnodes=$(find /tmp/setupnode.* -type f -prune -mmin +${REMOVE_SETUPNODE_TIME} 2> /dev/null) if [ ! -z "${old_dotsetupdirs}" ]; then - echo "non-empty stale dotsetupdirs found on $(hostname):" + echo "cleanup-tmp: non-empty stale dotsetupdirs found on $(hostname):" echo ${old_dotsetupdirs} echo rm -rf ${old_dotsetupdirs} else if [ $VERBOSE ]; then - echo "no non-empty stale dotsetupdirs found on $(hostname)." + echo "cleanup-tmp: no non-empty stale dotsetupdirs found on $(hostname)." echo fi fi if [ ! -z "${old_script_caches}" ]; then - echo "non-empty stale script_caches found on $(hostname):" + echo "cleanup-tmp: non-empty stale script_caches found on $(hostname):" echo ${old_script_caches} echo rm -rf ${old_script_caches} else if [ $VERBOSE ]; then - echo "no non-empty stale script_caches found on $(hostname)." + echo "cleanup-tmp: no non-empty stale script_caches found on $(hostname)." echo fi fi if [ ! -z "${old_setupnodes}" ]; then - echo "non-empty stale setupnodes found on $(hostname):" + echo "cleanup-tmp: non-empty stale setupnodes found on $(hostname):" echo ${old_setupnodes} echo rm -rf ${old_setupnodes} else if [ $VERBOSE ]; then - echo "no non-empty stale setupnodes found on $(hostname)." + echo "cleanup-tmp: no non-empty stale setupnodes found on $(hostname)." echo fi fihelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111031224.pA3COjWT070355>
