Starting TwonkyVision automatically

40 views
Skip to first unread message

MikeG

unread,
Sep 3, 2010, 6:33:35 AM9/3/10
to DealExtreme NAS
Hi all,

I've successfully got TwonkyVision to work on my wlx-652 by following
instructions found on
http://mybookworld.wikidot.com/forum/t-72617/installing-twonky

I had difficulty extracting the twonky zip using a shell, so instead:

1) Created a directory called TwonkyVision (my usb Hdd is called
"USBHDD"):
mkdir /usb/USBHDD/TwonkyVision
cd /usb/USBHDD/TwonkyVision

2) CHMODded the TwonkyVision directory to 777 when logged in as root
chmod 777 /usb/USBHDD/TwonkyVision

3) Downloaded the ARM for TwonkyVision
http://twonkyforum.com/downloads/5.1.2/twonkymedia-armel-uclibc-0.9.28-5.1.2.zip

4) Extracted the twonkymedia-armel-uclibc-0.9.28-5.1.2.zip on my PC
and FTP'd the extracted files to the TwonkyVision directory on my
wlx-652

I'm able to run TwonkyVision from the shell:
sh twonkymedia.sh start

But ideally I'd like to get it working automatically when powering up
my wlx-652

A little research indicates that I should be able to do this in the /
etc/init.d directory but I don't know how SnakeOS will start such a
script on it's own, so need some advice.

I've already tried modding one of the existing scripts (transmission)
in the init.d directory to include the start and stop for twonky
between existing start and stop script

/usr/local/TwonkyVision/twonkymedia.sh start
and
/usr/local/TwonkyVision/twonkymedia.sh stop

But it doesn't seem that my changes get permanently saved as my edited
script appears to be ovewritten when I restart the transmission
service in SnakeOS


The bottom line is that I'd like SnakeOS to start up the twonkymedia
script, so is it possible?

thanks,
MikeG

Joakim Berge

unread,
Sep 3, 2010, 7:03:40 PM9/3/10
to dealextr...@googlegroups.com
Yes it is possible.
Look at the howto section.
You will find a guide for getting chroot and sshd to run at bootup by
replacing the telnet service.
You can use the same procedure.

Good luck.

- Joakim

> --
> You received this message because you are subscribed to the Google
> Groups "DealExtreme NAS" group.
> To post to this group, send email to dealextr...@googlegroups.com
> To unsubscribe from this group, send email to
> dealextreme-na...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/dealextreme-nas-?hl=en

MikeG

unread,
Sep 4, 2010, 6:44:24 AM9/4/10
to DealExtreme NAS
Where's the link for this? I've tried to find the howto haven't had
any luck.

Thanks,
Mike

On Sep 4, 12:03 am, Joakim Berge <joakim.be...@gmail.com> wrote:
> Yes it is possible.
> Look at the howto section.
> You will find a guide for getting chroot and sshd to run at bootup by
> replacing the telnet service.
> You can use the same procedure.
>
> Good luck.
>
> - Joakim
>
> On 3. sep. 2010, at 12:33, MikeG <geiles...@googlemail.com> wrote:
>
>
>
> > Hi all,
>
> > I've successfully got TwonkyVision to work on my wlx-652 by following
> > instructions found on
> >http://mybookworld.wikidot.com/forum/t-72617/installing-twonky
>
> > I had difficulty extracting the twonky zip using a shell, so instead:
>
> > 1) Created a directory called TwonkyVision (my usb Hdd is called
> > "USBHDD"):
> > mkdir /usb/USBHDD/TwonkyVision
> > cd /usb/USBHDD/TwonkyVision
>
> > 2) CHMODded the TwonkyVision directory to 777 when logged in as root
> > chmod 777  /usb/USBHDD/TwonkyVision
>
> > 3) Downloaded the ARM for TwonkyVision
> >http://twonkyforum.com/downloads/5.1.2/twonkymedia-armel-uclibc-0.9.2...
> >http://groups.google.com/group/dealextreme-nas-?hl=en- Hide quoted text -
>
> - Show quoted text -

Joakim Berge

unread,
Sep 4, 2010, 7:18:47 PM9/4/10
to dealextr...@googlegroups.com
code.google.com/p/snake-os/wiki/Debian_Chroot

It is in the comments.

- Joakim

MikeG

unread,
Sep 6, 2010, 6:32:23 AM9/6/10
to DealExtreme NAS
Forgive me if I've being stupid, but does that imply that I need to
install debian_chroot, or are you referring to this line only:

"Drop out one of your services (note: this could be done prettier by
modifying /usr/share/snakeos/rc.sysinit, what self-respecting computer
geek uses telnet anyhow ;) ) to get this booted on startup:
mv /etc/init.d/telnet /etc/init.d/telnet.nothankyou ln -s /etc/init.d/
chroot-ssh-init.sh /etc/init.d/telnet"

I've already tried changing and saving (using VI) the telnet script in
the /etc/init.d directory to include my twonkymedia.sh but it
disappears from the telnet script whenever I restart the 652


This is my modified telnet script:

#!/bin/sh
#

KIND="TELNET"
ENABLE=$(sed -n "s/^\(telnet_enable\)=\(.*\)$/\2/p" /etc/default/
config

start() {
/usb/USBHDD/TwonkyVision/twonkymedia.sh start
if [ $ENABLE -eq 1 ] ; then
PID=$(pgrep -f "telnetd")
if [ ${PID:-empty} = "empty" ] ; then
echo "Starting $KIND service..."
/usr/sbin/telnetd &
fi
fi
}

stop() {
/usb/USBHDD/TwonkyVision/twonkymedia.sh stop
echo "Shutting down $KIND service..."
pkill -f -9 "telnetd"
}

restart() {
stop
sleep 1
start
}

webstatus(){
PID=$(pgrep -f "telnetd")
if [ ${PID:-empty} = "empty" ] ; then
echo -n "$KIND is not running"
else
echo -n "$KIND is running"
fi
}

case "$1" in
start)
start
sleep 1
;;
- telnet 1/57 1%


The problem I get is that my entries totally disappear whenever the
wlx-652 is rebooted.


-Mike



On Sep 5, 12:18 am, Joakim Berge <joakim.be...@gmail.com> wrote:
> code.google.com/p/snake-os/wiki/Debian_Chroot
>
> It is in the comments.
>
> - Joakim
>
> >>>http://groups.google.com/group/dealextreme-nas-?hl=en-Hide quoted text -

MikeG

unread,
Sep 6, 2010, 12:27:34 PM9/6/10
to DealExtreme NAS
I got an update.
I've been able to add my start script to the swapsvc file in init.d:

#!/bin/sh
#


KIND="Swap"


start() {
/usb/USBHDD/TwonkyVision/twonkymedia.sh start
USE_SWAP=$(grep "use_swap=" /etc/default/config | cut -d = -f 2)
if [ $USE_SWAP -eq 1 ] ; then
SWAP_FILE=$(grep "swapfile=" /etc/default/config | cut -d = -f
2)
if [ ${SWAP_FILE:-empty} = "empty" ] ; then
echo "Swapfile was not set. Please set it first."
else
if [ -f $SWAP_FILE ] ; then
SWAPSTATE=$(dd if=$SWAP_FILE ibs=1 skip=4086 count=10
2>/dev/nul
if [ $SWAPSTATE = "SWAPSPACE2" ]
then
echo "Starting $KIND service..."
swapon $SWAP_FILE &
else
echo "Swapfile not recognized. Delete it or change
config."
fi
else
echo "Creating swapfile... it may take a while."
SWAP_MOUNTED=$(echo ${SWAP_FILE} | cut -d '/' -f 3)
for MOUNT in $(mount | grep "/usb/" | cut -d ' ' -f 3
| cut -d '
if [ $MOUNT = $SWAP_MOUNTED ] ; then
FOUND=1
dd if=/dev/zero of=$SWAP_FILE bs=1024
count=262144 2>/de
mkswap $SWAP_FILE
echo "Starting $KIND service..."
swapon $SWAP_FILE &
fi
done
if [ ${FOUND:-0} -eq 0 ] ; then
echo "Swap disk not mounted. Mount it or change
config."
fi

fi
fi
fi
}


....and this does actually stay in the swapsvc file even after a
restart. Unfortunately this still doesn't start up Twonky though.
Am I doing anything wrong?
BTW I'm able to start up Twonky fine by telnet: /usb/USBHDD/
TwonkyVision/twonkymedia.sh start

thanks,
Mike
> > >>>http://groups.google.com/group/dealextreme-nas-?hl=en-Hidequoted text -
>
> > >> - Show quoted text -
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "DealExtreme NAS" group.
> > > To post to this group, send email to dealextr...@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > dealextreme-na...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/dealextreme-nas-?hl=en-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -

adhiprana

unread,
Sep 7, 2010, 2:49:40 AM9/7/10
to DealExtreme NAS
hi mike,
maybe you could use cron job to make your script automatically startup
after edit the cron job,restart the cron daemon then go to snakeos web
go to system=>config=> save config
then your script will be automatically started up every time reboot

*/5 * * * * root /etc/scriptfile.sh

sample of the script :
<content of scriptfile.sh>
#!/bin/sh
SERVICE='twonkymedia'

if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "$SERVICE service running, everything is fine"
else
echo "$SERVICE is not running"
/usb/USBHDD/TwonkyVision/twonkymedia.sh start
fi

entry in cron
> > > >>>http://groups.google.com/group/dealextreme-nas-?hl=en-Hidequotedtext -
>
> > > >> - Show quoted text -
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > > > Groups "DealExtreme NAS" group.
> > > > To post to this group, send email to dealextr...@googlegroups.com
> > > > To unsubscribe from this group, send email to
> > > > dealextreme-na...@googlegroups.com
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/dealextreme-nas-?hl=en-Hidequoted text -
>

MikeG

unread,
Sep 7, 2010, 5:37:41 AM9/7/10
to DealExtreme NAS
No problem,

I'll give that a go.
So, do I create scriptfile.sh in /etc/cron.d, or do I edit the "root"
file (this is currently the only file) located in cron.d to include
the line "*/5 * * * * root /etc/scriptfile.sh" ?

Currently "root" in the chron.d directory contains:

10 * * * * /usr/share/snake/setntp
~
~
~
~
~
~

thanks,
Mike
Reply all
Reply to author
Forward
0 new messages