Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Mar 2003 17:09:01 +0100
From:      "Martin Tsanov" <cyberzone@odessos.org>
To:        <freebsd-questions@freebsd.org>
Subject:   cron job
Message-ID:  <000801c2f60d$8373b040$0764a8c0@cyberzone.odessos.org>

index | next in thread | raw e-mail

Hello

    I have a gateway with wireless interface wi0. From time to time it hangs down
with the following log entry in /var/log/all.log

Mar 28 22:19:37 morpheus /kernel: wi0: failed to allocate 1594 bytes on NIC
Mar 28 22:19:37 morpheus /kernel: wi0: tx buffer allocation failed
Mar 28 22:19:37 morpheus /kernel: wi0: wi_cmd: busy bit won't clear.
Mar 28 22:19:37 morpheus /kernel: wi0: failed to allocate 1594 bytes on NIC
Mar 28 22:19:37 morpheus /kernel: wi0: mgmt. buffer allocation failed
Mar 28 22:20:42 morpheus /kernel: wi0: wi_cmd: busy bit won't clear.
Mar 28 22:21:42 morpheus /kernel: wi0: wi_cmd: busy bit won't clear.

    I tried the following script, placed as a crontab entry to reboot the system:

#!/bin/sh

result=`fping 212.50.x.xxx|cut -b 17-21`
result1="alive"
if [ "$result1" = "$result" ]; then
echo $result
else
reboot
fi

This script works as expected when envoked from the shell, but when placed
as th following crontab entry:

*/10    *       *       *       *       root    /root/reb (reb is the script name)

the system reboots regardless if 212.50.x.xxx is reachable or not.

What is the difference??? And what am I doing wrong??

I'm tracking FreeBSD 4-STABLE and this is 4.8-RC FreeBSD 4.8-RC #0:

Any help will be appreciated.


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000801c2f60d$8373b040$0764a8c0>