The PC in question is a CuBox-i mini-pc. Since this PC doesn't have a battery, everytime the PC reboots the hardware clock is reset back to the same date every time, which is "2014-07-08 00:00".
I have NTP configured to get the current date and time from our NTP server, which does work eventually once the network comes up. Once the network is up, the NTP daemon runs and fixes the date and time.
However, I believe once NTP runs and changes the date and time, the DHCP lease timeout is reached (*14400 I believe). And because the time jumps ahead so far, it thinks the DHCP lease has timed-out and it gets a new IP Address. So within about a couple minutes of powering on, or rebooting the PC, it renews its DHCP Address and gets a new/2nd address.
I was wondering if maybe there is a way I can write the current system date and time so when it reboots, it doesn't think its 2014... Is anything like that possible?
You could try using the date command to write the date to a file at shutdown and letting date set the date to what was recorded in that file at boot time before the network comes up.
This User Gave Thanks to Scrutinizer For This Post:
You could use a @reboot cron job to read the date at boot time, but of course that's only effective when the cron daemon is started, and you need something else to write the file before shutting down.
As you want to tightly couple it to the DHCP daemon as much as possible, not a great solution, but is modifying the dhcpd start / stop script an option? You could also just run ntp to update the time before it starts the DHCP daemon.
Changing the order services start in could be another option, but there's no guarantee that ntdp will update the time before it gets to dhcpd.
(edit, after Bakunin's reply): I presume also that assigning static address(es) to the client(s) is not an option?
Last edited by Scott; 10-12-2017 at 05:15 PM..
Reason: edit
Scott's idea is valid anyway, but if i remember TCP/IP correctly (my copy of TCP/IP Illustrated is not within reach right now) the DHCP server manages lease times, not the client.
You can also configure the DHCP server to always give the same IP-address to this client, because DHCP is the supersset of the older bootp-protocol, which did exactly that. Clients are identified by the MAC-address(es) of the interface(s) requiring an address. This way it doesn't matter if the address is requested once or twice.
Hey Guys, thanks again for the replies. Much appreciated!
All good ideas. I do have the ability to do any of those that you suggested, as I have access to the DHCP server(s) that we run. But, these little mini-PCs are located in each of our branch locations, and their local Router/Switches are running as their DHCP servers, so that would be a lot of editing I would need to do in each location in order to statically assign the IP Address. And occasionally I need them to ship the PC back as it runs off an SDCard and gets all screwy, so I need to re-image the SDCard. When this happens I usually ship them a new one before they ship back the current one, so the MAC Address changes from time to time.
I guess I could modify each CuBox PC to assign its own address statically, that's another good option...
The date/time thing on these little PCs is annoying though. Not only does it have the DHCP thing going on, all the log's timestamps are all screwy inside the log files, as well as their file's modification times. It's like every file was modified 7-8-2014 or whatever the current day's date is. When looking at the boot log file, or messages, etc... You can see at boot it shows "7-8-2014 00:xx" and then during the boot you see NTP start, (*and then the Network services) which corrects the time. Like this below:
I guess it's not really a huge problem, its just gotten very annoying. So maybe trying to get the date to write to a file and then write it back at boot-up (*maybe as soon as the shell starts) would kill a few birds with one stone...
Dear Community!
i try to instaled the sco 6 in hp proliant ML350g8
but unsucces,
the trouble when i do instaled it undetected hardisk
please help me
:(:o (7 Replies)
Hi all,
currently I'm facing a issue in linking a .so file.
In my build machine, I've libcrypto.so.6 and there is a softlink as libcrypto.so.
In my make file I'm trying to link to the lib using -L -lcrypto and it is success and created my test.exe.
When I copy this test.exe to other... (4 Replies)
Hello Folks,
My RHEL 4.3 server got crashed due to hardware crash,system hard disk and motherboard replaced and RAID rebuilt done.
while rebooting the server the server is gone into single user mode due to /sda5 var partition not able to mount.
Error :- " wrong fs type, bad... (1 Reply)
Hi All,
I am very new to unix and to this forum.Suggest me a solution in fixing the below issue.
Actually ia m executing java program through script.
The command is like
java pgm &
The above cmd runs the java program continuous as a background thread.
This script is executed from a... (1 Reply)
I searched the forum and found a similar question (https://www.unix.com/ip-networking/119108-dhcpd-related-questions.html), but my config is already utilizing the suggested fix... :(
My setup:
eth0 connected to Motorola DSL Modem via bridged mode (giving the public IP to the interface), IP... (1 Reply)
The date increment worked fine until date reached 25/10, which is DLS change date.
/bin/date --date="091025 1 day" +%y%m%d;
the output is 091025
Is this a bug or something missing from the code ! (3 Replies)
Hi All,
I am trying to send a mail from my application through SMTP in solaris 9 but unable to send a mail.Same code is able to send mail in Windows.
As unix has more security,So as per me,it is due to security reason..
So please let me know what I need to do to send a mail properly.
what... (5 Replies)
Hi all
Hi could anyone tell me how i can set the
Hardware Clock to the System Time, and set the System Time from the
Hardware Clock.
i am using RHEL 4.0.
Thanks in advance. (1 Reply)
Guys could you please tell me which appropriate command is used to set hardware (BIOS) clock so that the system keeps time when it reboots & how it's used. I use Linux
Thank you (2 Replies)