Can't 'dhcpd -d' in background ?

Simon Hobson dhcp1 at thehobsons.co.uk
Thu Jul 13 13:02:24 UTC 2006


Joe Bill wrote:

>run 'dhcpd' as root, off it goes on it's own, running in the background.
>
>   run 'dhcpd -d', there it runs in the foreground, locking up your terminal.
>
>   What's the '-d' option ?
>
>   man dhcpd says about the '-d' option:
>
>   "To have dhcpd log to the standard error descriptor, specify the 
>-d  flag. This can be useful for debugging, and also it sites where 
>a  complete log of all dhcp activity must be kept but syslogd is not 
>reliable or otherwise cannot be used."
>
>   Nothing about 'dhcpd -d' running in the foreground instead of the 
>default background behavor when 'dhcpd' is invoked without the '-d' 
>option. Why is the behavior different then ?
>
>   Furthermore, still in man dhcpd, we can read about a '-f' option:
>
>   "To run dhcpd as a foreground process, rather than allowing it to 
>run  as a daemon in the background, the -f flag should be specified."
>
>   Tried 'dhcpd -d -f', just in case. Unfortunately, dhcpd still 
>won't run in the background.
>
>   So, how do you do it, running 'dhcpd - d' in background ? If you can't,

I think you've answered your own question (in part).

d=debug ? If you use -d then the process needs to have sterr 
connected - which effectively means it needs to stay connected to the 
terminal if started from the command line. If using it as suggested 
by the man page, then you would need some other program or shell to 
create a suitable destination for sterr before invoking dhcpd - the 
process would need to daemonise itself before starting dhcpd as a 
child.

I assume the -f option is for situations where some process (system 
management tool ?) is going to start it as a child and monitor it - 
but otherwise you want it to behave as normal (ie logging to syslog 
etc).

If you want to start it as a child of your terminal, but not lock the 
terminal itself, then you could background it (eg "dhcpd -d &"), but 
it will still be attached to the terminal and will be killed if you 
quit the terminal.


If you don't want to run dhcpd in your terminal, and you don't know 
what this all means, then  the answer is simple : don't specify 
either -d or -f

Simon


More information about the dhcp-users mailing list