buffalojoe DD-WRT Novice
Joined: 28 Feb 2014 Posts: 1
|
Posted: Fri Feb 28, 2014 23:50 Post subject: Running process from startup script |
|
Hi,
I seriously need some advice on making my mumble server autostart on boot of my dd-wrt device..
My hardware is a Buffalo WZR-HP-AG300H currently flashed with a dd-wrt community-build (SVN rev. 23320)
I prepared a USB pendrive with serveral partitons to play with. blkid output looks like this:
Quote: | /dev/sda1: UUID="1529523679DD722E" TYPE="ntfs"
/dev/sda5: UUID="de7670d3-d1a4-4a1e-b09d-fe89a427a3a9" TYPE="ext3"
/dev/sda6: UUID="c5fd8093-3ed6-4294-99bf-ff76d66ea0ed" TYPE="swap"
/dev/sda7: UUID="da5a3c6d-d58d-493b-a6f8-c3570b8a3e0d" TYPE="ext3" |
The partitions get mounted by a startup script I wrote according to these guides:
http://g300nh.blogspot.de/2010/06/software-installation-on-dd-wrt-part-1.html
http://www.howtogeek.com/98408/how-to-install-additional-software-on-your-router-dd-wrt/
http://dd-wrt.ca/phpBB2/viewtopic.php?t=86912&highlight=optware
And the script looks like this:
Quote: | #!/bin/sh
sleep 5
insmod mbcache
insmod jbd
insmod ext3
mkdir '/mnt/part1'
mkdir '/mnt/part2'
mount -t ext3 -o noatime /dev/sda5 /mnt/part1
mount -t ext3 -o noatime /dev/sda7 /mnt/part2
swapon /dev/sda6
sleep 2
if [ -f /mnt/part1/optware.enable ];then
#mount -o bind /mnt/part2 /mnt/part1/root
mount -o bind /mnt/part1 /jffs
mount -o bind /mnt/part1/etc /etc
mount -o bind /mnt/part1/opt /opt
mount -o bind /mnt/part1/root /tmp/root
else
exit
fi
if [ -d /opt/usr ]; then
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/usr/lib:/opt/lib:/opt/usr/lib:/jffs/usr/lib:/jffs/usr/local/lib
export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/jffs/bin:/opt/bin:/opt/sbin:/opt/usr/bin:/opt/usr/sbin
else
exit
fi |
To get optware and the package manager (opkg) up and running I found the How to Geek Tutorial quite usefull so
Now I installed umurmur from the package repository and tried to start it with its startup-script /opt/etc/init.d/umurmurd.
I read about the need for a symlink in the form S??* to the script so I did a
Quote: | ln -s /opt/etc/init.d/umurmurd /opt/etc/init.d/S99murmurd |
Since I added a line that makes an entry to the syslog, I know the script is executed on boot but there is never ever a umurmur process running. Why?
The original script looks like this:
Quote: | #!/bin/sh /etc/rc.common
# Copyright (C) 2006-2008 OpenWrt.org
START=90
PIDFILE="/var/run/umurmurd.pid"
start() {
stop
"$IPKG_INSTROOT"/usr/bin/umurmurd -r -p $PIDFILE -c "$IPKG_INSTROOT"/etc/umurmur.conf
}
stop() {
[ -f "$PIDFILE" ] && kill $(cat "$PIDFILE") 2>/dev/null >/dev/null
} |
I satisfied the additional requirements like rc.common and functions.sh and so on. It works on a ssh-shell though but not on boot.
Another script I wrote myself for testing also works on the ssh-shell but not on boot. It looks like this:
Quote: | #!/bin/sh
MUMBLEPATH="${IPKG_INSTROOT}/usr/bin"
CONFIGPATH="${IPKG_INSTROOT}/etc"
PIDFILE="/var/run/umurmurd.pid"
if [ -e $PIDFILE ]; then
exit 1
fi
$MUMBLEPATH/umurmurd -r -p $PIDFILE -c $CONFIGPATH/umurmur.conf
logger -p local0.notice -t umurmurd 'umurmurd started on '`date` |
The $IPKG_INSTROOT variable is exported as /opt from /etc/profile.
With the shorter version I also tried the method described in http://www.dd-wrt.com/wiki/index.php/Startup_Scripts without success.
What am I doing wrong? Please help |
|