Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Ubuntu linux inittab question

Posted on 2007-11-23
3
Medium Priority
?
3,436 Views
Last Modified: 2013-11-15
I have a process that I want to automatically start up when I reboot my machine.  Currently running Ubuntu linux 2.6.20-15

$WEB_SERVER_HOME/bin/httpd.sh &

How and where do I configure ubuntu to run this automatically at bootdup.

I went looking for /etc/inittab  instead I found /etc/init.d with about 90 files and directories.  I'm not sure which to modify and how to configure this so my webserver starts automatically.

Beginner advice please
0
Comment
Question by:tmonteit
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 2000 total points
ID: 20341682
Hi,

init process will look into the run level dir and run all startup scripts of that level.

e.g. if the run level is 5 then it looks for scripts in /etc/rc5.d dir.

The scripts are by convention have their names in this format:

CnumName

C is either K (kill / stop) or S (start)
num is a number like 10, 15, 99 etc.
Name is a name reflecting the S/W

So, in your case you may create a startup script (call it S99Webserver) in /etc/rc5.d that contains all necessary settings and commands to start your web server.

e.g.

WEB_SERVER_HOME=/path/to/my/web
cd $WEB_SERVER_HOME
nohup $WEB_SERVER_HOME/bin/httpd.sh & 

Make sure that the script is executable

chmod +x /etc/rc5.d/S99Webserver

Here I amassuming your default run level is 5. To find the default run level, please see /etc/inittab file

0
 

Author Comment

by:tmonteit
ID: 20341736
Follow-up question.  I'm trying to figure out what my default run level is.

   "To find the default run level, please see /etc/inittab file"  

>cat /etc/inittab
cat: /etc/inittab: No such file or directory

advice?
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20341749
Hi,

When your m/c boots, it goes to default run level.

When you login, to find current run level, you may run

who -r

It seams your version of ubuntu is 6.10 or higher, which do not use init. Please see

http://upstart.ubuntu.com/
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question