[Asterisk-Users] Asterisk died - exactly every 60 minutes
Ronald Wiplinger
ronald at elmit.com
Tue Jun 21 15:20:04 MST 2005
Sebastian Silva wrote:
> To see the entire log, in logger.conf:
>
> full => notice,warning,error,debug,verbose
>
> then:
>
> "tail -f /var/log/asterisk/full"
>
> in other console run asterisk, you will see all log output in the
> previous console and why asterisk stops.
>
Sebas,
The full file did not show anything, but at the console, where I run
safe_asterisk showed this:
/usr/sbin/safe_asterisk: line 41: 1979 Segmentation fault (core
dumped) asterisk ${CLIARGS} ${ASTARGS} >&/dev/${TTY} </dev/${TTY}
Asterisk ended with exit status 139
Asterisk exited on signal 11.
Automatically restarting Asterisk.
Do you have an idea why?
In case something wrong with the safe_asterisk, I copy it below.
bye
Ronald
/usr/sbin/safe_asterisk
#!/bin/sh
CLIARGS="$*" # Grab any args passed to safe_asterisk
TTY=9 # TTY (if you want one) for Asterisk to run on
CONSOLE=yes # Whether or not you want a console
NOTIFY=ronald at elmit.com # Who to notify about crashes
MACHINE="vpbx" # To specify which machine has crashed when
getting the mail
DUMPDROP=/tmp
#
# Don't fork when running "safely"
#
ASTARGS=""
if [ "$TTY" != "" ]; then
if [ -c /dev/tty${TTY} ]; then
TTY=tty${TTY}
elif [ -c /dev/vc/${TTY} ]; then
TTY=vc/${TTY}
else
echo "Cannot find your TTY (${TTY})" >&2
exit 1
fi
ASTARGS="${ASTARGS} -vvvg"
if [ "$CONSOLE" != "no" ]; then
ASTARGS="${ASTARGS} -c"
fi
fi
if [ ! -w ${DUMPDROP} ]; then
echo "Cannot write to ${DUMPDROP}" >&2
exit 1
fi
#
# Let Asterisk dump core
#
ulimit -c unlimited
#launch_asterisk()
#{
#}
run_asterisk()
{
while :; do
if [ "$TTY" != "" ]; then
cd /tmp
stty sane < /dev/${TTY}
asterisk ${CLIARGS} ${ASTARGS} >& /dev/${TTY} <
/dev/${TTY}
else
cd /tmp
asterisk ${CLIARGS} ${ASTARGS}
fi
EXITSTATUS=$?
echo "Asterisk ended with exit status $EXITSTATUS"
if [ "$EXITSTATUS" = "0" ]; then
# Properly shutdown....
echo "Asterisk shutdown normally."
exit 0
elif [ $EXITSTATUS -gt 128 ]; then
let EXITSIGNAL=EXITSTATUS-128
echo "Asterisk exited on signal $EXITSIGNAL."
if [ "$NOTIFY" != "" ]; then
echo "Asterisk on $MACHINE exited on
signal $EXITSIGNAL. Might want to take a peek." | \
mail -s "Asterisk Died" $NOTIFY
fi
if [ -f /tmp/core ]; then
mv /tmp/core
${DUMPDROP}/core.`hostname`-`date -Iseconds` &
fi
else
if [ "${EXITSTATUS}" = "0" ]; then
echo "Asterisk ended normally. Aborting."
exit 0
else
echo "Asterisk died with code $EXITSTATUS."
if [ -f /tmp/core ]; then
mv /tmp/core
${DUMPDROP}/core.`hostname`-`date -Iseconds` &
fi
fi
fi
echo "Automatically restarting Asterisk."
sleep 4
done
}
run_asterisk &
> Sebas
>
> Ronald Wiplinger wrote:
>
>> I have now a very strange situation.
>>
>> Asterisk dies exactly every hour at hour:09 !!!
>>
>> crontab has the entry:
>> 10 3 * * * root /usr/sbin/asterisk-restart >/dev/null 2>&1
>>
>> It seems that there is a time difference between mail server and
>> asterisk server so that it might be "synchronized" to the crontab entry.
>>
>> *CLI> show version
>> Asterisk CVS-HEAD built by root at vpbx on a x86_64 running Linux on
>> 2005-06-18 14:53:44
>>
>> I don't know anymore where to look at, and how to track this down.
>>
>> Can anybody give me a hint???
>>
>>
>> bye
>>
>> Ronald
>>
>> _______________________________________________
>> Asterisk-Users mailing list
>> Asterisk-Users at lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>> To UNSUBSCRIBE or update options visit:
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
--
Ronald Wiplinger (CEO of ELMIT)
http://www.elmit.com +886 (0) 939--77-55-16 or FWD 511208
- I'm a SpamCon Foundation Member, #694, Verify it at http://www.spamcon.org
PS: Spam prevention!
Our system is protected with a spam prevention program.
If you send us an e-mail, our system will send you a confirmation message back. Just reply to this confirmation message please.
After receiving this confirmation message, our system will send the hold message (one) and all future messages (after the received confirmation message) to me without asking you again.
More information about the asterisk-users
mailing list