Solved

Ubuntu linux inittab question

Posted on 2007-11-23
3
3,400 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 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
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 …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now