Problem: Apache chroots but MySQL doesn't

Adam J Richardson fatman.uk at gmail.com
Fri Aug 17 17:48:14 PDT 2007


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 at dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
%


More information about the freebsd-questions mailing list