Gentoo Archives: gentoo-user

From: Fernando Rodriguez <frodriguez.developer@×××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] dhcpd always shows "crashed" even though it's running
Date: Fri, 04 Sep 2015 19:29:48
Message-Id: BLU436-SMTP1097BFC69240FA4911F9DDF8D570@phx.gbl
In Reply to: Re: [gentoo-user] dhcpd always shows "crashed" even though it's running by Mike Edenfield
1 On Friday, September 04, 2015 7:25:31 AM Mike Edenfield wrote:
2 > On 9/3/2015 8:59 PM, Fernando Rodriguez wrote:
3 > > On Thursday, September 03, 2015 8:09:02 PM Mike Edenfield wrote:
4 >
5 > >> What makes rc-status think something is crashed, and how can I fix this?
6 > >>
7 > >> basement log # rc-status -v | grep crashed
8 > >> dhcpd [ crashed ]
9 > >> basement log # ps aux | grep dhcpd
10 > >> root 2214 0.0 0.0 8268 876 pts/0 S+ 19:47 0:00 grep
11 > >> --colour=auto dhcpd
12 > >> dhcp 2648 0.0 0.6 30028 12136 ? Ss Aug29 0:00
13 > >> /usr/sbin/dhcpd -cf /etc/dhcp/dhcpd.conf -q -pf /var/run/dhcp/dhcpd.pid
14 > >> -lf /var/lib/dhcp/dhcpd.leases -user dhcp -group dhcp -chroot
15 > >> /chroot/dhcp enp0s7
16 > >>
17 > >>
18 > >
19 > > This is just a guess but it could be the permissions on the pid file on
20 > > /chroot/dhcp/var/run/dhcp/. So stop the daemon, delete the file, check that
21 the
22 > > directory is owned by dhcp:dhcp and start the daemon again.
23 > >
24 >
25 > That was a good guess -- I did find something else unrelated wrong with
26 > the log file permissions :) But it didn't help here.
27 >
28 > The directory is owned by dhcp:dhcp, and when I stop the service, the
29 > pid file is deleted automatically, which I assume means the permissions
30 > are correct:
31 >
32 > basement log # dir /chroot/dhcp/var/run/dhcp
33 > total 8
34 > drwxr-xr-x 2 dhcp dhcp 4096 Sep 4 07:21 ./
35 > drwxr-xr-x 3 root root 4096 Oct 4 2009 ../
36 > basement log # /etc/init.d/dhcpd start
37 > * Starting chrooted dhcpd ...
38 > [ ok ]
39 > basement log # dir /chroot/dhcp/var/run/dhcp
40 > total 12
41 > drwxr-xr-x 2 dhcp dhcp 4096 Sep 4 07:21 ./
42 > drwxr-xr-x 3 root root 4096 Oct 4 2009 ../
43 > -rw-r--r-- 1 root root 6 Sep 4 07:21 dhcpd.pid
44 > basement log # rc-status -v | grep crashed
45 > dhcpd [ crashed ]
46 >
47
48 After doing that again cat the pid file and compare it to the PID for dhcpd.
49 If it looks right you can try copying to /var/run/dhcp/ and run rc-status
50 again, if it works this time then portage is looking for the pid file outside
51 the chroot. You set it up using the DHCPD_CHROOT in /etc/conf.d/dhcpd right?
52 I don't use that option since I use apparmor but it looks like the init script
53 will do the right thing in traccking the pid file if setup correctly. Are you
54 using the latest version (may need to run etc-update)?
55
56 --
57 Fernando Rodriguez