Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Aug 2007 01:48:03 +0100
From:      Adam J Richardson <fatman.uk@gmail.com>
To:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Problem: Apache chroots but MySQL doesn't
Message-ID:  <46C641C3.5040504@crackmonkey.us>

next in thread | raw e-mail | index | archive | help
Hi all,

I've got an unusual problem with my server. It just restarted after a 
power cut. Everything came back up apart from MySQL. The server refuses 
to chroot it.

%sudo /uetc/rc.d/mysql-server start
Password:
[: chroot: unexpected operator
Starting mysql.
%chroot: /jail/mysql: Operation not permitted

The first error is normal. It doesn't seem to cause a problem. It's the 
'Operation not permitted' error that bothers me. I've tried a manual chroot:

%sudo chroot /jail/mysql /bin/sash
Stand-alone shell (version 3.7)
 > exit
%

No problem there. The startup script is the one installed by the 
mysql51-server port, except for the 'command' line which now reads:

command="chroot /jail/mysql mysqld_safe"

It looks as if the script isn't running as root. It must be though, 
because when I change the command variable to "chroot /home/`whoami`", 
it throws an error because /home/root doesn't exist.

I don't think the chroot binary itself is a problem as it started Apache 
just fine. So, I'm out of ideas. Help please?

TiA,
Adam J Richardson

ps. I always forget this bit:

%uname -a
FreeBSD my.server.com 6.2-RELEASE FreeBSD 6.2-RELEASE #0: Fri Jan 12 
10:40:27 UTC 2007 
root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46C641C3.5040504>