I have the following problem:
amuled sometimes crashes. Thats why I written a small restart-script:
#!/bin/sh
LOG=/home/username/amule_watch.log
TCPPORT=4669
if netstat -n -l | grep -q 14669 ; then
echo "ok"
else
echo "Neustart --> `date`" >> ${LOG}
/etc/init.d/amule stop
sleep 30
/etc/init.d/amule start
fi
It just checks if the amuled is still running and if not it restarts amuled :
when I run this script from bash its all ok. It tells me "ok" or it stops the amuled, wait 30 seconds and start it again with following output
Stopping amuled: Starting amuled: amuled: OnInit - starting timer
Initialising aMule
Checking if there is an instance already running...
No other instances are running.
amuled: forking to background - see you
amuled.
now I tried to setup a cron job:
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/amulewatchdog.sh
when amuled is still running, all is ok. But when amuled is not running anymore, the script should restart it.
but everytime when cron starts the script the following error is mailed:
From root@xxxx.xxxx Wed Feb 20 19:10:33 2008
X-Original-To: root
Delivered-To: root@xxxx.xxxx
From: root@xxxx.xxxx
To: root@xxxx.xxxx
Subject: Cron <root@eselchen> /usr/local/bin/amulewatchdog.sh
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Date: Wed, 20 Feb 2008 19:05:01 +0100 (CET)
Stopping amuled: Starting amuled: Assertion failed: Path.cpp:CPath:259: Assertion 'm_filesystem.Length()' failed.
Backtrace follows:
[4] CPath in Path.cpp:260
[5] CKnownFile::LoadTagsFromFile(CFileDataIO const*) in KnownFile.cpp:529
[6] CKnownFile::LoadFromFile(CFileDataIO const*) in KnownFile.cpp:634
[7] CKnownFileList::Init() in KnownFileList.cpp:97
[8] CKnownFileList in KnownFileList.cpp:58
[9] CamuleApp::OnInit() in amule.cpp:710
[10] CamuleDaemonApp::OnInit() in amuled.cpp:607
[11] wxAppConsole::CallOnInit() in app.h:76
[12] wxEntry(int&, wchar_t**) in /usr/local/lib/libwx_baseud-2.8.so.0[0xb7e31f4e]
[13] wxEntry(int&, char**) in /usr/local/lib/libwx_baseud-2.8.so.0[0xb7e32180]
[14] main in amuled.cpp:102
[15] __libc_start_main in /lib/libc.so.6[0xb7b34fe0]
[16] _start in :0
It only crashes when started with cron. When I start the script directly it s all ok.