LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-09-2008, 11:57 PM   #16
dkm999
Member
 
Registered: Nov 2006
Location: Seattle, WA
Distribution: Fedora
Posts: 407

Rep: Reputation: 35

A careful reading of the manpage for dhcpd confirms the idea posted by jonlake that you are probably not actually executing the script /etc/rc.d/init.d/dhcpd, but rather are running the program dhcpd with the parameter stop, which is interpreted as an interface (which does not exist; thus 0.0.0.0). Give the command this way:
Code:
# /etc/rc.d/init.d/dhcpd stop
A similar careful reading of the manpage for chkconfig says that it pays attention to some things called override files; they are found in /etc/chkconfig.d/{servicename}. If there is a file /etc/chkconfig.d/dhcpd, its contents will take precedence over the comment lines in the /etc/rc.d/init.d/dhcpd file, and may be the reason that you are having so much trouble with this.

BTW, the second code section posted by jonlake is just what chkconfig would have done if it had obeyed the line in your /etc/rc.d/init.d/dhcpd script that I posted about 3 posts back.
 
Old 05-10-2008, 01:44 AM   #17
linuxnoob001
LQ Newbie
 
Registered: Mar 2008
Location: Australia
Distribution: Fedora Core 5
Posts: 14
Blog Entries: 1

Original Poster
Rep: Reputation: 0
Thanks for getting back..

The init.d script is as follows
"====================
"Netrw Directory Listing
" /etc/init.d
" Sorted by name
" Sort swquence: [\/]$,*,\.os,\.h$,\.info$,\.swp$,\.obj$
" Quick Help: <F1>:help -:go up dir D;delete R:rename
"=======================

../
./
NetworkManager
NetworkManagerDispatcher
acpid
anacron
apmd
atd
autofs
avahi-daemon
avahi-dnsconfd
bluetooth
capi
cpuspeed
crond
cups
cups-config-daemon
dc_client
dc_server
dhcdbd
dhcpd
diskdump
dovecot
dund
firstboot
functions
gpm
haldaemon
halt
hidd
hplip
hsqldb
httpd
iptables
irda
irqbalance
isdn
jexec
killall
kudzu
lirc
mdmonitor
mdmpd
messagebus
named
netdump
netfs
netplugd
network
nfs
nfslock
nscd
ntpd
pand
portmap
psacct
rdisc
readahead
readahead_early
restorecond
rpcgssd
prcidmapd
rpcsvcgssd
rwhod
saslauthd
sendmail
single
smartd
smb
spamassassin
squid
sshd
syslog
tux
vncserver
vsftpd
webmin
winbind
wap_supplicant
xfs
ypbind
yum

==============================

I have added the above mentioned lines
ln -s /etc/init.d/dhcpd /etc/rc.3/S65dhcpd
ln -s /etc/init.d/dhcpd /etc/rc.3/K65dhcpd

except where creating the link to /etc/rc.3/S65dhcpd it is /etc/rc3.d/S65dhcpd

same for every run level instead of being rc.3,4,5 it is rc3.d,rc4.d,rc5.d
I hope Im clear. im running it now...
 
Old 05-10-2008, 01:53 AM   #18
linuxnoob001
LQ Newbie
 
Registered: Mar 2008
Location: Australia
Distribution: Fedora Core 5
Posts: 14
Blog Entries: 1

Original Poster
Rep: Reputation: 0
after running /etc/init.d/dhcpd stop

getting the same error not configured to listen on any interfaces. No subnet declaration for stop(0.0.0.0). if this is not what you want please write a subnet declaration in your dhcpd.conf file for the network segment to which interface stop is attached.
Ok I have restarted the machine and once I did ifup eth0 and issued the command /etc/init.d/dhcpd start it gives me the same error as above. Now if I say just dhcpd from the commandline it starts fine but doesnt stop as above. it starts with the following lines after it

Internet Systems Consortium DHCP Server V3.0.6
Copyright blah blah
All rights reserved.
Wrote 4 Leases to leases file.
Listening on LPF/eth0/XX:XX:XX:XX:XX:XX/SS1
Sending on LPF/eth0/XX:XX:XX:XX:XX:XX:XX/SS1
Sending on Socket/fallback/fallback-net

Hope this makes sense.
 
Old 05-10-2008, 02:03 AM   #19
linuxnoob001
LQ Newbie
 
Registered: Mar 2008
Location: Australia
Distribution: Fedora Core 5
Posts: 14
Blog Entries: 1

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by dkm999 View Post
A careful reading of the manpage for dhcpd confirms the idea posted by jonlake that you are probably not actually executing the script /etc/rc.d/init.d/dhcpd, but rather are running the program dhcpd with the parameter stop, which is interpreted as an interface (which does not exist; thus 0.0.0.0). Give the command this way:
Code:
# /etc/rc.d/init.d/dhcpd stop
A similar careful reading of the manpage for chkconfig says that it pays attention to some things called override files; they are found in /etc/chkconfig.d/{servicename}. If there is a file /etc/chkconfig.d/dhcpd, its contents will take precedence over the comment lines in the /etc/rc.d/init.d/dhcpd file, and may be the reason that you are having so much trouble with this.

BTW, the second code section posted by jonlake is just what chkconfig would have done if it had obeyed the line in your /etc/rc.d/init.d/dhcpd script that I posted about 3 posts back.
Thanks but there is no /etc/chkconfig.d/dhcpd there is no /etc/chkconfig.d there is /etc/rc.d/init.d/dhcpd and /etc/init.d/dhcpd both binary files

I have tried running both commands with stop but I get the same error I think there must be another version of dhcpd running cos with the above path I cannot start or stop but when i just say dhcpd it starts but when I say dhcpd stop it gives the same error. Hope this makes sense


Ok Just one more thing after reffering to the dhcpd man page I did vim /var/run/dhcpd.pid and then issued the command kill pid the proc id of dhcpd in the file listed that time and it works perfectely Ok just wanted to let you guys know bout this.

Last edited by linuxnoob001; 05-10-2008 at 02:48 AM. Reason: added more info
 
Old 05-10-2008, 03:08 PM   #20
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
What it sounds like is perhaps it is already starting on boot. Reboot and do ps aux | grep dhcpd to see if it is starting at reboot.
Also, I have not known any of the startup scripts to be binary files in /etc/init.d, so this seems odd to me. I'm guessing the file in your startup directory and the file in /sbin/dhcpd are the same file, you could do a diff on both files to see if that is the case (substitute the correct paths for each file on your machine).
Code:
diff /etc/rc.d/init.d/dhcpd /usr/sbin/dhcpd
If you find the file in the /etc directory to be binary and the same as the file in the sbin directory, below is what a typical startup script looks like, and you can put the following in place of you dhcpd file.

Code:
#!/bin/bash

case $1 in 
  start)
    if [[ -f /var/run/dhcpd.pid ]]; then
       echo "Dhcpd is already started"
       exit 1
    else
      /usr/sbin/dhcpd
    fi
  ;;
  stop)
   kill $(cat /var/run/dhcpd.pid)
  ;;
esac
Note this is very simplistic and you can expand on it, or see if you can get a copy for the startup script for dhcpd on fedora.
Remember to set this file as executable if you do put it in there.
 
Old 05-11-2008, 06:19 AM   #21
linuxnoob001
LQ Newbie
 
Registered: Mar 2008
Location: Australia
Distribution: Fedora Core 5
Posts: 14
Blog Entries: 1

Original Poster
Rep: Reputation: 0
Thanks for the script I owe the community and you jonlake a big one Now its running and I have made some tweaks on webmin as well and completely deleted the binary from /etc/init.d and added the above provided script and changed permissions and it starts with the system, I can even issue the command service dhcpd start and -- stop it works. I guess now I have a live working version of DHCPD and now back to the learning boards to make it a secure dhcp server. Just one question though. I can see the list of active leases etc from webmin and I can ping the server and other clients from other clients but I wasnt able to ping a client from the server.
 
Old 05-11-2008, 11:07 AM   #22
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
If these are windows xp clients, by default they have the firewall enabled so that is most likely the reason. If they are linux clients, do an /usr/sbin/iptables -L to see if they have iptables enabled.
 
  


Reply

Tags
dhcp, server


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP/DNS Server Setup epicmove Linux - Networking 2 09-23-2007 03:45 PM
Setup a secure DHCP server carl0ski Linux - Networking 4 02-25-2007 08:44 PM
Trying to setup a DHCP server cwwilson721 Slackware 2 02-09-2006 02:22 AM
dhcp server setup help requested gonus Linux - Networking 5 07-09-2004 07:21 PM


All times are GMT -5. The time now is 11:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration