8.1: a SuSE cronjob hangs all my machines

From: tj (tj_at_nospam.com)
Date: 12/23/03


Date: Tue, 23 Dec 2003 20:12:03 GMT

I have several machines, mostly "barebones" PCs, used as webservers. All
have the "minimal" SuSE 8.1 Pro installation (no GUI).

The only changes I make are: configure the network settings and the apache
settings.

Every night, all machines crash after running this script in the
/etc/cron.daily directory. This and the other scripts areprovided by SuSE
and have not been modified.

/etc/cron.daily/suse.de-backup-rpmdb

When I run this particular script from the command line, my screen goes
black and the machine hangs... so you understand that I can't get any
"echoed" debug output.

I don't really need these backups, but I would like some insight as to why
they are hanging my system! Give me a few tests to run, and I will gladly
debug this sucker. From what I can see, the supporting files needed to
"source" the config variables are present, permissions are good... as
mentioned earlier - these are just as they come from the plain
installation.

Thanks

--
TJ
#!/bin/sh
#
#
# backup_rpmdb. This script was split off cron.daily
# Please add your local changes to cron.daily.local
# since this file will be overwritten, when updating your system.
#
# Copyright (c) 1996-2002 SuSE Linux AG, Nuernberg, Germany.
#
# please send bugfixes or comments to feedback@suse.de.
#
# Author: Burchard Steinbild <feedback@suse.de>, 1996
#         Florian La Roche <feedback@suse.de>, 1996
#
#
# paranoia settings
#
umask 022
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH
#
# get information from /etc/sysconfig
#
if [ -f /etc/sysconfig/backup ] ; then
    . /etc/sysconfig/backup
fi
#
# create backups of rpm data base
#
if test -n "$RPMDB_BACKUP_DIR" -a -e /var/lib/rpm/packages.rpm ; then
    mkdir -p $RPMDB_BACKUP_DIR
    OLD_MD5=""
    test -e $RPMDB_BACKUP_DIR/rpmdb_recent_md5 && \
        OLD_MD5="`cat $RPMDB_BACKUP_DIR/rpmdb_recent_md5`"
    NEW_MD5="`cat /var/lib/rpm/packages.rpm | md5sum`"
    if test "$OLD_MD5" != "$NEW_MD5" ; then
        DATESTRING=`date +"%Y%m%d"`
        NEWNAME=$RPMDB_BACKUP_DIR/packages.rpm-$DATESTRING
        NUMBER=2
        while [ -e $NEWNAME -o -e $NEWNAME.gz ] ; do
            NEWNAME=$RPMDB_BACKUP_DIR/packages.rpm-$DATESTRING-$NUMBER
            NUMBER=`expr $NUMBER + 1`
        done
        if gzip -9 < /var/lib/rpm/packages.rpm > $NEWNAME.gz; then
            echo "$NEW_MD5" > $RPMDB_BACKUP_DIR/rpmdb_recent_md5
            test "$MAX_RPMDB_BACKUPS" -gt 0 2> /dev/null || 
MAX_RPMDB_BACKUPS=0
            NUMBER=1
            for BACKUPFILE in `ls -1 -t $RPMDB_BACKUP_DIR/packages.rpm-*` ; 
do
                if test "$NUMBER" -gt "$MAX_RPMDB_BACKUPS" ; then
                    rm -f $BACKUPFILE
                fi
                NUMBER=`expr $NUMBER + 1`
            done
        else
            echo "ERROR!! can not backup RPM Database to $RPMDB_BACKUP_DIR."
            echo "Maybe there is not enough disk space."
            rm -f $NEWNAME $NEWNAME.gz
        fi
    fi
fi
exit 0


Relevant Pages

  • Re: Odd problem - Losing Network overnight
    ... >one SuSE 10.1 Beta 1 on a router. ... whereas the Mandriva and Windows machines are fine. ... BTW, the 6 machines are DHCP through a Linksys router, ... Your script might look something like this: ...
    (alt.os.linux.suse)
  • Re: Automating password change
    ... All the machines are set up differently from each other ... > use telnet, others I can rlogin or remsh, and still others I can ssh. ... it would not be practical to try to write a complex script ... > to write a simple script to wrap around passwd that would run on each ...
    (comp.unix.solaris)
  • Re: Automating password change
    ... All the machines are set up differently from each other ... > use telnet, others I can rlogin or remsh, and still others I can ssh. ... it would not be practical to try to write a complex script ... > to write a simple script to wrap around passwd that would run on each ...
    (comp.unix.shell)
  • Re: Win2000 Pro will not process logon script
    ... newer machines run the script and some of the older ones do not. ... I am not familar with the "slow link" policy. ...
    (microsoft.public.windows.server.active_directory)
  • Re: Win2000 Pro will not process logon script
    ... newer machines run the script and some of the older ones do not. ... I am not familar with the "slow link" policy. ...
    (microsoft.public.windows.server.active_directory)

Loading