From 4ab51d168b29a512f3ac1852332e7e8e6e2e0638 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 20 Feb 2009 17:47:59 +0100 Subject: [PATCH] Run commands requiring network access through "timeout 10" by default --- debian/changelog | 4 +++- etc/grml/fai/grml/grml_cleanup_chroot.online | 22 ++++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 84be938..ac3e372 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,8 +22,10 @@ grml-live (0.9.9) unstable; urgency=low [Closes: issue492] * Do no longer use the bootoption lang=us by default. We use it by default in grml-autoconfig anyway and this shortens our /proc/cmdline. + * Run commands requiring network access through 'timeout 10' by default + if possible. [Closes: issue396] - -- Michael Prokop Fri, 20 Feb 2009 17:06:24 +0100 + -- Michael Prokop Fri, 20 Feb 2009 17:47:11 +0100 grml-live (0.9.8) unstable; urgency=low diff --git a/etc/grml/fai/grml/grml_cleanup_chroot.online b/etc/grml/fai/grml/grml_cleanup_chroot.online index d80c882..25f67f6 100755 --- a/etc/grml/fai/grml/grml_cleanup_chroot.online +++ b/etc/grml/fai/grml/grml_cleanup_chroot.online @@ -9,18 +9,28 @@ # misc stuff umask 022 . /etc/grml/lsb-functions || exit 6 + [ -x /usr/bin/timeout ] && TIMEOUT="10" || TIMEOUT="" if [ -x /usr/bin/freshclam ] ; then einfo "Updating clamav database via running freshclam" - /usr/bin/freshclam ; eend $? + if [ -n "$TIMEOUT" ] ; then + timeout $TIMEOUT /usr/bin/freshclam ; eend $? + else + /usr/bin/freshclam ; eend $? + fi else ewarn "freshclam not installed" ; eend 0 fi if [ -x /usr/bin/update-pciids ] ; then einfo "Updating PCI- and USB-ids" - update-pciids || echo "Warning: update-pciids was not successfull">&2 - update-usbids || echo "Warning: update-usbids was not successfull">&2 + if [ -n "$TIMEOUT" ] ; then + timeout $TIMEOUT update-pciids || echo "Warning: update-pciids was not successfull">&2 + timeout $TIMEOUT update-usbids || echo "Warning: update-usbids was not successfull">&2 + else + update-pciids || echo "Warning: update-pciids was not successfull">&2 + update-usbids || echo "Warning: update-usbids was not successfull">&2 + fi eend $? else ewarn "update-pciids/update-usbids not installed" ; eend 0 @@ -28,7 +38,11 @@ fi if [ -x /usr/sbin/nessus-update-plugins ] ; then einfo "Updating nessus-plugins" - nessus-update-plugins || echo "Warning: nessus-update-plugins was not successfull">&2 + if [ -n "$TIMEOUT" ] ; then + timeout $TIMEOUT nessus-update-plugins || echo "Warning: nessus-update-plugins was not successfull">&2 + else + nessus-update-plugins || echo "Warning: nessus-update-plugins was not successfull">&2 + fi eend $? else ewarn "nessus-update-plugins not installed" ; eend 0 -- 2.1.4