apache + php + mysql startup order

Dmitry Pryanishnikov dmitry at atlantis.dp.ua
Thu Nov 30 00:51:01 PST 2006


Hello!

   I'm trying to write an automated rc.d-script that should check MySQL 
database before it's used by the Apache+PHP hosting. So I've added a simple
script with the following block:

# PROVIDE: mysql-check
# BEFORE:  apache
# REQUIRE: mysql

This gives rcorder's warning:

rcorder: Circular dependency on provision `LOGIN' in file 
`/usr/local/etc/rc.d/mysql-server'.

yet forces the correct order:

/usr/local/etc/rc.d/mysql-server
/usr/local/etc/rc.d/mysql-check
/usr/local/etc/rc.d/apache.sh

Without this rc.d-file, apache starts before MySQL (since apache.sh contains
"# BEFORE: LOGIN" and mysql-server contains "# REQUIRE: LOGIN"). This default
order makes no sence to me: why to start apache if it can't correctly serve
the hosting w/o working MySQL server? So I feel that either

1) I don't understand something trivial, or

2) either rc.d/apache.sh or rc.d/mysql-server should be changed somehow
    in order to allow (if not force) to start apache _after_ mysqld.

Sincerely, Dmitry
-- 
Atlantis ISP, System Administrator
e-mail:  dmitry at atlantis.dp.ua
nic-hdl: LYNX-RIPE


More information about the freebsd-ports mailing list