From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 2 15:15:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E258C1065672 for ; Sun, 2 Jan 2011 15:15:55 +0000 (UTC) (envelope-from dsc.fbsd.other@gmail.com) Received: from mail-ey0-f196.google.com (mail-ey0-f196.google.com [209.85.215.196]) by mx1.freebsd.org (Postfix) with ESMTP id 1EDAC8FC17 for ; Sun, 2 Jan 2011 15:15:54 +0000 (UTC) Received: by eyd10 with SMTP id 10so1950832eyd.7 for ; Sun, 02 Jan 2011 07:15:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date:keywords :message-id:mime-version:content-type:x-mailer:thread-index :content-language; bh=8QLYL0W7tRdXqSkk+qQs/ayjIsjOv9R+t2k/HgVVqbA=; b=HB6rSRyvjLsQnwdjGG+p08m5DUNEKuRI8yPWLDcvTPELszw1kyl26zKBDDzfFXs0Xz 1Z0jIaVLzNcF2n6iT67aApuhpTnyYQwHpAOkHIzhv1j4Xk68iAfYbZCzDs8dhgR/JFOx 5GCG/SV428S4QnbODQRCAfutxrRAp7rFn7x4A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:keywords:message-id:mime-version:content-type :x-mailer:thread-index:content-language; b=f2lsoouDhGOImcdNAn5pypqKqk8DzplEvnlRj96NtnAFoY3yj/oqQavjJm6jxkXYu1 w7xdBB7315qpcN+UbI+3+ZAKASgTTWmd1NrGkh8rL9jd+ucKrpB6C0nF9X+W1cAoRzcs uVYzF9NRNPfQ9tyDJ1Gl2adhDcYhn+vH6RVKg= Received: by 10.213.29.197 with SMTP id r5mr16555844ebc.28.1293980451625; Sun, 02 Jan 2011 07:00:51 -0800 (PST) Received: from fscld ([94.176.153.23]) by mx.google.com with ESMTPS id u1sm13989378eeh.16.2011.01.02.07.00.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 02 Jan 2011 07:00:50 -0800 (PST) From: "dsc fbsd.other" To: Date: Sun, 2 Jan 2011 17:00:31 +0200 Keywords: BDF1out Message-ID: <005501cbaa8d$cfbe3190$6f3a94b0$@gmail.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AcuqjcCSWME2dttnQ7mDSBNFuAQDmg== Content-Language: en-us Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: jailing MySQL error X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jan 2011 15:15:56 -0000 Hi. I'm using ezjail standard config file, with a modified fstab file (mount_nullfs ports to jail). Cat /usr/local/etc/ezjail/j009_mysql2 export jail_j009_mysql2_hostname="j009_mysql2" export jail_j009_mysql2_ip="xx.xx.xx.xx" export jail_j009_mysql2_rootdir="/ezjail/j009_mysql2" export jail_j009_mysql2_exec_start="/bin/sh /etc/rc" export jail_j009_mysql2_exec_stop="" export jail_j009_mysql2_mount_enable="YES" export jail_j009_mysql2_devfs_enable="YES" export jail_j009_mysql2_devfs_ruleset="devfsrules_jail" export jail_j009_mysql2_procfs_enable="YES" export jail_j009_mysql2_fdescfs_enable="YES" export jail_j009_mysql2_image="" export jail_j009_mysql2_imagetype="" export jail_j009_mysql2_attachparams="" export jail_j009_mysql2_attachblocking="" export jail_j009_mysql2_forceblocking="" export jail_j009_mysql2_zfs_datasets="" export jail_j009_mysql2_cpuset="" export jail_j009_mysql2_fib="" My steps: 1. Ezjail-admin onestart j009_mysql2 2. Ezjail-admin console j009_mysql2 3. Cd /usr/ports/database/mysql55-server && make install clean 4. cp /usr/local/share/mysql/my-innodb-heavy-4G.cnf /usr/local/etc/my.cnf (modified socket file path to /var/db/mysql/mysql.sock, in both client and server lines) 5. chown -R mysql:mysql ... for ... /tmp /var/tmp /var/db/mysql 6. mysql_enable="YES" in jail rc.conf 7. /usr/local/etc/rc.d/mysql-server start 8. ...and NOTHING ... mysql-server scripts starts /usr/local/bin/mysql_install_db (creates mysql and test folders in /var/db/mysql ... but nothing else ... it's just running) I had to kill everything. After reading lots of webpages and trying all kind of stuff (including http://devel.reinikainen.net/15, but without ssl stuff), I decided to install MySQL on the host. I've made the same steps (3-5 and 7 with "onestart" instead "start") and used the same my-innodb-heavy-4G.cnf file Everything went well. Mysqld started, creating socket file and pid file; mysql_install_db had no errors. The log file says: 110102 18:07:06 mysqld_safe Starting mysqld daemon with databases from /var/db/mysql 110102 18:07:06 [Note] Plugin 'FEDERATED' is disabled. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.5 110102 18:07:06 InnoDB: Initializing buffer pool, size = 2.0G 110102 18:07:07 InnoDB: Completed initialization of buffer pool 110102 18:07:07 InnoDB: highest supported file format is Barracuda. 110102 18:07:07 InnoDB: 1.1.3 started; log sequence number 1595675 110102 18:07:07 [Note] Event Scheduler: Loaded 0 events 110102 18:07:07 [Note] /usr/local/libexec/mysqld: ready for connections. Version: '5.5.7-rc-log' socket: '/var/db/mysql/mysql.sock' port: 3306 FreeBSD port: mysql-server-5.5.7 I didn't give up ... so I did: 9. Rm -rf /var/db/mysql/* (in jail) 10. Cp /var/db/mysql/mysql/* /ezjail/j009_mysql2/var/db/mysql/mysql (from host to jail) 11. Cp /var/db/mysql/performance_schema/* /ezjail/j009_mysql2/var/db/mysql/performance_schema (from host to jail) 12. Starting and entering the jail again 13. usr/local/etc/rc.d/mysql-server start was started upon entering the jail (did not create pid and socket file) but generated this log: 110102 17:03:05 [Note] Plugin 'FEDERATED' is disabled. /usr/local/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 110102 17:03:05 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.5 110102 17:03:05 InnoDB: Initializing buffer pool, size = 2.0G 110102 17:03:06 InnoDB: Completed initialization of buffer pool InnoDB: The first specified data file /innodb/ibdata1 did not exist: InnoDB: a new database to be created! 110102 17:03:06 InnoDB: Setting file /innodb/ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... 110102 17:03:06 InnoDB: Log file ./ib_logfile0 did not exist: new to be created InnoDB: Setting log file ./ib_logfile0 size to 256 MB InnoDB: Database physically writes the file full: wait... InnoDB: Progress in MB: 100 200 110102 17:03:08 InnoDB: Log file ./ib_logfile1 did not exist: new to be created InnoDB: Setting log file ./ib_logfile1 size to 256 MB InnoDB: Database physically writes the file full: wait... InnoDB: Progress in MB: 100 200 110102 17:03:10 InnoDB: Log file ./ib_logfile2 did not exist: new to be created InnoDB: Setting log file ./ib_logfile2 size to 256 MB InnoDB: Database physically writes the file full: wait... InnoDB: Progress in MB: 100 200 14. usr/local/etc/rc.d/mysql-server stop ... doesn't work because of missing pid file (the same with "mysql_upgrade" suggested by the log file) 15. './mysql/plugin.frm' file exists 16. kill everything and run again usr/local/etc/rc.d/mysql-server start with this result: 110102 17:07:40 [Note] Plugin 'FEDERATED' is disabled. /usr/local/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13) 110102 17:07:40 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. InnoDB: The InnoDB memory heap is disabled InnoDB: Mutexes and rw_locks use GCC atomic builtins InnoDB: Compressed tables use zlib 1.2.5 110102 17:07:40 InnoDB: Initializing buffer pool, size = 2.0G 110102 17:07:40 InnoDB: Completed initialization of buffer pool 110102 17:07:40 InnoDB: highest supported file format is Barracuda. InnoDB: No valid checkpoint found. InnoDB: If this error appears when you are creating an InnoDB database, InnoDB: the problem may be that during an earlier attempt you managed InnoDB: to create the InnoDB data files, but log file creation failed. InnoDB: If that is the case, please refer to InnoDB: http://dev.mysql.com/doc/refman/5.1/en/error-creating-innodb.html 110102 17:07:40 [ERROR] Plugin 'InnoDB' init function returned error. 110102 17:07:40 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 17. But i have a pid and socket file 18. "mysql_upgrade" doesn't work (hangs up) 19. Also "mysql -u root" doesn't work (hangs up) I've read http://dev.mysql.com/doc/refman/5.1/en/error-creating-innodb.html and other related webpages. I think is something related with permissions in jail, but I can't figure it out. So, my final hope is this email. Anyone has any idea? Thanks in advance! Lulu PS: I'm using: - FreeBSD Current (amd64) - Geli encryption - ZFS v28 with world and kernel build with src r215329 (patched with head-v28-v2.patch from Martin Matuska)(the patch doesn't work on the latest src) - Ports updated one week ago - Ezjail installed one week ago (buildworld with src updated one week ago)