SlackwareThis Forum is for the discussion of Slackware Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
To the best of my knowledge this is how the chroot man is used:
/usr/sbin/chroot /chroot/apache/ /usr/sbin/httpd
The first part ' /usr/sbin/chroot' is simply the full path to chroot.
The second part '/chroot/apache/' is the directory you want to become '/' for your chroot jail
The third part '/usr/sbin/httpd' is the command *WITHIN* the chroot jail that you want to execute.
I've been working on a Slackware Apache chroot package for the last couple of days, and I've come across many things in this little endevor. Remember to include things like /bin/sh and it's dependencies, as well as all necessary dependencies for everything in the apache system. Without these it doesn't work. /bin/sh alone is needed simply to execute script from within the chroot, or at least that's what my experimentation has lead me to believe. To test this theory, try to do 'ls -l' from inside the chroot jail by doing the following:
mkdir -p /chroot/bin <<< or whatever your chroot dir will be.
ldd /bin/sh << displays dependencies for the executable. Normally these are lib* files located in /lib
cp /lib/libnecssary.libs* /chroot/lib/ <<< copy them into the chroot jail
ldd /bin/ls << same as above
cp /lib/libwhatever /chroot/lib/ <<< copy any necessary libs over here too.
......Then test it by trying the following command:
chroot /chroot/ /bin/ls -l /
What you should see is a very simple ls -l of the jailed / filesystem.
(Bottom line: /sbin/update-grub won't chroot because it's only a SCRIPT now, at least in ubuntu lucid 10.04). Are there more scripts in /sbin? Bet that won't break anything, will it? Anybody know the package name for the security update which is just a script to examine the first bytes of every expected bin in /sbin, looking for telltale "#!/bin/bash haha your bin be hours now" in the first 40 bytes of expected binaries.
Duh. The real update-grub dep-free bin is in /usr/sbin/update-grub.
Back in the last century, a few noids had /usr on a separate partition. That would mean all fscked up in init=/bin/sash, with no way to fix boot sector or fsck md's. Don't worry, just be happy like a window, let it all shine on through, yeah, do me like a window. I must have left my window open last night cuz boot initland tools are all on /usr partition now.
Get a usbkey with tools on it.
I am. That's what I'm doing, making a usbkey with tools. Or I'd be like a window.
When are you going to make an actual contribution to this thread? This is Slackware, there was no talk about GRUB until you started. Slackware doesn't even install GRUB. We do not have "sash" in Slackware and why the heck would the OP have to create a USB key in order to populate his chroot environment?
Get off the dope before you answer next time. Excellent first two posts to LQ...
Simply copy /bin/sh into /chroot/apache2/bin/
Then confirm that all libs found with ldd are also present in the chroot.
cp /lib64/libtermcap.so.2 /chroot/apache2/lib64/libtermcap.so.2
cp /lib64/libdl.so.2 /chroot/apache2/lib64/libdl.so.2
Stop apache(if running) and start again.
My thanks go to you zhizaki.
If issues persist, I suggest going through the chroot setup process step-by-step and confirm all parts are complete.