Page 1 of 1

Changing database values for dhcpd

Posted: Sun Mar 08, 2009 11:03 am
by rgmhtt
I need to change the values set in dhcpd at bootup. I am ASSuMEing this information is stored locally in a mySQL database and if I change that, I will get what I want...

I am willing for now to give up WINS and PDC functionality, I HAVE to replace my old NT server, but I HAVE to work within my networking constraints.

So I would use phpmyadmin to change the SQL tables. All I need to know is the database name (and where it is located), and what table has the dhcpd information.

I hope whatever is kept on your server does not overwrite this once my server connects...

Re: Changing database values for dhcpd

Posted: Sun Mar 08, 2009 12:14 pm
by moredruid
have you looked (and modified) in /etc/dhcpd.conf already?

your DHCP network settings should be there, not in MySQL

Re: Changing database values for dhcpd

Posted: Sun Mar 08, 2009 12:15 pm
by moredruid
oh... MySQL user and stuff howto etc. is here: http://forums.amahi.org/viewtopic.php?f=8&t=119

Re: Changing database values for dhcpd

Posted: Sun Mar 08, 2009 3:08 pm
by rgmhtt
have you looked (and modified) in /etc/dhcpd.conf already?

your DHCP network settings should be there, not in MySQL
Sure, you change /etc/dhcpd.conf, reboot, and /etc/dhcpd.conf is back to what it was...

And that is why you need to make the changes in the database...

Re: Changing database values for dhcpd

Posted: Sun Mar 08, 2009 6:26 pm
by cpg
Sure, you change /etc/dhcpd.conf, reboot, and /etc/dhcpd.conf is back to what it was...

And that is why you need to make the changes in the database...
correct :)

it's also built for reliability. if it gets screwed up, restarting will "sync" back the settings and it should be back working.

Re: Changing database values for dhcpd

Posted: Thu Mar 12, 2009 6:15 am
by rgmhtt
OK. Using phpMyAdmin, I got into the database and looked at the settings. To my dismay I see that I can change the mask to 255.255.255.240, but I cannot change the range! The default range is NOT in my subnet. This is not good. I guess I will have to submit a features request to add the range values to the database, but meanwhile:

Where is the script that builds /etc/dhcpd.conf so I can change the values it plugs in to dhcpd.conf?

If this is a program that I cannot change, how can I make it so this program does not step on /etc/dhcpd.conf with every boot until this can be fixed???

:cry:

Re: Changing database values for dhcpd

Posted: Thu Mar 12, 2009 6:25 am
by moredruid
I fear that monit triggers this, but if not, you can run a job in rc.local which copies a "correct" /etc/dhpcd.conf and reloads dhcpd. Monit should be running and have completed all stages before loading rc.local.

However, if monit actively monitors the contents of /etc/dhcpd.conf I think you're out of luck :(

Re: Changing database values for dhcpd

Posted: Thu Mar 12, 2009 6:56 am
by cpg
OK. Using phpMyAdmin, I got into the database and looked at the settings. To my dismay I see that I can change the mask to 255.255.255.240, but I cannot change the range! The default range is NOT in my subnet. This is not good. I guess I will have to submit a features request to add the range values to the database, but meanwhile:

Where is the script that builds /etc/dhcpd.conf so I can change the values it plugs in to dhcpd.conf?

If this is a program that I cannot change, how can I make it so this program does not step on /etc/dhcpd.conf with every boot until this can be fixed???

:cry:
it's in /usr/bin/hdactl.

please do file a feature request (platform), as this is an area that we will look at soon.

Re: Changing database values for dhcpd

Posted: Thu Mar 12, 2009 8:29 am
by rgmhtt
Whew, this took a bit to get right...

First the range values' 4th octet are set in two places in the script. I had to change both of course.

Then there was the subnet value which is the variable full_net that I also had to change twice.

Finally I THOUGHT I had it right, but during the reboot, I noticed dhcpd failing to start. I checked the conf and it looked right, then I checked the server status and it was running. Oh, the conf file is written after the server is started at boot, so it is later when it is restarted with your control service that it gets the new conf file and runs right.

OK I have a feature request. Actually two as I see the db password hardcoded into this script!

Re: Changing database values for dhcpd

Posted: Tue Sep 08, 2009 9:12 pm
by rgmhtt
First the range values' 4th octet are set in two places in the script. I had to change both of course.

Then there was the subnet value which is the variable full_net that I also had to change twice.

OK I have a feature request. Actually two as I see the db password hardcoded into this script!
I see this is still 'broken'....

Network address, DHCP range, and db password are in the hdactl script...