Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Startup servers on boot 1

Status
Not open for further replies.

gmorton

Programmer
Dec 20, 2004
11
HK
Hi everyone

I'm wanting to start a database server every time that the RedHat machine reboots (not whenever a user logs in). Which file do I need to add the startup command to?

Thanks
Grant
 
Let's assume that you've installed "MySQL" database software via RPM package.

On RedHat systems, this installs the script "mysqld" in "/etc/rc.d/init.d/"

To enable this to be started and stopped at bootup and shutdown, you would enter this command

"chkconfig --add mysqld 35 on"

This tells the chkconfig program (unique to RedHat I believe) to add/register the mysqld script to the automated handling of the init process on runlevels 3 and 5, and to turn on/enable the service at boot (otherwise it would be registered but left off). For RedHat, runlevel 3 is text and 5 is GUI (I believe this is still true these days).

Also, you are not starting a "server", it is a service. The server is the big box it's running on. You might also call it a daemon in more directed unix/linux parlance. However, "service" will do nicely.

Hosting Solutions for Home or Business.
 
Thanks thedaver.

However, I don't seem to have chkconfig installed (unless it's not part of the PATH and I need to be in a specific directory to run it. It's not in /bin. I downloaded the .tar.gz file, gunzipped and tarred it but till couldn't get it installed. Is there a way to create the symbolic links without using chkconfig. I have tried ln -s but that also doesn't seem to do the trick.

Grant
 
You probably need to be root to run chkconfig.

My chkconfig is in /sbin/ which is not always part of your path.

You can find it with this command
"cd /; find -iname chkconfig"

This might take a minute, but you'll have your answer.

Don't mess around with symlinking if this tool is available.

Hosting Solutions for Home or Business.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top