Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-16-2007, 10:13 PM   #1
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, 10:50 PM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,289

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, 10:58 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
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 11:07 PM.
Old 06-16-2007, 11:43 PM   #4
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

Old 06-18-2007, 12:05 PM   #5
Registered: Sep 2003
Posts: 61

Original Poster
Rep: Reputation: 15

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!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:29 AM
Automatically run scripts on startup? Phaethar Fedora 10 09-24-2004 03:35 AM
how to make/run startup scripts/commands ViN86 Slackware 3 04-24-2004 11:02 AM
How do I run startup scripts?O gaborn415 Linux - Newbie 1 04-15-2004 09:54 PM
The wide world of scripts run at startup, big question here SrConchiwa Linux - General 5 07-18-2003 09:09 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:23 AM.

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