LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-16-2007, 09:13 PM   #1
dman65
Member
 
Registered: Sep 2003
Posts: 61

Rep: Reputation: 15
Startup scripts, run levels, etc.


I have a SUSE Linux box setup running postfix to be a mail server.

There are scripts listed in /etc/init.d and symbolic links listed in /etc/init.d/rc3.d that issue a start for postfix as well as a pop3 and imap program. There are also similar entries in /etc/rc.d and /etc/rc.d/rc3.d.

These scripts were all installed when RPMs for these pieces of software were installed, I did not do them by hand. I had assumed that these would cause postfix and the other programs to start on bootup, but I always have to manually start them.

After doing some searching on Google, it appears that rc3.d should be run when the system execute runlevel 3.

I reviewed by most recent boot log and I see where it indicates that the system has entered runlevel 2, but I don't see where the system ever enters runlevel 3.

Can anyone give me some direction as to how to get these programs to start at boot up? Do I just put a reference to them in the rc2.d directory since the computer is booting into runlevel 2 instead of 3? Is booting into runlevel 2 an indication of a problem?

Thanks for any input.
 
Old 06-16-2007, 09:50 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
First check "who -r" and check what runlevel you're really in. You might even be in 5 if this is also a desktop and you're booting into a GUI environment.

Second, you can use chkconfig to control which runlevels services start in. The man page is pretty good but in general "chkconfig <service> on" should start it in all of the normal runlevels.

Finally, the service may be trying to start but failing. Have you checked the logs for this possibility?
 
Old 06-16-2007, 09:58 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you want to create your own script, there is a skeleton file in /etc/init.d/ to base your script on. There is also a README file with instructions.

Also, you might consider cheating a bit. Read through some of the scripts that exist. Make a copy of one that has the arguments you want and edit changes to the script and the header comments.

The commented header information are very important. Chkconfig can be thought of as a front ent to insserv. They use the header information to create the links and make sure that the order is correct. If your service is dependent on another service that information needs to be in the header.

man chkconfig
man 7 init.d
man insserv

Last edited by jschiwal; 06-16-2007 at 10:07 PM.
 
Old 06-16-2007, 10:43 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
The next thing is that init-files may be present, but set to be
not executable ... have you checked that?


Cheers,
Tink
 
Old 06-18-2007, 11:05 AM   #5
dman65
Member
 
Registered: Sep 2003
Posts: 61

Original Poster
Rep: Reputation: 15
Thanks!

Thanks for all of the help!

I verified that the system is running under runlevel 2 and there are no errors being logged.

If have issued the chkconfig command against the services I want to load. I will try resetting the server this coming weekend and see how everything comes up.

Thanks again!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I set scripts to run at startup? openSuSE 10.1 x86 iceportal SUSE / openSUSE 13 09-25-2006 10:29 AM
Automatically run scripts on startup? Phaethar Fedora 10 09-24-2004 02:35 AM
how to make/run startup scripts/commands ViN86 Slackware 3 04-24-2004 10:02 AM
How do I run startup scripts?O gaborn415 Linux - Newbie 1 04-15-2004 08:54 PM
The wide world of scripts run at startup, big question here SrConchiwa Linux - General 5 07-18-2003 08:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration