DHCP error.
Brian Candler
B.Candler at pobox.com
Thu Jul 6 20:41:25 UTC 2006
On Thu, Jul 06, 2006 at 09:42:29AM -0700, Keith Woodworth wrote:
> It used to be that you could put:
>
> /usr/sbin/dhcpd
>
> or any other command line to start a daemon in rc.conf, and there used to
> be rc.local to start local daemons too years ago and I am still used to
> putting the whole path, including command line args directly in rc.conf.
>
> Now /usr/libexec/save-entropy runs from cron every 11 mins running as
> operator, which has no root privs and it reads in rc.conf.
>
> So I think what it does is when /usr/libexec/save-entropy runs it
> reads in rc.conf and sees:
>
> /usr/sbin/dhcpd
>
> then tries to run it as operator. Operator has no root privs, hence the
> error.
Ah. That would certainly explain it :-)
/etc/rc.local does still exists though (well, you need to create it
yourself, but if you do it is run at system startup time)
In the new world order, for isc-dhcpd installed from packages, all you do is
dhcpd_enable="YES"
in rc.conf. All the scripts in /usr/local/etc/rc.d/* are run at bootup time,
but they only start the daemon if they have a corresponding foo_enable="YES"
in rc.conf. (Or _should_ ... maybe not all scripts have been converted over
yet)
> /usr/libexec/save-entropy has something to do with generating randomness,
> I'm not exactly sure as Ive not read up on it yet and there is no manpage.
It's just a shell script - you can read it. It saves state from the entropy
gathering, so if the machine is rebooted it the random number generator
doesn't start up in a predictable state.
> I suppose I could just comment that line in cron but I'm not sure what
> else it might break, nor do I want to as it was put there for a reason I'm
> sure. :)
Other things run from cron, and you don't want those attempting to start
dhcpd as different users either. The solution is to move your
"/usr/sbin/dhcpd" command to /etc/rc.local
> So now I have to invoke the daemons properly with:
>
> dhcpd_enable="yes"
>
> in rc.conf.
Yes if you are using ports, which have startup scripts in
/usr/local/etc/rc.d/. However if you are using isc-dhcpd compiled from
source, then rc.local is probably the right place, unless you put a suitable
script in /usr/local/etc/rc.d/
But this still doesn't explain the "permission denied" error you see if you
start dhcpd as root (assuming you *are* trying to start it as root, that is)
Regards,
Brian.
More information about the freebsd-isp
mailing list