Thursday, November 29, 2007

Embedded Linux development tools

I read a number of articles about embedded Linux development tools. Some claimed that these tools do not exist, yet another one tried to convince everybody that embedded Linux tools do not exist because there is no market for them.

My recent article at Embedded Systems Design magazine briefly mentions a few commercial offerings (yes, these tools exist and the companies that produce them are profitable), but it concentrates mostly on what you can do (hint - quite a lot) if you chose the do-it-yourself approach to embedded Linux tools.

Friday, November 02, 2007

aMule restart script

Accidentally discovered that some people still use my old aMule watchdog script. The script can be downloaded here. It is quite trivial - it simply checks from time to time that somebody is still listening on the aMule port. Since aMule tends to crash and freeze quite often (at least used to when I was using it) it is rather handy.

The script:

#!/bin/sh

# aMule watchdog
# Checks on aMule every 5 (configurable parameter) minutes
# and restarts it if aMule does not respond.
# Requires Netcat
#
# Created by Demiurg - sasha.sirotkin [AT] gmail.com
# Have fun.

MULENAME=amule
MULE=`which ${MULENAME}`
NC=`which nc`

TCPPORT=4642
SLEEP=300

test -e ${MULE} || (echo "${MULE} not found. Dying" ; exit 1)
test -e ${NC} || (echo "Netcat not found. Dying" ; exit 1)

FIRSTLOOP=1

rm ~/.aMule/muleLock

while true; do
# echo "Waiting"
test ${FIRSTLOOP} || sleep ${SLEEP}
unset FIRSTLOOP
# echo "Checking"
nc localhost ${TCPPORT} < /dev/null && continue
echo "Restarting"
date
killall -9 ${MULENAME}
sleep 1
${MULE} &
# echo "Running"
done

Labels: , , ,