Re: Running script within chroot jail (OT)
On Wed, Dec 28, 2005 at 12:09:20PM +1000, Michael Bellears wrote:
> Hoping someone can point me in the right direction as to how I would
> translate the above into a shell script, as my mediocre attempt fails:
You were so close! You need to run "chroot /path /command"
(As you can see if you run "man chroot".)
eg:
--
#!/bin/sh
chroot /var/chroot/apache/ /usr/local/awstats/tools/awstats_updateall.pl now
--
Or for another example:
--
chroot /var/chroot/apache /etc/init.d/apache stop
--
The command you run is specified in the *chroot* filesystem, rather
than on the full system. So "/usr/local" rather than
"/var/chroot/apache/usr/local".
Steve
--
Debian GNU/Linux System Administration
http://www.debian-administration.org/
Reply to: