August 4, 201411 yr Hello! I have an unRAID that is running disconnected from the internet. There are two separate subnets, one on the internet and one that is not. There is one PC with dual NIC's, each setup for one of the subnets. This PC gets its time using the Windows time service, and is setup as an NTP server. I have setup unRAID to use the PC's IP address for its NTP server. It correctly pulls the time from the windows machine. I also have the router on the offline subnet point to the windows machine for NTP, and it also correctly pulls the time. This seems to keep all the devices on both subnets time synced within a couple of seconds. Now, I have a Dune media players that I am trying to put on the offline subnet. The Dune media players also need an NTP server for time. I had wanted to point them at unRAID for NTP. However, entering unRAID's IP doesn't seem to do anything. I have also tried the IP address for the windows machine and the router, both of which are also NTP servers, but it doesn't seem to update the time from those either. The Dune's run a version of linux. I have used telnet to connect to them, and then used the date command to manually set the correct date. The problem is that after you power them off, the date always resets to Dec 31, 2007. At power up, they always pull from the designated NTP server to get the time, and if none is present, go with the default date. So the Dune acts as if no NTP server is present, no matter what I point it at. I have pinged all the NTP server locations from the Dune, at it can see all of them. However, if I connect the Dune to the online subnet, and setup pool.ntp.org as the NTP server, it will pull the correct time. So I'm at a loss as to why the Dune can pull the time if I connect it to an NTP server out on the internet, but it doesn't seem to want to pull the time if I connect it to a Windows, unRAID, or router NTP server (I guess technically maybe they are SNTP). I don't know a great deal about NTP, or if there are other ways to configure it that might help. Can anyone be of any help? Thanks!
August 4, 201411 yr Author Any way to get the time from unRAID using the cat command? I tried cat </dev/tcp/unRAIDIP/time but it returns a blank output. Also tried udp version of the command and it just seems to hang. Also tried it with ntp instead of time in the udp command, but it still hangs. Anything else to try?
August 5, 201411 yr unRAID does not have NTP service enabled. My 6b6 and 5.05 machine answered a ntpdate -q request.
August 5, 201411 yr unRAID does not have NTP service enabled. My 6b6 and 5.05 machine answered a ntpdate -q request. I have always used ntpd in unRAID since 4.7. No configuration needed. All the other computers on my network sync from it.
August 5, 201411 yr No clue whether this will help, but I found some documentation. http://files3.dune-hd.com/sdk/misc/dune_dhcp_settings.txt It looks like if the dhcp server in your router can hand out ntp info, the dune may prefer to use it. The docs say it will only do that if ntp isn't manually configured, but maybe the implementation is borked, and the dune is trying to use an ntp server it can't reach. Maybe you could try forcing pool.ntp.org to resolve to a machine inside your network? Can you edit /etc/hosts on the dune box?
August 6, 201411 yr Author Well, I've spent way to many hours digging into this and I hit a dead end with everything I try. I've unlocked telnet on the Dune, so I can telnet in and access all the linux scripts that run at boot. My opinion is the NTPClient script is a mess. Actually, I believe it contains some errors in the scripting that prevent it from executing the entire script. There are three If-Then conditionals at the end of the script, one of which would allow the Dune to get time from unRAID. However, there is a conditional check that occurs before the If-Then's are reached. The conditional is always true and the script is instructed to exit if it is true. I could correct the script, except for one problem. All scripts are in the firmware section of the Dune, and these are all read-only executable scripts. I can't change or replace any of them. So the Dune SDK explains that you can create a /config/boot location and put executable scripts in there. All scripts in that folder will run when the root application is launched (which the final step of root is to launch the shell). So I tried creating a script that uses the simple rdate command to set the time from unRAID. This command works from telnet after the Dune has booted. However, it will not work when used in this special boot section. Apparently the very first thing root does is launch these scripts (according to the log file). However, the Dune cannot resolve the IP address of the rdate command, because the hardware has not initialized the network adapter yet. It doesn't occur until 2-3 steps after running boot scripts. There is no way to change the order of the boot scripts. And other than through telnet, there doesn't appear to be a way to get any scripts to run after the unit is booted. The only scripts that run after fully booted are read only scripts from the firmware folder. So I haven't given up fully yet, but anything easy or obvious doesn't look like it will work. I trying to find any kind of script that might execute after the network initializes, but that isn't in the read-only part of the file system. Then I could tuck in the rdate command and all would be fine.
August 6, 201411 yr Author Finally! I found a workaround that mostly seems to work. Since I couldn't run a script with rdate at boot because the network adapter doesn't initialize until after user boot scripts run, i made two scripts, one with the rdate command (time_sync) and one that schedules crontab (zcron). I made two additions to crontab, one that runs time_sync at reboot and one that runs it hourly. At first this was still giving me fits with a "bad interpreter" error message when using crontab. I was using Notepad++ setup for Unix, which has always worked for me before without problem. Fortunately the Dune was loaded with dos2unix. After running this on the script file, it started working. The job scheduled for reboot didn't work. Apparently it still fires off before the adapter is initialized, or after the reboot event that would fire it off (and jobs aren't persistent). So I had to make an edit to run it every minute for the first five minutes. This seemed to work, because now the time gets updated ~1 minute after the Dune boots, and again each hour. It also allowed me to find another error in the Dune. The read-only scripts in the dune include one that initializes crontab and adds some jobs at every boot. One of the jobs is scheduling how often the NTP server is called to update the time (cronjob to run the NTPClient). Turns out there are some typos in the code that generates the command Crontab is supposed to run. So the NTPClient is never being called hourly/daily/weekly like it is supposed to do. So really it looks like the Dunes are really just a hot mess when it comes to time synchronization. Typos and errors everywhere in their scripts (and why not wait until the hardware is all initialized to run any user scripts?). I was running firmware from 2012, so I though maybe installing the latest stable version would improve things, but all the same errors are still there.
Archived
This topic is now archived and is closed to further replies.