View previous topic :: View next topic |
Author |
Message |
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sat Jul 24, 2010 1:25 pm Post subject: Is it safe to start services inside a chroot? |
|
|
I've got a 32bit chroot install on my amd64 machine, and I want to have distccd running in it for my laptop.
I'm not sure how openrc will react in a chroot though, can I just do "rc-service distccd start" without side effects, or does it need to be run manually? Or even, does anyone know a better way to get a 32bit-gcc distcc working on it? |
|
Back to top |
|
|
lxg Veteran
Joined: 12 Nov 2005 Posts: 1019 Location: Aachen, Germany
|
Posted: Sat Jul 24, 2010 5:35 pm Post subject: |
|
|
I would say: no, it's not safe. About distcc, I don't know, but I'd say it's usually a bad idea.
Because services may uses specific files for interprocess communication (take for example /var/lock and /var/run … many services create files there to indicate that they're running).
For example: If you start Apache in the chroot, it will grab port 80 and create the file /var/run/apache2.pid, where it puts its process ID. Now if you try to start another Apache from outside the chroot, first thing it does is to check /var/run/apache2.pid for an already running process. It won't find this file, so it will try to start and grab port 80, but will fail with a cryptic error message.
This is only one example, and I haven't even verified it, but this is the kind of stuff that can happen. _________________ lxg.de – codebits and tech talk |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9608 Location: beyond the rim
|
Posted: Fri Jul 30, 2010 3:39 am Post subject: |
|
|
The most obvious problem would likely be that openrc in the chroot wouldn't know which services are already running, so it would try to start basic stuff like networking as well (which is a bad idea). |
|
Back to top |
|
|
Veldrin Veteran
Joined: 27 Jul 2004 Posts: 1945 Location: Zurich, Switzerland
|
Posted: Fri Jul 30, 2010 7:29 am Post subject: |
|
|
though chroot-prison is (in general) a good idea security wise, it a bad idea to emulate an entire system inside a chroot...
secondly, distcc should support crosscomplie between archs, and therefore is no need in running it inside a chroot.
DistCC Guide, DistCC Crosscompile Guide
To be honest, I have not tried it. |
|
Back to top |
|
|
sera Retired Dev
Joined: 29 Feb 2008 Posts: 1017 Location: CET
|
Posted: Fri Jul 30, 2010 8:01 am Post subject: |
|
|
Veldrin wrote: |
secondly, distcc should support crosscomplie between archs, and therefore is no need in running it inside a chroot.
DistCC Guide, DistCC Crosscompile Guide
To be honest, I have not tried it. |
I'm doing this for a long time now and it works flawlessly. Definitely the way to go. |
|
Back to top |
|
|
|