{"id":12,"date":"2005-03-13T04:12:17","date_gmt":"2005-03-13T03:12:17","guid":{"rendered":"http:\/\/blog.blackdown.de\/2005\/03\/13\/updated-mysql-chroot-script\/"},"modified":"2016-10-29T03:51:03","modified_gmt":"2016-10-29T01:51:03","slug":"updated-mysql-chroot-script","status":"publish","type":"post","link":"https:\/\/blackdown.de\/articles\/updated-mysql-chroot-script\/","title":{"rendered":"Updated MySQL Chroot Script"},"content":{"rendered":"

Debian’s<\/a> latest MySQL<\/a> packages are compiled with --with-mysqld-ldflags = -all-static<\/code>.<\/p>\n

That means libc.so.6<\/code> is linked statically now. But glibc’s getpwnam<\/code> and getpwuid<\/code> implementations still need the shared libraries. The needed libraries must be copied into the chroot because mysqld<\/code> calls those functions after calling chroot<\/code>. I’ve updated the mysql-chroot<\/a><\/code> script accordingly.
\n(The rest of the chroot setup procedure still works as described in
Chrooting MySQL on Debian<\/a>.)<\/em><\/p>\n

By the way, I’ve filed a wishlist bug at Debian’s BTS (#299265<\/a>). mysqld<\/code> should do all \/etc\/passwd<\/code> lookups before calling chroot<\/code>. That way chrooting would work without $CHROOT\/etc\/passwd<\/code> and with copying any libraries into the chroot. That’s how Apache and Bind 9 do it.<\/p>\n

March 17th, 2005:<\/strong> Debian has removed the -all-static<\/code> flag again. I’m leaving the additional bits in the chroot script however, just in case the maintainers decide to add the flag again.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"

Debian’s latest MySQL packages are compiled with –with-mysqld-ldflags = -all-static. That means libc.so.6 is linked statically now. But glibc’s getpwnam and getpwuid implementations still need the shared libraries. The needed libraries must be copied into the chroot because mysqld calls those functions after calling chroot. I’ve updated the mysql-chroot script accordingly. (The rest of the
[→
Read the rest of this entry<\/a>]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[6,3,8],"tags":[],"yoast_head":"\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n