LINUX.ORG.RU
ФорумAdmin

траблы с mysql в chroot среде


0

0

Добрый день, друзья.

Решил запустить mysql в chroot окружении, пользовалься статьей http://www.opennet.ru/base/sec/mysql_sec.txt.html

Запнулся на запуске базы из под chroot, выдает ошибку, что юзер не известен, хотя passwd и grop скопировал в виртуальную среду.

# /usr/bin/chrootuid /home/mysqld /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/mysqld.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock

/usr/sbin/mysqld: user unknown

anonymous

Ответ на: Re: траблы с mysql в chroot среде от j262

Re: траблы с mysql в chroot среде

Да есть!

В strace пробовал - выдает кучу всего, в чем я не очень смыслю:

execve("/usr/bin/chrootuid", ["/usr/bin/chrootuid", "/home/mysqld", "/usr/sbin/mysqld", "--basedir=/usr", "--datadir=/var/lib/mysql", "--user=mysql", "--pid-file=/var/lib/mysql/mysqld"..., "--skip-locking", "--port=3306", "--socket=/var/lib/mysql/mysql.so"...], [/* 79 vars */]) = 0 brk(0) = 0x501000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b5c2267e000 uname({sys="Linux", node="dasg", ...}) = 0 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=116024, ...}) = 0 mmap(NULL, 116024, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2b5c2267f000 close(3) = 0 open("/lib64/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\322\1\0"..., 832) = 832 fstat(3, {st_mode=S_IFREG|0755, st_size=1475924, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b5c2269c000 mmap(NULL, 2289896, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x2b5c22780000 madvise(0x2b5c22780000, 2289896, MADV_SEQUENTIAL|0x1) = 0 mprotect(0x2b5c228a6000, 1048576, PROT_NONE) = 0 mmap(0x2b5c229a6000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x126000) = 0x2b5c229a6000 mmap(0x2b5c229ab000, 16616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2b5c229ab000 close(3) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b5c229b0000 arch_prctl(ARCH_SET_FS, 0x2b5c229b06d0) = 0 mprotect(0x2b5c229a6000, 12288, PROT_READ) = 0 munmap(0x2b5c2267f000, 116024) = 0 chdir("/home/mysqld") = 0 brk(0) = 0x501000 brk(0x522000) = 0x522000 socket(PF_FILE, SOCK_STREAM, 0) = 3 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR) fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0 poll([{fd=3, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1 sendto(3, "\2\0\0\0\v\0\0\0\7\0\0\0passwd\0\"", 20, MSG_NOSIGNAL, NULL, 0) = 20 poll([{fd=3, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"passwd\0", 7}], msg_controllen=24, {cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, {5}}, msg_flags=0}, 0) = 7 fstat(5, {st_mode=S_IFREG|0600, st_size=217016, ...}) = 0 pread(5, "\1\0\0\0h\0\0\0\4\0\0\0\1\0\0\0\1\5KF\0\0\0\0\323\0\0\0"..., 104, 0) = 104 mmap(NULL, 217016, PROT_READ, MAP_SHARED, 5, 0) = 0x2b5c2269d000 close(5) = 0 close(3) = 0 socket(PF_FILE, SOCK_STREAM, 0) = 3 fcntl(3, F_GETFL) = 0x2 (flags O_RDWR) fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0 connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0 poll([{fd=3, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1 writev(3, [{"\2\0\0\0\0\0\0\0\21\0\0\0", 12}, {"/usr/sbin/mysqld\0", 17}], 2) = 29 poll([{fd=3, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLHUP}], 1, 5000) = 1 read(3, "\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377"..., 36) = 36 close(3) = 0 write(2, "/usr/sbin/mysqld: user unknown\n", 31/usr/sbin/mysqld: user unknown ) = 31 exit_group(1) = ? Process 3776 detached

anonymous ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.