# Service startup order problem



## Icenode (Apr 29, 2009)

Anyone know how I can get Zabbix to wait for MySQL to finish loading before running on startup.  "REQUIRE mysql" doesn't seem to work.

Is there a clean way to hold off the startup of a service waiting for mysql to finish loading, or am I going to be forced to use a script with a long sleep in it?

Thanks for any help.


----------



## DutchDaemon (Apr 29, 2009)

Have you tried "mysqld" or "mysql-server" (daemon vs. rc.d script) and is your rcorder(8) syntax correct?


----------



## SirDice (Apr 29, 2009)

Is there a PROVIDE statement in the mysql startup script?


----------



## Icenode (Apr 29, 2009)

The PROVIDE in the mysql-startup script is
# PROVIDE mysql

And is what I based my REQUIRE off of.  Is that not correct, should I be using mysqld or mysql-server?


----------



## Icenode (Apr 29, 2009)

Neither of these worked either.

```
# REQUIRE: mysqld
```


```
# REQUIRE: mysql-server
```

Is it possible it's a situation where the mysql process is running so the REQUIRE see's it, but it hasn't finished loading the database so my other process fails?  Is there anything else I could do to my startup scripts if this is the case?


----------



## phoenix (Apr 30, 2009)

Check the output of *rcorder /etc/rc.d/* /usr/local/etc/rc.d/** and check where mysql and zabbix are listed in relation to each other.  You can also check for things later in the list and put one of those into the REQUIRE: line.


----------



## Icenode (Apr 30, 2009)

Got It!

Thanks for the tip about rcorder and using multiple REQUIRE arguments.

When I ran my rcorder, mysql was being required to start first, but the process that required it was starting second which must not have been enough time.  I added several other processes to the require list and not it's working.


----------



## DutchDaemon (Apr 30, 2009)

Maybe ping Zabbix's port maintainer about this? He's the one in charge of positioning Zabbix into the right order of start-up scripts, and there are bound to be others having the same problem with Zabbix trying to latch onto mysql too early.


----------

