Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-10-2003, 07:37 AM
|
#1
|
Member
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520
Rep:
|
I want MySQL to run at startup
Hi all,
I have installed MySQL onto my RedHat 8 machine. I would like the mysql daemon (mysqld) to automatically run at startup. In /etc/rc.d/rc3.d, what wouls need to go there? What kind of file? I know that all the "startup" files begin with "S" and in /etc/rc.d/rc6.d and /etc/rc.d/rc0.d all the stop daemon files are "K" files. What would I name the startup file for MySQL, and what would the file contain? Right now, I start the MySQL daemon manually with the command:
"mysql.server start" from anywhere in the system.
Oh, and in the startup directiries, what do all the numbers mean, like S35httpd and S45named. What do the 35 and 45 mean? Each startup file has a differnet number, but some are shared! Thanks guys!
Chris
|
|
|
06-10-2003, 10:43 AM
|
#2
|
Member
Registered: Dec 2001
Location: /root
Distribution: FreeBSD,NETBSD,redhat
Posts: 472
Rep:
|
Hi cjwsb,
to start all service here the command,
with 'chkconfig ' command you can add,remove,and change services;list
eg:
#/sbin/chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
that mean sendmail confgiured to all run level.
and if you want to turn off for runlevel 4,then
# /sbin/chkconfig --level 4 sendmail off
same substituting with on and off.
with chkconfig can aslo add or delete services with the --add and --del switchs.
for more info see man pages
Hitesh
Last edited by hitesh_linux; 06-10-2003 at 10:45 AM.
|
|
|
06-10-2003, 08:18 PM
|
#3
|
Member
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520
Original Poster
Rep:
|
So, if I want it to start at run level 3 and stop at run levels 0 and 6, the commands would be this?
# /sbin/chkconfig --level 3 mysql.server on
# /sbin/chkconfig --level 0 mysql.server off
# /sbin/chkconfig --level 6 mysql.server off
I can see how your sendmail example would work because RH understands that "sendmail" is a service, but why would this work on my machine? Could you elaborate please?
Thanks,
Chris
|
|
|
06-10-2003, 08:25 PM
|
#4
|
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503
Rep:
|
You can use:
chkconfig --list
to see all the available services. For mysql the daemon is mysqld so it would be:
chkconfig --level 3 mysqld on
|
|
|
06-10-2003, 08:46 PM
|
#5
|
Member
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520
Original Poster
Rep:
|
Nope, sorry. That didn't work. I tried all of these:
chkconfig --level 3 /usr/sbin/mysqld on
chkconfig --level 3 /usr/sbin/mysql.server on
chkconfig --level 3 mysql.server on
chkconfig --level 3 mysqld on
None worked. I would get:
error reading information on service whatever: No such file or directory
Like I said, my executable file to start, stop, and restart is "mysql.server" and it is located in /usr/sbin. How can I automatically run that at startup?
Chris
|
|
|
06-10-2003, 09:09 PM
|
#6
|
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503
Rep:
|
Does:
chkconfig --list | grep mysql
return anything?
|
|
|
06-10-2003, 09:33 PM
|
#7
|
Member
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520
Original Poster
Rep:
|
No, it did not. Hmmmmmmm
Chris
|
|
|
06-10-2003, 10:05 PM
|
#8
|
Member
Registered: Jan 2002
Distribution: slackware
Posts: 193
Rep:
|
Check the directory /etc/init.d for a mysql startup file if you installed it with an rpm it should be there. If you instaleld it by source then mysql comes with a startup file called mysql.server or at least it used to copy that file to /etc/init.d then try the chkconfig command again.
|
|
|
06-10-2003, 11:01 PM
|
#9
|
Member
Registered: Jun 2002
Location: Ontario, Canada
Distribution: RH8.0
Posts: 65
Rep:
|
if you could always enter the start command in /etc/rc.d/rc.local
as well.
You can also create symbolic links in your respective directories.
for example in my start up dir i have S78mysqld -> ../init.d/mysqld
good luck
|
|
|
06-11-2003, 09:23 AM
|
#10
|
Member
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520
Original Poster
Rep:
|
JSTU,
I installed from source and that is the startup file (mysql.server). I will try what you suggest. Thanks!
Chris
|
|
|
06-11-2003, 07:05 PM
|
#11
|
Member
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129
Rep:
|
Or to make it simple, you could install Webmin and there is the option in there that you can have mysql to start at bootup.
Although, you wouldn't learn that much. But it will do the trick.
regards, Kenny
|
|
|
06-13-2003, 11:25 AM
|
#12
|
Member
Registered: Mar 2003
Location: Massachusetts, USA
Distribution: RH 8, Solaris, Windoze eXPunged
Posts: 520
Original Poster
Rep:
|
JSTU,
What you suggested did it! Thanks!
Chris
|
|
|
06-14-2003, 01:45 AM
|
#13
|
Member
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992
Rep:
|
use [B]ntsysv[\B]
|
|
|
All times are GMT -5. The time now is 01:42 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|