Hylafax Mailing List Archives
|
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
Re: [hylafax-users] wedged and reset scripts
Tony Delov wrote:
Hi All,
I was looking trough the the man for wedged.
It talks about a reset modem script.
" If there exists an executable file /var/spool/hylafax/etc/resetmodem
then that file will be executed upon execution of the wedged
script in
an effort to recover the modem."
Has anyone got any scripts that they use ?
I've searched around for any on the net.. but haven't come across any yet.
Tony,
The script will depend on your particular setup. In our environment
(using Vyacheslav Frolov's t38modem), the following script resets a
failed instance of t38modem when it is detected as 'wedged' by HylaFAX:
[root@hylafax]# cat resetmodem
#!/bin/bash
# this is ran from the 'wedged' script, with the $device parameter
'/dev/ttyx0' for example
DEV="`basename $1`"
#echo "Device is ${DEV}"
PID="`ps -C t38modem -o pid,cmd | grep ${DEV} | grep -v grep| awk
'{print $1}'`"
#echo "PID is ${PID}"
# try a nice kill first
kill ${PID} >/dev/null 2>&1
sleep 10
# enough playing - kill for real now
kill -9 ${PID} >/dev/null 2>&1
exit
As you can see, the above simply tries to kill the rogue t38modem
process, however, we run t38modem instances from inside /etc/inittab,
which ensures they are re-started properly after such an abrupt kill.
[root@hylafax]# ps -C t38modem -o pid,cmd
PID CMD
23558 /usr/local/bin/t38modem -p ttyya
3610 /usr/local/bin/t38modem -p ttyy0
10969 /usr/local/bin/t38modem -p ttyyb
8545 /usr/local/bin/t38modem -p ttyxb
29360 /usr/local/bin/t38modem -p ttyx7
hope the above is useful, cheers,
Jordan Kojouharov
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*