From owner-freebsd-ports@FreeBSD.ORG Wed Jan 26 23:11:24 2005 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A998D16A4CF for ; Wed, 26 Jan 2005 23:11:24 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADA5843D4C for ; Wed, 26 Jan 2005 23:11:22 +0000 (GMT) (envelope-from metrol.net@gmail.com) Received: by wproxy.gmail.com with SMTP id 69so172338wra for ; Wed, 26 Jan 2005 15:11:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=ntsfodd7wA2yBqvrdzenQBzodnkPqViHrSYT8OELREFXZR82dJqlczV69ipGB2ohXpUiQ1NjFllNZOFj/xN2KsMRKu32s1cxLxZ9wczxXURNobQ3XphZjE5ig+dtBHqFQqrPKhfCid2KBT7BCyUymA85jG2C5xP8DTCYNavoCao= Received: by 10.54.33.23 with SMTP id g23mr202192wrg; Wed, 26 Jan 2005 15:11:10 -0800 (PST) Received: by 10.54.51.66 with HTTP; Wed, 26 Jan 2005 15:10:58 -0800 (PST) Message-ID: Date: Wed, 26 Jan 2005 15:10:58 -0800 From: Michael Collette To: Fred Condo In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <672DC1EE-6C10-11D9-9754-003065C7DFE8@quinn.com> <20050126125251.GA2034@isis.wad.cz> cc: freebsd-ports@freebsd.org Subject: Re: MySQL 4.0.23a on 5-STABLE has a startup glitch X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Michael Collette List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2005 23:11:24 -0000 On Wed, 26 Jan 2005 11:23:13 -0800, Fred Condo wrote: > > On Jan 26, 2005, at 8:14 AM, Michael Collette wrote: > > > On Wed, 26 Jan 2005 13:52:51 +0100, Roman Neuhauser > > wrote: > >> # fcondo@quinn.com / 2005-01-21 16:56:09 -0800: > >>> On Jan 21, 2005, at 2:43 PM, Michael Collette wrote: > >>>> On 5-STABLE I am unable to get mysql-server-4.0.23a to start with > >>>> the > >>>> rcng script. Upon launching the script it dumps me to a prompt > >>>> owned > >>>> by the mysql user. I have run into one other user on the mailing > >>>> lists with the same exact problem. > >> > >>> I'm seeing identical behavior under FreeBSD 4.10-p5 with MySQL > >>> 4.1.9. I > >>> finally traced the execution of the startup script by invoking it as: > >>> > >>> sh -x /usr/local/etc/rc.d/mysql-server.sh start > >>> > >>> The resulting output showed this detail: > >>> > >>> + su -m mysql -c sh -c "/usr/local/bin/mysqld_safe --user=mysql > >>> --datadir=/var/db/mysql --pid-file=/var/db/mysql/OBFUSCATED.pid > > >>> /dev/null &" > >>> bash: no job control in this shell > >> > >> That looks like you have installed bash and replaced the original > >> /bin/sh with (a link to) bash and/or have a strange $PATH. > >> > >> I strongly suggest you don't try to use bash as /bin/sh: it's a > >> poor > >> /bin/sh lookalike, and will e. g. break quite a few jobs in > >> periodic(8). > > > > I know I haven't done that here. Bash is my default shell, but I > > didn't do any messing around with linking away from sh. I'm getting > > the exact same symptoms here on 5-STABLE. > > > > MySQL doesn't start with the new rcng script, and it just sits there > > at a prompt owned by the mysql user. It will do this when I try to > > launch it manually or at boot. Running ps ax shows that "su -m mysql" > > line that Fred mentioned. > > > > I just don't quite get why this needs to launch with su anyway. Isn't > > that what the --user switch is for in the mysqld_safe command? > > We also have not ever replaced sh with bash. We had 2 FreeBSD 4.10-p5 > machines, one old, one built strictly to investigate this problem. The > test machine was able to launch MySQL 4.1.9 with rcng, so obviously > there is some as yet unknown difference between the two machines -- but > it is not a matter of having tried to replace the base sh. > Unfortunately, it means my test machine isn't useful for probing the > problem, and I had to put my production machine back into production > under MySQL 3.23.x. > > Could someone who can reproduce this problem on a test system do this: > invoke mysqld_safe with sh -x to see where it drops into the shell > prompt? > > Also, did anyone else seeing this problem have MySQL 3 installed on the > machine prior to installing MySQL 4? > > You can get the new MySQL started. It just needs the old rc script which still works perfectly. Put this into your /usr/local/etc/rc.d/ directory and disable that rcng script. #!/bin/sh DB_DIR=/var/db/mysql PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid case "$1" in start) if [ -x /usr/local/bin/mysqld_safe ]; then /usr/bin/limits -U mysql \ /usr/local/bin/mysqld_safe --user=mysql --datadir=${DB_DIR} - -pid-file=${PIDFILE} > /dev/null & echo -n ' mysqld' fi ;; stop) if [ -f ${PIDFILE} ]; then /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n 'mysql d' else echo "mysql-server isn't running" fi ;; *) echo "" echo "Usage: `basename $0` { start | stop }" echo "" exit 64 ;; esac -- "When you come to a fork in the road....Take it" - Yogi Berra