Changing database values for dhcpd

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Changing database values for dhcpd

Postby rgmhtt » Sun Mar 08, 2009 11:03 am

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...

User avatar
moredruid
Expert
Posts: 791
Joined: Tue Jan 20, 2009 1:33 am
Location: Netherlands
Contact:

Re: Changing database values for dhcpd

Postby moredruid » Sun Mar 08, 2009 12:14 pm

have you looked (and modified) in /etc/dhcpd.conf already?

your DHCP network settings should be there, not in MySQL
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D2173656C7572206968616D41snlbxq' | dc
Galileo - HP Proliant ML110 G6 quad core Xeon 2.4GHz, 4GB RAM, 2x750GB RAID1 + 2x1TB RAID1 HDD

User avatar
moredruid
Expert
Posts: 791
Joined: Tue Jan 20, 2009 1:33 am
Location: Netherlands
Contact:

Re: Changing database values for dhcpd

Postby moredruid » Sun Mar 08, 2009 12:15 pm

oh... MySQL user and stuff howto etc. is here: http://forums.amahi.org/viewtopic.php?f=8&t=119
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D2173656C7572206968616D41snlbxq' | dc
Galileo - HP Proliant ML110 G6 quad core Xeon 2.4GHz, 4GB RAM, 2x750GB RAID1 + 2x1TB RAID1 HDD

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: Changing database values for dhcpd

Postby rgmhtt » Sun Mar 08, 2009 3:08 pm

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...

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: Changing database values for dhcpd

Postby cpg » Sun Mar 08, 2009 6:26 pm

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.
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: Changing database values for dhcpd

Postby rgmhtt » Thu Mar 12, 2009 6:15 am

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:

User avatar
moredruid
Expert
Posts: 791
Joined: Tue Jan 20, 2009 1:33 am
Location: Netherlands
Contact:

Re: Changing database values for dhcpd

Postby moredruid » Thu Mar 12, 2009 6:25 am

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 :(
echo '16i[q]sa[ln0=aln100%Pln100/snlbx]sbA0D2173656C7572206968616D41snlbxq' | dc
Galileo - HP Proliant ML110 G6 quad core Xeon 2.4GHz, 4GB RAM, 2x750GB RAID1 + 2x1TB RAID1 HDD

User avatar
cpg
Administrator
Posts: 2618
Joined: Wed Dec 03, 2008 7:40 am
Contact:

Re: Changing database values for dhcpd

Postby cpg » Thu Mar 12, 2009 6:56 am

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.
My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 8GB RAM, 1TBx2+3TBx1

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: Changing database values for dhcpd

Postby rgmhtt » Thu Mar 12, 2009 8:29 am

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!

User avatar
rgmhtt
Posts: 421
Joined: Sun Jan 11, 2009 9:26 am

Re: Changing database values for dhcpd

Postby rgmhtt » Tue Sep 08, 2009 9:12 pm

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...

Who is online

Users browsing this forum: No registered users and 57 guests