LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Startup scripts, run levels, etc. (https://www.linuxquestions.org/questions/linux-newbie-8/startup-scripts-run-levels-etc-562344/)

dman65 06-16-2007 09:13 PM

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.

btmiller 06-16-2007 09:50 PM

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?

jschiwal 06-16-2007 09:58 PM

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

Tinkster 06-16-2007 10:43 PM

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


Cheers,
Tink

dman65 06-18-2007 11:05 AM

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!


All times are GMT -5. The time now is 09:53 AM.