Bug 102561

Summary: databases/mysql50-client: rc.d ordering results in apache + mod_php5 starting without pdo mysql support
Product: Ports & Packages Reporter: Andrew Tulloch <andrew>
Component: Individual Port(s)Assignee: Alex Dupre <ale>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Andrew Tulloch 2006-08-27 13:40:19 UTC
Due to rc.d script ordering on boot the apache2 port starting before the mysql client libs script is run. This results in the following error:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20050922/pdo_mysql.so' - Shared object &quot;libmysqlclient.so.15&quot; not found, required by &quot;pdo_mysql.so&quot; in Unknown on line 0
[Sun Aug 27 13:00:35 2006] [notice] Apache/2.0.59 (FreeBSD) PHP/5.1.5 configured -- resuming normal operations

Apache is now running with PHP, but with PDO without PDO mysql support because the mysql libs were not present at the time apache was started.

Fix: 

Create a more modern startup script so that mysqlclient libs are present before other daemons are started as it seems old style startup scripts are processed last.

Something like:

#!/bin/sh
#
#

# PROVIDE: mysqlclient
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown

. /etc/rc.subr

name="mysqlclient"
rcvar=`set_rcvar`

start_cmd="mysqlclient_start"

load_rc_config $name

mysqlclient_start() {
        /sbin/ldconfig -m /usr/local/lib/mysql
}


run_rc_command "$1"
How-To-Repeat: Install apache (www/apache2) php5 (www/mod_php5) with PDO (databases/pecl-PDO) and install PDO mysql (databases/pecl-PDO_MYSQL).

Reboot the machine and you should see the error:
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20050922/pdo_mysql.so' - Shared object &quot;libmysqlclient.so.15&quot; not found, required by &quot;pdo_mysql.so&quot; in Unknown on line 0
[Sun Aug 27 13:00:35 2006] [notice] Apache/2.0.59 (FreeBSD) PHP/5.1.5 configured -- resuming normal operations

In /var/log/httpd-error.log
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2006-08-27 21:29:17 UTC
State Changed
From-To: open->feedback

To which port does this PR apply? 


Comment 2 Mark Linimon freebsd_committer freebsd_triage 2006-08-27 21:29:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->linimon

Track.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2006-08-28 00:54:01 UTC
State Changed
From-To: feedback->open

Submitter thinks this may be a problem in databases/mysql50-client. 


Comment 4 Mark Linimon freebsd_committer freebsd_triage 2006-08-28 00:54:01 UTC
Responsible Changed
From-To: linimon->ale
Comment 5 Alex Dupre freebsd_committer freebsd_triage 2006-08-28 06:34:56 UTC
State Changed
From-To: open->closed

mysqlclient uses ldconfig rc.d startup script.