Solved

Ubuntu linux inittab question

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

867 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

16 Experts available now in Live!

Get 1:1 Help Now