From owner-freebsd-ports-bugs@FreeBSD.ORG Thu Apr 7 13:25:48 2005 Return-Path: Delivered-To: freebsd-ports-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 94A3C16A4CE for ; Thu, 7 Apr 2005 13:25:48 +0000 (GMT) Received: from andxor.it (relay.andxor.it [195.223.2.3]) by mx1.FreeBSD.org (Postfix) with SMTP id A618A43D41 for ; Thu, 7 Apr 2005 13:25:46 +0000 (GMT) (envelope-from ale@FreeBSD.org) Received: (qmail 17768 invoked from network); 7 Apr 2005 13:25:45 -0000 Received: from unknown (HELO ?192.168.2.5?) (192.168.2.5) by andxor.it with SMTP; 7 Apr 2005 13:25:45 -0000 Message-ID: <425534D8.9070707@FreeBSD.org> Date: Thu, 07 Apr 2005 15:25:44 +0200 From: Alex Dupre User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050329) X-Accept-Language: en-us, en MIME-Version: 1.0 To: vd@datamax.bg References: <200504062254.j36MsUTX077449@freefall.freebsd.org> <4254FC55.9050805@FreeBSD.org> <20050407105532.GA24882@sinanica.bg.datamax> In-Reply-To: <20050407105532.GA24882@sinanica.bg.datamax> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/79597: databases/mysql323-server does not find my.cnf if not placed in /var/db/mysql/ X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2005 13:25:48 -0000 Vasil Dimov wrote: > --defaults-extra-file=${mysql_dbdir}/my.cnf is just perfect. > > What do you meen by ${PREFIX}? It is not set while mysql-server.sh > is executing. Do you meen port's install perfix and therefore > /usr/local/etc/my.cnf or something like /var/db/mysql/etc/my.cnf or > just /etc/my.cnf? The first you said: check /usr/local/etc/my.cnf and then /var/db/mysql/my.cnf (where /usr/local is install prefix and /var/db/mysql is mysql_dbdir). This would be ideal, but ... > It seems that --defaults-file= and --defaults-extra-file= cannot > be passed as arguments to the mysql server at the same time. you are right, so we should use the my_print_defaults like this: --defaults-file=/usr/local/etc/my.cnf `my_print_defaults --config-file=${mysql_dbdir}/my.cnf mysqld server mysqld_safe safe_mysqld` > So we should probably use only --defaults-extra-file? This is enough to fix your problem, but I'm thinking to a global solution. The above command-line options are not optimal and break POLA, since /etc/my.cnf is not parsed anymore. Probably the best solution is adding --default-extra-file=${mysql_dbdir}/my.cnf and patching the mysql source file mysys/defaults.c in this way: --- mysys/default.c.orig Thu Apr 7 15:18:21 2005 +++ mysys/default.c Thu Apr 7 15:20:20 2005 @@ -46,18 +46,9 @@ /* Which directories are searched for options (and in which order) */ const char *default_directories[]= { -#ifdef __WIN__ -"C:/", -#else "/etc/", -#endif -#ifdef DATADIR -DATADIR, -#endif +"/usr/local/etc/", "", /* Place for defaults_extra_dir */ -#ifndef __WIN__ -"~/", -#endif NullS, }; In this way we check for my.cnf in /etc/, /usr/local/etc/ and /var/db/mysql/ (where /usr/local and /var/db/mysql are always dynamically set by PREFIX and mysql_dbdir). Can you test the above patch and tell me if it works as expected? -- Alex Dupre