!!Hello Everyone!!
I Recently purchased a Iomega iX2-200 NAS that runs a custom debian installed by Iomega (Linux Debian 5.0.2 ( 2.6.22.18 armv5tejl)) . I have SSH access. I installed Transmission since the factory installed torrents manager that Iomega uses is terrible. Transmission-daemon works like a charm, so I decided to create a script to start the transmission-daemon as a service when the NAS starts, so i don't have to ssh to the iX2-200 every day when i start it.
The script i made was the following:
#!/bin/sh
#/etc/init.d/transmission
prefix="/mnt/soho_storage/opt"
PATH=${prefix}/bin:${prefix}/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/bin:/opt/sbin:/usr/local/sbin:/usr/local/bin
NAME=transmission-daemon
CONFIGDIR=/mnt/soho_storage/samba/shares/internal
DAEMON=${prefix}/bin/${NAME}
test -x $DAEMON || exit 0
if [ -z "$1" ] ; then
case `echo "$0" | sed 's:^.*/\(.*\):\1:g'` in
S??*) rc="start" ;;
K??*) rc="stop" ;;
*) rc="usage" ;;
esac
else
rc="$1"
fi
case "$rc" in
start)
echo "Starting Torrent client: $NAME"
nice $DAEMON -g ${CONFIGDIR}
;;
stop)
#if [ -n "`pidof $NAME`" ]; then
echo "Stopping Torrent client: $NAME"
killall $NAME 2> /dev/null
#fi
;;
restart)
"$0" stop
sleep 1
"$0" start
;;
*)
echo "Usage: $0 (start|stop|restart|usage)"
echo "Since No Option was set I'm ResStarting Torrent client: $NAME"
"$0" stop
sleep 1
"$0" start
;;
esac
exit 0
after researching a little bit on the debian site i just found out that debian doesn't use rc.local to customize the boot process.. as noted here :
The Debian GNU/Linux FAQ - Customizing your installation of Debian GNU/Linux
so I did what the official debian site says I should have done:
1- Entered the custom created script "transmission" into the directory /etc/init.d/ and made it executable.
2- Ran the Debian command update-rc.d with appropriate arguments. In my case
update-rc.d transmission defaults 20
, to start the service in runlevels 2 through 5, and to stop the service in runlevels 0, 1 and 6 (Supposedly to specify which runlevels should start the service, and which runlevels should stop the service).
3- rebooting the system to check that the service starts correctly.
this created all the proper "S20transmission" and "K20transmission" symbolic links needed in the etc/rc#.d subdirectories. But after reboot the transmission-daemon wasn't running. If I run the script by hand it works fine, but it does not auto reload at startup.
I'm not a newbie but I don't work in linux nor unix since my profession is Finance. All i did was thanks to some research and a good reading in debian site.
Is anyone kind enough to tell me what am I doing wrong?
Is it possible that Iomega modified debian so no one can autorun a service on the device?
Is there a way to know what the device is actually doing at boot?
How can I Fix That?
Thanks in advance,
Best regards,