Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Dec 2009 12:32:41 +0200
From:      Manolis Tzanidakis <mtzanidakis@gmail.com>
To:        Miroslav Lachman <000.fbsd@quip.cz>
Cc:        "freebsd-jail@freebsd.org" <freebsd-jail@freebsd.org>
Subject:   Re: Cant't access mysql.sock (running on a jail) from a separate jail
Message-ID:  <15EE2FD6-6C18-43DC-AD22-4437EFE465DD@gmail.com>
In-Reply-To: <4B1C30E6.5020309@quip.cz>
References:  <924B5EF7-AE3E-4A9E-B0D6-2FAC0151570A@gmail.com> <4B1C30E6.5020309@quip.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks a lot for answering. The hard link method works (all
jails in the same fs). I' ve also tried unionfs but never
managed to get it working. Anyone care to share a working
example with unionfs? It might be useful in future projects.

--
Manolis Tzanidakis
mtzanidakis@gmail.com

07 =CE=94=CE=B5=CE=BA 2009, 0:32, =CE=BF/=CE=B7 Miroslav Lachman =
<000.fbsd@quip.cz> =20
=CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5:

> Manolis Tzanidakis wrote:
>> Hello all,
>> maybe this is already answered, but searching the list's archives
>> was not working at the moment.
>>
>> Anyway, I've got a server running 8.0-RELEASE with various
>> jails, all setup with ezjail. One jail is running mysql and another
>> is running apache.
>> I have a directory /usr/jails/mysqltmp (owned by mysql:mysql)
>> on the host system, which is mounted in both jails as /mysqltmp  =20
>> with:
>>
>> /etc/fstab.mysqljail:
>> /usr/jails/mysqltmp /usr/jails/mysqljail/mysqltmp nullfs rw 0 0
>>
>> /etc/fstab.apachejail:
>> /usr/jails/mysqltmp /usr/jails/mysqlapache/mysqltmp nullfs ro 0 0
>> (tried it also with 'rw', same results)
>>
>> I've setup my.cnf in mysqljail to write the mysql.sock socket in
>> /mysqltmp and I can access mysql from this jail without problems,
>> as expected.
>> On the apachejail the socket shows up in /mysqltmp, however I can't
>> connect:
>>
>> # mysql -S /mysqltmp/mysql.sock -u root -p
>> ERROR 2002 (HY000): Can't connect to local MySQL server through
>> socket '/mysqltmp/mysql.socket' (2)
>
> You can use hardlink if you have your jails on one filesystem, or =20
> you can try unionfs instead of nullfs.
>
> Miroslav Lachman



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15EE2FD6-6C18-43DC-AD22-4437EFE465DD>