ports/63561: [patch] pkg_add fails for mysql-server-4.1.0_1 and mysql-server-4.0.16 package if DB_DIR does not exist

Matthew Fremont m_fremont at yahoo.com
Mon Mar 1 01:40:15 UTC 2004


>Number:         63561
>Category:       ports
>Synopsis:       [patch] pkg_add fails for mysql-server-4.1.0_1 and mysql-server-4.0.16 package if DB_DIR does not exist
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 29 17:40:14 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Matthew Fremont
>Release:        5.2.1
>Organization:
>Environment:
FreeBSD bento.6230.net 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Mon Feb 23 20:45:55 GMT 2004     root at wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC  i386 
>Description:
pkg_add fails for mysql-server-4.1.0_1 and mysql-server-4.0.16 if the directory specified by DB_DIR does not exist, or, if DB_DIR is not set, if the default /var/db/mysql does not exist.

bento# file /var/db/mysql
/var/db/mysql: can't stat `/var/db/mysql' (No such file or directory).
bento# pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5.2-release/databases/mysql-server-4.1.0_1.tbz

Fetching ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5.2-release/databases/mysql-server-4.1.0_1.tbz... Done.
Sorry, the host 'bento' could not be looked up.
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with
the --force option
pkg_add: command '/usr/local/bin/mysql_install_db' failed
mysql:*:88:
You already have a group "mysql", so I will use it.
mysql:*:88:88::0:0:MySQL Daemon:/var/db/mysql:/sbin/nologin
You already have a user "mysql", so I will use it.
pw: WARNING: home `/var/db/mysql' does not exist
Changed home directory of "mysql" to "/var/db/mysql"
chown: /var/db/mysql: No such file or directory
pkg_add: install script returned error status


The POST_INSTALL for the package uses pw(8) to set the home directory for the mysql user to DB_DIR. The pw(8) command fails if the directory does not exist, and as a result, pkg_add fails and the package is removed.
>How-To-Repeat:
1. verify that directory /var/db/mysql does not exist

2. pkg_add ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-5.2-release/databases/mysql-server-4.1.0_1.tbz

>Fix:
add the -m option to the use of the PW command in the +INSTALL script (script is identical in both mysql-server-4.1.0_1 and mysql-server-4.0.16):

28c28
<               if pw usermod ${USER} -d ${DB_DIR}
---
>               if pw usermod ${USER} -m -d ${DB_DIR}
37c37
<                       -d ${DB_DIR} -s /sbin/nologin -c "MySQL Daemon"
---
>                       -m -d ${DB_DIR} -s /sbin/nologin -c "MySQL Daemon"

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list