Logo 
Search:

Unix / Linux / Ubuntu Forum

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds

Init.D

  Date: Dec 13    Category: Unix / Linux / Ubuntu    Views: 391
  

Alright, so I put an init.d script into my /etc/init.d directory, the
script works perfectly, how do I make it run at startup?

Share: 

 

3 Answers Found

 
Answer #1    Answered On: Dec 13    

You put links in the rc<n>.d directories to start and stop the process
at the specified runlevels, where <n> is a given runlevel.

Here are some links to scripts to start Folding at Home (whichm unlike
some here, i've never had any trouble with):

jbuchana@zaphod$ find . 2>/dev/null| grep folding
./rc6.d/K06folding
./rc0.d/K06folding
./init.d/folding
./rc2.d/S99folding
jbuchana@zaphod$

The "find ." command lists all the files in or below the current
directory, the "2>/dev/null" redirects any error messages to nowhere,
and the "grep folding" filters out the name "folding", listing the
links in the rc<n>.d directories.

Here's a long listing of one of them, the one that starts it up:

jbuchana@zaphod$ ls -l rc2.d/S99folding
lrwxrwxrwx 1 root root 19 2008-11-13 21:20 rc2.d/S99folding ->
/etc/init.d/folding
jbuchana@zaphod$

I made the links with the "ln -s" command, "ln -s /etc/init.d/folding
/etc/rc2.d/folding".

The links that start with "K" kill the script on shutdown.

I hope that wasn't too terse, I've had a rough day...

 
Answer #2    Answered On: Dec 13    

So how do I link to the command in init.d or does it require a
different script?

 
Answer #3    Answered On: Dec 13    

To Create link the command is

# ln -s /etc/init.d/<your Script Name> /etc/rc<n>.d/S44<your Script Name>

e.g. ln -s /etc/init.d/mysqld /etc/rc3.d/S44mysqld

 
Didn't find what you were looking for? Find more on Init.D Or get search suggestion and latest updates.




Tagged: