Hi Karl, Fredrik, all!

Karl Larsen wrote:
Joerg Bruehe wrote:
Hi Fredrik, all!


Fredrik Andersson wrote:
Hi all

I have problems getting MySQL autoboot on my RedHat installation. [[...]]

In addition to permissions (see the other posts), there is another possible problem: [[...]]

Try this patch to "/etc/init.d/mysql":

--- /etc/init.d/mysql-OLD
+++ /etc/init.d/mysql
@@ -17,6 +17,7 @@
 ### BEGIN INIT INFO
 # Provides: mysql
 # Required-Start: $local_fs $network $remote_fs
+# Should-Start: ypbind nscd ldap ntpd xntpd
 # Required-Stop: $local_fs $network $remote_fs
 # Default-Start:  2 3 4 5
 # Default-Stop: 0 1 6

Hi Joerg, I'm using Ferdora Core 4 of Red Hat and I have in /etc/rc.d/init/ a file mysqld which when I use ./mysqld start does start the system. But it has to be done every time I turn on the computer. I do not understand your patch. I can't find what I think is where you want to put one line of code. The other lines do not exist. Or I don't know what I.m doing :-)

Ok, verbose form:

Depending on how a machine and a MySQL server is configured, it _may_ be necessary to start some more other services before MySQL is started. The start script, which is installed as "/etc/init.d/mysql", contains some lines that describe such dependencies.

Up to 5.0.22, the lines are:
  ...
  ### BEGIN INIT INFO
  # Provides: mysql
  # Required-Start: $local_fs $network $remote_fs
  # Required-Stop: $local_fs $network $remote_fs
  # Default-Start:  2 3 4 5
  # Default-Stop: 0 1 6
  ...

The system tools ensure (on installing) that start scripts are called in bottom-up sequence, first the prerequisites and then the dependents (first the lower-level services, then the ones using them).

Now _if_ the installation uses NIS (former "yp", "yellow pages"), a name server cache daemon, or LDAP, these services may not be up and running when the MySQL server starts - causing problems.

To prevent this, more dependency information has been added. So the resulting lines are these:
  ...
  ### BEGIN INIT INFO
  # Provides: mysql
  # Required-Start: $local_fs $network $remote_fs
  # Should-Start: ypbind nscd ldap ntpd xntpd
  # Required-Stop: $local_fs $network $remote_fs
  # Default-Start:  2 3 4 5
  # Default-Stop: 0 1 6
  ...

If you install / upgrade using a RPM package, "rpm" should take care of installing the server start script. If you use a "tar.gz" package, "chkconfig" may be the tool to use - sorry, I am no RedHat user myself, so I will leave the search for details to you.
Keywords: "chkconfig", "ntsysv", "redhat-config-services", "run level".

In any case, the result should be some symbolic links from the run level start directories "/etc/init.d/rc2.d", "/etc/init.d/rc3.d", ... to that script, similar to this:

  :~> ls -l /etc/init.d /etc/init.d/rc3.d/
  /etc/init.d:
  insgesamt 381
  -rw-r--r--  1 root root   482 2004-08-25 16:20 Makefile
  -rw-r--r--  1 root root  6851 2005-03-23 22:31 README
  .....                                          .....
  -rwxr-xr-x  1 root root  9359 2006-06-23 16:41 mysql
  .....                                          .....

  /etc/init.d/rc3.d/:
  insgesamt 0
  lrwxrwxrwx  1 root root  6 2006-03-27 09:31 K06hal -> ../hal
  .....                                          .....
  lrwxrwxrwx  1 root root  8 2006-06-19 15:44 K10mysql -> ../mysql
  .....                                          .....
  lrwxrwxrwx  1 root root  8 2006-06-19 15:44 S12mysql -> ../mysql
  .....                                          .....

Which means: In my example, in run level 3 ("rc3.d") the MySQL server is at position 10 for stopping (K10) and at position 12 for starting (S12).

You need such symbolic links for MySQL to be started automatically at all on system bootup (for each run level in which you want it started), and you need them in the proper position (number) so that starting (stopping) services is done in the correct order of dependencies.


Hope that helps,
Joerg

--
Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to