Iomega ix2-200 Custom Debian - Autostart script in init.d not Working


 
Thread Tools Search this Thread
Operating Systems Linux Debian Iomega ix2-200 Custom Debian - Autostart script in init.d not Working
# 1  
Old 04-16-2010
Question Iomega ix2-200 Custom Debian - Autostart script in init.d not Working

!!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:

Code:
#!/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
Code:
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,

Last edited by stejimenez; 04-16-2010 at 01:46 AM.. Reason: Typos
# 2  
Old 04-19-2010
Error

Quote:
Originally Posted by stejimenez
!!Hello Everyone!!

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.

1- Is anyone kind enough to tell me what am I doing wrong?

2- Is it possible that Iomega modified debian so no one can autorun a service on the device?

3- Is there a way to know what the device is actually doing at boot?

4- How can I Fix That?

Thanks in advance,

Best regards,
Anyone Have any Idea about how to answer my 4 questions?
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

/etc/default/init LANG Setting Not Working

Hey guys, I'm setting up a new server(Fujitsu M10-4 / Solaris 10 1/13) to move our app/DB and I'm having trouble figuring out why my LANG setting is not taking effect. I'm trying to set LANG=C in the /etc/default/init file which should make it the default system wide from what I gather. However... (7 Replies)
Discussion started by: kaledragule
7 Replies

2. Programming

autostart script for stopped services

I need script that to start the stopped service when its stopped. This script always controls status of service. For example nagios service stopped script have to start nagios service. And It can send an email for notification when stopped. (6 Replies)
Discussion started by: getrue
6 Replies

3. Red Hat

init-script failing because of /etc/rc.d/init.d/functions

I encountered a problem on one of our database servers. OS: CentOS 5.5 final Kernel: 2.6.18-238.5.1.el5.028stab085.2 (OpenVZ kernel) We wrote some DB-Start/Stop-scripts ("/db2/admin/scripts_dba/start_services.ksh" and ".../stop_services.ksh") to start the database instances. (Database... (1 Reply)
Discussion started by: bakunin
1 Replies

4. Shell Programming and Scripting

Ksh93 vs. Pdksh88: Custom PS1 prompt not working

Greetings! I have to work with a NFS user id between two hosts: A running Ksh 93 and B running pdksh 88. My problem has to do with the custom prompt I created on A: it works like a charm and display colors: PS1="$'\E But I switch over to B, it all goes to hell (private info... (4 Replies)
Discussion started by: alan
4 Replies

5. Solaris

Custom short cuts not working on JDS

Hello, I had created a shortcut to open up a gnome-terminal by pressing <Alt>m. This worked fine, until I logged out and logged back in. gnome-terminal no longer opens. However, the process is created, as evidenced by the gnome-terminal showing up on my process list. I've created and deleted... (1 Reply)
Discussion started by: cooldude
1 Replies

6. HP-UX

rc.log problem about autostart script

On HP-UX, we add some our autostart scripts in the system script under /sbin/rc*.d directory. The output of application is redirected to /dev/null in our script,but once the application has been startup with the OS starting,its ouput is redirected to the /etc/rc.log finally and cause the rc.log... (2 Replies)
Discussion started by: Frank2004
2 Replies

7. Solaris

Solaris 10 - init stops working

I have a really strange issue on Solaris 10 running on v490. I'm running Oracle 10g on the box. Everything runs fine and all of a sudden I get a call from a DBA. I check and none of the Oracle processes are running. They were definitely running after the system booted and nobody stopped them. I try... (0 Replies)
Discussion started by: GKnight
0 Replies

8. UNIX for Dummies Questions & Answers

how to format iomega zip under unix?

i´m new in unix help me... (2 Replies)
Discussion started by: Texto
2 Replies
Login or Register to Ask a Question