Solved

Ubuntu linux inittab question

Posted on 2007-11-23
3
3,411 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Fine Tune your automatic Updates for Ubuntu / Debian
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

734 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