I just installed Apache for the first time on Gentoo. When I chroot into Gentoo from another OS (in this case Microknoppix) and try to start Apache (with
/etc/init.d/apache2 start) I get the error
WARNING: apache2 is already starting. If I try to stop it I get
ERROR: apache2 stopped by something else. Apache functions normally when I run it under Gentoo without the chrooting.
I could probably get away with running Apache from within Gentoo itself and skip the chrooting entirely but I'm curious. Why is this happening and can I fix it?
I talked to someone earlier who thought it might be:
- a problem with the with multiple programs trying to use the same pid file or
- a problem with the way Gentoo handles chrooting.
But I don't know enough about either to discuss the subjects coherently myself.
Edit: Here are the commands I've been using to chroot into Gentoo, cribbed from the install instructions in the Gentoo handbook:
sudo mount --bind /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
sudo mount -t proc proc /mnt/gentoo/proc
sudo mount --rbind /sys /mnt/gentoo/sys
sudo mount --rbind /dev /mnt/gentoo/dev
sudo chroot /mnt/gentoo /bin/bash
env-update && source /etc/profile
export PS1="(chroot) $PS1"