Solved

Ubuntu linux inittab question

Posted on 2007-11-23
3
3,417 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

636 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