Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    Need to auto start a program at boot

    Reply
    sic0048 | # 1 | 2008-10-04, 21:01 | Report

    OK - forgive me but I am a linux idiot. So hopefully this is an easy question. I need to start a script after the NIT boots and is fully operational (ie connected to the network, etc). What is the easiest way to accomplish this?

    Basically I need the equivalent of the "Start Up" folder in windows.

    Thanks.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    penguinbait | # 2 | 2008-10-04, 21:21 | Report

    Originally Posted by sic0048 View Post
    OK - forgive me but I am a linux idiot. So hopefully this is an easy question. I need to start a script after the NIT boots and is fully operational (ie connected to the network, etc). What is the easiest way to accomplish this?

    Basically I need the equivalent of the "Start Up" folder in windows.

    Thanks.
    You can take a look at this.

    http://nixshell.wordpress.com/2007/0...-init-scripts/

    Basically you have a directory in /etc called init.d
    If you look in /etc/init.d you will see scripts

    These scripts are called like
    /etc/init.d/script.sh start
    or
    /etc/init.d/script.sh stop


    The start will start the script, the opt will stop the script.

    Once you create a script that can be (at least) started. You then need to make sure it starts on boot..

    /etc/init.d is just where the scripts live

    There are more directories in /etc

    /etc/rc0.d
    /etc/rc1.d
    /etc/rc2.d
    /etc/rc3.d
    /etc/rc4.d
    /etc/rc5.d
    /etc/rc6.d

    Basically when the system reaches the corresponding runlevel those scripts are called. Maemo boots up to runlevel 2

    So you cd /etc/rc2.d

    Then you would link the script to this directory

    If you do an ls (LS) you will see lots of links starting with S or K. When entering runlevel 2 it will start in order the S script links. So if you wanted your script to start last, you would link it to the highest number.

    cd /etc/rc2.d
    ln -s /etc/init.d/script.sh S99scripttocall

    Now it will start on boot

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following 2 Users Say Thank You to penguinbait For This Useful Post:
    CleverJake, qwerty12

     
vBulletin® Version 3.8.8
Normal Logout