From owner-freebsd-questions@FreeBSD.ORG Tue Feb 28 04:24:40 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 183B816A420 for ; Tue, 28 Feb 2006 04:24:40 +0000 (GMT) (envelope-from james_mapson@umpquanet.com) Received: from ns.museum.rain.com (gw-ipinc.museum.rain.com [65.75.192.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8BE5E43D53 for ; Tue, 28 Feb 2006 04:24:39 +0000 (GMT) (envelope-from james_mapson@umpquanet.com) Received: from ns.museum.rain.com (localhost [127.0.0.1]) by ns.museum.rain.com (8.13.4/8.13.4) with ESMTP id k1S4OVfe017927 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO) for ; Mon, 27 Feb 2006 20:24:31 -0800 (PST) (envelope-from james@umpquanet.com) Received: (from james@localhost) by ns.museum.rain.com (8.13.4/8.13.4/Submit) id k1S4OUXg017926 for freebsd-questions@freebsd.org; Mon, 27 Feb 2006 20:24:30 -0800 (PST) (envelope-from james) Date: Mon, 27 Feb 2006 20:24:30 -0800 From: James Long To: freebsd-questions@freebsd.org Message-ID: <20060228042430.GA17894@ns.museum.rain.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-101.4 required=5.0 tests=ALL_TRUSTED, USER_IN_WHITELIST autolearn=failed version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on ns.museum.rain.com Subject: Problem with mysql-server.sh script (5.0.18 on 6.1-PRE) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2006 04:24:40 -0000 I'm migrating a system from MySQL 3.x to 5.0.18 on a server running "6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #0: Wed Feb 22 08:53:15 PST 2006". With no mysql running: www : 19:42:23 /usr/local/etc/rc.d# ps -axl | grep mysql www : 19:42:33 /usr/local/etc/rc.d# And the following defined: www : 19:42:33 /usr/local/etc/rc.d# egrep "debug|mysql" /etc/rc.conf mysql_enable="YES" mysql_args="--bind-address=localhost" rc_debug="ON" #mysql_enable="NO" When I: www : 19:42:49 /usr/local/etc/rc.d# /usr/local/etc/rc.d/mysql-server.sh start I see: /usr/local/etc/rc.d/mysql-server.sh: DEBUG: Sourcing /etc/defaults/rc.conf /usr/local/etc/rc.d/mysql-server.sh: DEBUG: checkyesno: mysql_enable is set to YES. /usr/local/etc/rc.d/mysql-server.sh: DEBUG: pid file (/var/db/mysql/www.vehiclenet.com.pid): not readable. /usr/local/etc/rc.d/mysql-server.sh: DEBUG: run_rc_command: evaluating mysql_prestart(). /usr/local/etc/rc.d/mysql-server.sh: DEBUG: checkyesno: mysql_limits is set to NO. Starting mysql. /usr/local/etc/rc.d/mysql-server.sh: DEBUG: run_rc_command: _doit: su -m mysql -c 'sh -c "/usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/var/db/mysql/www.vehiclenet.com.pid --bind-address=localhost > /dev/null &"' www : 19:43:38 /usr/local/etc/rc.d# So then I: www : 19:43:45 /usr/local/etc/rc.d# ps -axl | grep mysql and I see: www : 19:43:50 /usr/local/etc/rc.d# IOW, MySQL doesn't start. If I manually run the object of the su command: www : 19:47:46 /usr/local/etc/rc.d# sh -c "/usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/var/db/mysql/www.vehiclenet.com.pid --bind-address=localhost > /dev/null &" And then do: www : 19:47:58 /usr/local/etc/rc.d# ps -axl | grep mysql I see: root 16826 0.0 0.2 1708 1160 p0 S 7:47PM 0:00.01 /bin/sh /usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/var/db/mysql/www.vehiclenet.com.pid --bind-address=localhost mysql 16849 0.0 4.8 57584 24916 p0 S 7:47PM 0:00.12 /usr/local/libexec/mysqld --defaults-extra-file=/var/db/mysql/my.cnf --basedir=/usr/local --datadir=/var/db/mysql --user=mysql --pid-file=/var/db/mysql/www.vehiclenet.com.pid --bind-address=localhost www : 19:48:03 /usr/local/etc/rc.d# IOW, running the "sh -c ..." command manually works, although it leave mysqld_safe running as root, instead of as the mysql user (which does exist). /etc/passwd:mysql:*:88:88:MySQL Daemon:/nonexistent:/sbin/nologin /etc/group:mysql:*:88: If I manually run the command under su to try to get the service to run under the mysql user account, mysql does not start, and neither su nor mysql leave any error messages on either the console or the logs: www : 19:55:21 /usr/local/etc/rc.d# su -m mysql -c 'sh -c "/usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/var/db/mysql/www.vehiclenet.com.pid --bind-address=localhost > /dev/null &"' www : 19:56:48 /usr/local/etc/rc.d# findps mysql www : 19:56:52 /usr/local/etc/rc.d# su -m mysql -c 'sh -c "/usr/local/bin/mysqld_safe --defaults-extra-file=/var/db/mysql/my.cnf --user=mysql --datadir=/var/db/mysql --pid-file=/var/db/mysql/www.vehiclenet.com.pid --bind-address=localhost > /dev/null &"' www : 19:57:01 /usr/local/etc/rc.d# findps mysql www : 19:57:04 /usr/local/etc/rc.d# (findps is an alias that basically does a ps -axl | grep "$1" | grep -v grep) How can I fix this, or get su to tell me more about why the command works manually as root, but not under su as mysql? Thanks! Jim