View previous topic :: View next topic |
Author |
Message |
mrbeeye n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 04 Nov 2005 Posts: 19
|
Posted: Wed Nov 09, 2005 2:56 pm Post subject: Chrooted DHCP and no pid file |
|
|
I have DHCP running chrooted in /chroot/dhcp.
I cannot use Code: | /etc/init.d/dhcp stop | or Code: | /etc/init.d/dhcp restart |
I have to kill manually DHCP process and delete Code: | /var/lib/init.d/started/dhcp |
I explored that there's no pid file in Code: | /chroot/dhcp/var/run |
Here is
Code: | checkconfig() {
if [ ! -f "${CHROOT}/etc/dhcp/dhcpd.conf" ] ; then
eerror "No ${CHROOT}/etc/dhcp/dhcpd.conf file exists!"
return 1
fi
if [ ! -f "${CHROOT}/var/lib/dhcp/dhcpd.leases" ] ; then
ebegin "Creating dhcpd.leases"
touch "${CHROOT}/var/lib/dhcp/dhcpd.leases" || return 1
eend $?
fi
ebegin "Setting ownership on dhcpd.leases"
chown dhcp:dhcp "${CHROOT}/var/lib/dhcp/dhcpd.leases" || return 1
eend $?
}
start() {
checkconfig || return 1
ebegin "Starting ${CHROOT:+chrooted }dhcpd"
start-stop-daemon --start --quiet --exec /usr/sbin/dhcpd \
-- -pf ${CHROOT}/var/run/dhcp/dhcpd.pid \
-user dhcp -group dhcp ${DHCPD_OPTS} \
${CHROOT:+-chroot ${CHROOT}} ${IFACE}
eend $?
}
stop() {
ebegin "Stopping dhcpd"
start-stop-daemon --stop --quiet --pidfile \
"${CHROOT}/var/run/dhcp/dhcpd.pid"
eend $?
}
|
Also, here is
Code: | IFACE="eth0"
# Insert any other options needed
DHCPD_OPTS="-q"
# If you wish to run dhcp in a chroot, run:
# ebuild /var/db/pkg/net-misc/<dhcp version>/<dhcp-version>.ebuild config
# and un-comment the following line.
# You can specify a different chroot directory but MAKE SURE it's empty.
CHROOT="/chroot/dhcp"
# If you need name resolution under a chroot, uncomment the following:
#export LD_PRELOAD="/usr/lib/libresolv.so /usr/lib/libnss_dns.so"
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Dizzutch Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/43155227841fff663d6d73.png)
Joined: 09 Nov 2004 Posts: 463 Location: Worcester, MA
|
Posted: Wed Nov 09, 2005 9:27 pm Post subject: |
|
|
your script shows the file going in ${CHROOT}/var/run/dhcp/dhcp.pid
since ${CHROOT} is /chroot/dhcp your file should be in /chroot/dhcp/var/run/dhcp/dhcp.pid are the permissions correct? does this path exist? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pjp Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1154772887439692d88303b.jpg)
Joined: 16 Apr 2002 Posts: 20588
|
Posted: Wed Nov 09, 2005 10:54 pm Post subject: |
|
|
Moved from Other Things Gentoo _________________ Quis separabit? Quo animo? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mrbeeye n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 04 Nov 2005 Posts: 19
|
Posted: Thu Nov 10, 2005 6:05 am Post subject: |
|
|
Dizzutch wrote: | since ${CHROOT} is /chroot/dhcp your file should be in /chroot/dhcp/var/run/dhcp/dhcp.pid are the permissions correct? does this path exist? | Of course it exists. Permissions for the last dhcp directory is rwx-r-xr-x and owner dhcp:dhcp. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|