[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: The XDM trap



On Tue, 7 Jul 1998, Michael Alan Dorman wrote:

(in reply to what some other people wrote, but i've accidentally deleted
the attributions):
> > > .... The monitor is switching continuously between graphical mode
> > > and text mode, login is impossible via console. If you are lucky,
> > > you have already a working network connection and can stop xdm via
> > > a remote login.
> >
> > This problem actually happens to a LOT of people, and absolutely
> > freaks newbies out to no end.
>
> It's also one of the few places old DOS habits can help you out---when
> that happens, I find it enough to just keep hitting Ctrl-Alt-Del until
> init catches it, and closes everything down.  Then reboot into single
> user mode.

a better solution would be for the xdm startup script to keep track of
the time for the last, say, 5 or 10 times that xdm was started. if xdm
starts too often in too short a time (say 5+ times in a minute), then
terminate.

the squid RunCache program does something like this. it's job is to
restart squid in case squid dies. it won't start squid too often,
though. looks like it stops trying to restart squid if squid runs for
less than 5 seconds more than 5 times in succession.

an extract from /usr/lib/squid/RunCache:

failcount=0
while : ; do
        echo "`date`: Running: squid -D -s $conf >> $L 2>&1" >>$L
        if [ $failcount -gt 0 ]
        then
          echo "`date`: Running: squid -D -s $conf >> $L 2>&1"
        fi
        start=`date '+%d%H%M%S'`
        squid -D -s $conf >> $L 2>&1
        stop=`date '+%d%H%M%S'`
        t=`expr $stop - $start`
        if test 0 -le $t -a $t -lt 5 ; then
                failcount=`expr $failcount + 1`
        else
                failcount=0
        fi
        if test $failcount -gt 5 ; then
          echo "`date`: RunCache: EXITING DUE TO REPEATED FREQUENT FAILURES" >&2
          echo "`date`: RunCache: EXITING DUE TO REPEATED FREQUENT FAILURES" >$L
          exit 1
        fi
        sleep 10
done

it's not the most 'elegant' sh code (i'd write it differently...because
it's debian, i could assume gnu date and bash 2.x were available) but it
does the job for squid. a variation of this could do the job for xdm.

craig

--
craig sanders


--  
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: