Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 17 of 17
sounds alright but for debian i have to put all scripts into /etc/init.d then symlink them from there into /etc/rc2.d with 'ln -s /etc/init.d/<filename> /etc/rc2.d' then rename it in /etc/rc2.d ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Linux Newbie
    Join Date
    Jul 2005
    Location
    Turn Around
    Posts
    202

    sounds alright but for debian i have to put all scripts into /etc/init.d then symlink them from there into /etc/rc2.d with 'ln -s /etc/init.d/<filename> /etc/rc2.d' then rename it in /etc/rc2.d with 'mv <filename> <new filename>' where the new filename is S##<name>. Just like it was said before, the number after S says when for it to be executed. this symlink may not be needed in redhat/fedora, but if you see a init.d folder you might. keep in mind 2 just happens to be my runlevel so your folder may be rc3.d or rc5.d instead of my rc2.d.

    Its all confusing, i know... but keep coming back with questions.

    PS for you to see it say "Hello World!" you might want it to be S99 so it says it last before you login. also... you should not use root often. make a new user or use guest prefferably. there is a command to change to root when ur a normal user.. usually 'su' or 'sudo' (try looking at their man pages with 'man <command>').

  2. #12
    Just Joined!
    Join Date
    Sep 2005
    Posts
    27
    hi, i have read all these posts and have 2 very simple questions.

    question 1:

    Add the file S##<name> to /etc/rc/rc2.d
    # is the number . can i use any number ? randomly ?

    say if i use S12..,S14..,S45..,S90.. etc ....are all these number valid ?

    one of you have shown example with S99.. . why it has to be 99 ? why NOT 11 ? is it a rule that it has to be always 99 ?



    question 2 :

    you people are saying about runlevel . some of you are saying runlevel2(command line ),runlevel5 (GUI ).

    but what exactly this runlevel means ?

    thanks for all the responses

  3. #13
    Just Joined!
    Join Date
    Sep 2005
    Posts
    27
    is there anybody here ?

  4. $spacer_open
    $spacer_close
  5. #14
    Linux Guru AlexK's Avatar
    Join Date
    Feb 2005
    Location
    Earth
    Posts
    3,379
    bear with me as i don't have any experience in scripting:
    1. From reading the previous posts, ## is indeed a number and from flatline's post, this number seems to be the order in which the system executes the scripts. So, 99 will make it the last script to be executed (due to fact that only ## is available).

    If you take a look in your rcX.d directory, (replace X with correct number), you will see files with different values for ##. There is no harm in you using different values, but what if some other script had the same ## as your script? which one would run? That is why the others have suggested to use 99 as ##, so this kind of thing may be avoided (unless you have another script which has 99 for ##).

    2. Think of runlevel as different stages of the boot process. Runlevel 1 is like the startup, basic stuff is loaded. Runlevel 2, more things are loaded, Runlevel 3, even more things loaded and has network support. Runlevel 5 full gui and everything loaded. Runlevel 6 = reboot system.

    @ the others, feel free to point out any errors in my understanding of these concepts.
    Life is complex, it has a real part and an imaginary part.

  6. #15
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    sounds alright but for debian i have to put all scripts into /etc/init.d then symlink them from there into /etc/rc2.d with 'ln -s /etc/init.d/<filename> /etc/rc2.d' then rename it in /etc/rc2.d with 'mv <filename> <new filename>' where the new filename is S##<name>. Just like it was said before, the number after S says when for it to be executed. this symlink may not be needed in redhat/fedora, but if you see a init.d folder you might. keep in mind 2 just happens to be my runlevel so your folder may be rc3.d or rc5.d instead of my rc2.d.
    This is where chkconfig comes handy

    Check these links for more details:
    http://linuxcommand.org/man_pages/chkconfig8.html
    http://freshmeat.net/projects/chkconfig/
    The Unforgiven
    Registered Linux User #358564

  7. #16
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,903
    Normally, of course, you just add a call to the script to the end of:

    /etc/rc.d/rc.local

    which gets run after all the SysV init stuff in rcX.d.
    Linux user #126863 - see http://linuxcounter.net/

  8. #17
    Just Joined!
    Join Date
    Sep 2005
    Posts
    27
    bear with me as i don't have any experience in scripting:
    1. From reading the previous posts, ## is indeed a number and from flatline's post, this number seems to be the order in which the system executes the scripts. So, 99 will make it the last script to be executed (due to fact that only ## is available).

    If you take a look in your rcX.d directory, (replace X with correct number), you will see files with different values for ##. There is no harm in you using different values, but what if some other script had the same ## as your script? which one would run? That is why the others have suggested to use 99 as ##, so this kind of thing may be avoided (unless you have another script which has 99 for ##).

    2. Think of runlevel as different stages of the boot process. Runlevel 1 is like the startup, basic stuff is loaded. Runlevel 2, more things are loaded, Runlevel 3, even more things loaded and has network support. Runlevel 5 full gui and everything loaded. Runlevel 6 = reboot system.

    @ the others, feel free to point out any errors in my understanding of these concepts.

    man, you are a big linux guru indeed . you have demystified the complexity such a nice way ! what an excellent explanation.



    my problem has been solved.

    Thank you all.

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •