What's new

ntpMerlin ntpMerlin - NTP Daemon for AsusWRT Merlin

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I assume you have rebooted? What do you see in /etd/passwd?
Couple of times

adminRT-AC86U/tmp/etc cat passwd
admin:x:0:0:admin:/root:/bin/sh
nas:x:100:100:nas:/dev/null:/dev/null
nobody:x:65534:65534:nobody:/dev/null:/dev/null
tor:x:65533:65533:tor:/dev/null:/dev/null
 
Couple of times

adminRT-AC86U/tmp/etc cat passwd
admin:x:0:0:admin:/root:/bin/sh
nas:x:100:100:nas:/dev/null:/dev/null
nobody:x:65534:65534:nobody:/dev/null:/dev/null
tor:x:65533:65533:tor:/dev/null:/dev/null
try reinstalling chrony? this is puzzling as the user is there. you may need to post on a chrony forum for further help
 
I used set -x on /opt/etc/init.d/S77chronyd:

Code:
Choose an option:    r

ntpMerlin: Restarting chronyd...

+ [ restart = start ]
+ [ restart = restart ]
+ logger -st S77chronyd Waiting for NTP to sync before starting...
S77chronyd: Waiting for NTP to sync before starting...
+ ntptimer=0
+ nvram get ntp_ready
+ [ 1 = 0 ]
+ [ 0 -ge 300 ]
+ [ -f /opt/share/ntpmerlin.d/config ]
+ SCRIPT_STORAGE_DIR=/jffs/addons/ntpmerlin.d
+ [ -f /opt/etc/init.d/S06chronyd ]
+ mkdir -p /opt/var/lib/chrony
+ mkdir -p /opt/var/run/chrony
+ chown -R nobody:nobody /opt/var/lib/chrony
+ chown -R nobody:nobody /opt/var/run/chrony
+ chmod -R 770 /opt/var/lib/chrony
+ chmod -R 770 /opt/var/run/chrony
+ ENABLED=yes
+ PROCS=chronyd
+ ARGS=-r -u nobody -f /jffs/addons/ntpmerlin.d/chrony.conf
+ PREARGS=
+ PRECMD=killall ntp && killall ntpd
+ POSTCMD=
+ DESC=chronyd
+ PATH=/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ . /opt/etc/init.d/rc.func
+ ACTION=restart
+ CALLER=
+ ansi_red=\033[1;31m
+ ansi_white=\033[1;37m
+ ansi_green=\033[1;32m
+ ansi_yellow=\033[1;33m
+ ansi_blue=\033[1;34m
+ ansi_bell=\007
+ ansi_blink=\033[5m
+ ansi_std=\033[m
+ ansi_rev=\033[7m
+ ansi_ul=\033[4m
+ check
+ echo -e -n \033[1;37m Checking chronyd...
+ pidof chronyd
+ [ -n  ]
+ echo -e             \033[1;31m dead. \033[m
+ return 1
+ start
+ [  != yes -a  = cron ]
+ [ yes != yes ]
+ echo -e -n \033[1;37m Starting chronyd... \033[m
 Starting chronyd... + pidof chronyd
+ [ -n  ]
+ killall ntp && killall ntpd
+ COUNTER=0
+ LIMIT=10
+ chronyd -r -u nobody -f /jffs/addons/ntpmerlin.d/chrony.conf
+ pidof chronyd
+ [ -z 22367 -a 0 -le 10 ]
+
+ pidof chronyd
+ [ -z  ]
+ echo -e             \033[1;31m failed. \033[m
             failed.
+ logger Failed to start chronyd from .
+ return 255
Press enter to continue...
 
I appreciate the switch to Chrony greatly!

My drift and jitter have both dropped by an order of magnitude, and now my offset is more or less reliably maintained within a +/-2ms band as a result.

(Oddly, about a week before I made the switch from ntpd to Chrony, that 7zip segfault problem that I was experiencing went away by itself.)
Plugin is now operating flawlessly :).
 
I updated to the dev branch v3.0.0, selected chrony in the web ui. The offset and jitter reported 0.0ms consistently. Tried to update and got this.

Code:
Oct 25 19:50:01 ntpMerlin: MD5 hash of ntpMerlin does not match - downloading updated v3.0.0
Oct 25 19:50:02 ntpMerlin: New version of S77chronyd downloaded
Oct 25 19:50:03 S77chronyd: Waiting for NTP to sync before starting...
Oct 25 19:50:14 Audionut: Failed to start chronyd from .
Oct 25 19:50:14 ntpMerlin: /jffs/addons/ntpmerlin.d/chrony.conf does not exist, downloading now.
Oct 25 19:50:15 ntpMerlin: ntpMerlin successfully updated
Oct 25 19:50:33 ntpMerlin: No new version - latest is v3.0.0
Oct 25 19:50:39 ntpMerlin: Restarting chronyd...
Oct 25 19:50:39 S77chronyd: Waiting for NTP to sync before starting...
Oct 25 19:50:54 Audionut: Failed to start chronyd from .
 
I updated to the dev branch v3.0.0, selected chrony in the web ui. The offset and jitter reported 0.0ms consistently. Tried to update and got this.

Code:
Oct 25 19:50:01 ntpMerlin: MD5 hash of ntpMerlin does not match - downloading updated v3.0.0
Oct 25 19:50:02 ntpMerlin: New version of S77chronyd downloaded
Oct 25 19:50:03 S77chronyd: Waiting for NTP to sync before starting...
Oct 25 19:50:14 Audionut: Failed to start chronyd from .
Oct 25 19:50:14 ntpMerlin: /jffs/addons/ntpmerlin.d/chrony.conf does not exist, downloading now.
Oct 25 19:50:15 ntpMerlin: ntpMerlin successfully updated
Oct 25 19:50:33 ntpMerlin: No new version - latest is v3.0.0
Oct 25 19:50:39 ntpMerlin: Restarting chronyd...
Oct 25 19:50:39 S77chronyd: Waiting for NTP to sync before starting...
Oct 25 19:50:54 Audionut: Failed to start chronyd from .
hm. what do you get if you run at the command line?
Code:
/opt/etc/init.d/S77chronyd start
 
Code:
Audionut@RT-AX88U-E188:/tmp/home/root# /opt/etc/init.d/S77chronyd start
S77chronyd: Waiting for NTP to sync before starting...
 Starting chronyd...              failed.
 
Code:
Audionut@RT-AX88U-E188:/tmp/home/root# /opt/etc/init.d/S77chronyd start
S77chronyd: Waiting for NTP to sync before starting...
Starting chronyd...              failed.
can you check /jffs/addons/ntpmerlin.d/chrony.conf exists?

can you try running
Code:
chronyd -r -u nobody -f /jffs/addons/ntpmerlin.d/chrony.conf
 
I think I tried the update option (after returning to NTPD), and it reported ntpd dead, which is an error I was having back here: https://www.snbforums.com/threads/ntpmerlin-ntp-daemon-for-asuswrt-merlin.55756/post-625468

Did a force update and that seems to have fixed it.
Code:
Oct 25 20:07:26 ntpMerlin: Downloading latest version (v3.0.0) of ntpMerlin
Oct 25 20:07:28 ntpMerlin: ntpMerlin successfully updated
Oct 25 20:07:40 ntpMerlin: Restarting chronyd...
Oct 25 20:07:40 S77chronyd: Waiting for NTP to sync before starting...
Oct 25 20:07:40 chronyd[7484]: chronyd version 3.5 starting (+CMDMON +NTP +REFCLOCK -RTC +PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)
Oct 25 20:07:40 chronyd[7484]: Initial frequency -13.592 ppm
Oct 25 20:07:40 Audionut: Started chronyd from .
Oct 25 20:07:45 chronyd[7484]: Selected source 45.76.113.31

can you try running
Code:
chronyd -r -u nobody -f /jffs/addons/ntpmerlin.d/chrony.conf

After the forced update.
Code:
Another chronyd may already be running (pid=7484), check /opt/var/run/chrony/chronyd.pid

Still need a copy of that file?

edit: Thanks for the assist.

Ok, maybe not.
Code:
Oct 25 20:12:27 chronyd[9636]: Fatal error : Another chronyd may already be running (pid=7484), check /opt/var/run/chrony/chronyd.pid

Let me work out how to obtain that file.
 
Last edited:
I think I tried the update option (after returning to NTPD), and it reported ntpd dead, which is an error I was having back here: https://www.snbforums.com/threads/ntpmerlin-ntp-daemon-for-asuswrt-merlin.55756/post-625468

Did a force update and that seems to have fixed it.
Code:
Oct 25 20:07:26 ntpMerlin: Downloading latest version (v3.0.0) of ntpMerlin
Oct 25 20:07:28 ntpMerlin: ntpMerlin successfully updated
Oct 25 20:07:40 ntpMerlin: Restarting chronyd...
Oct 25 20:07:40 S77chronyd: Waiting for NTP to sync before starting...
Oct 25 20:07:40 chronyd[7484]: chronyd version 3.5 starting (+CMDMON +NTP +REFCLOCK -RTC +PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)
Oct 25 20:07:40 chronyd[7484]: Initial frequency -13.592 ppm
Oct 25 20:07:40 Audionut: Started chronyd from .
Oct 25 20:07:45 chronyd[7484]: Selected source 45.76.113.31



After the forced update.
Code:
Another chronyd may already be running (pid=7484), check /opt/var/run/chrony/chronyd.pid

Still need a copy of that file?

edit: Thanks for the assist.
hm i wonder if something didn't download properly when you first opted to try chrony. I'll give that a test later

EDIT: this may be why....fixed hopefully https://github.com/jackyaz/ntpMerlin/commit/3098ff66d0afb83b757ab0ef640a9a1db4983502
 
Last edited:
Last commit still didn't fix for me...

Code:
t chronyd -r -u nobody -f /jffs/addons/ntpmerlin.d/chrony.conf                                                        Could not get user/group ID of nobody
 
I have had this issue a few times in the past. Try to remove the chrony.pid file and restart chrony:

$ rm /opt/var/run/chrony/chrony.pid
$ /opt/etc/init.d/S77chronyd restart

Once in a while (experimenting...) I have ended up with a stale chrony.pid. It won't start if that file exists.
 
I have had this issue a few times in the past. Try to remove the chrony.pid file and restart chrony:

$ rm /opt/var/run/chrony/chrony.pid
$ /opt/etc/init.d/S77chronyd restart

Once in a while (experimenting...) I have ended up with a stale chrony.pid. It won't start if that file exists.
rm: can't remove '/opt/var/run/chrony/chrony.pid': No such file or directory

Holy sh** :)
 
rm: can't remove '/opt/var/run/chrony/chrony.pid': No such file or directory

Holy sh** :)
Hmm, look at your chrony.conf file. See if there is a definition for the location of the pidfile.
Mine shows:

# chronyd writes its process ID to a file. If you try to start a second
# copy of chronyd, it will detect that the process named in the file is
# still running and bail out. If you want to change the path to the PID
# file, uncomment this line and edit it. The default path is shown.

pidfile /opt/var/run/chrony/chronyd.pid

Your might be different. If you do see this, try to remove the chrony.pid file.

If there is no pidfile, double check chrony is not running.

$ ps | grep chronyd

If not chronyd and no pidfile - try the restart one more time using the CLI. It might complain as to why it won't start. Make sure you have chrony.conf setup in /jffs/addons/ntpmerlin.d (Jacks default is fine)

$ chronyd -r -u nobody -f /jffs/addons/ntpmerlin.d/chrony.conf
 
Last edited:
Hmm, look at your chrony.conf file. See if there is a definition for the location of the pidfile.
Mine shows:

# chronyd writes its process ID to a file. If you try to start a second
# copy of chronyd, it will detect that the process named in the file is
# still running and bail out. If you want to change the path to the PID
# file, uncomment this line and edit it. The default path is shown.

pidfile /opt/var/run/chrony/chronyd.pid

Your might be different. If you do see this, try to remove the chrony.pid file.

If there is no pidfile, double check chrony is not running.

$ ps | grep chronyd

If not chronyd and no pidfile - try the restart one more time using the CLI. It might complain as to why it won't start. Make sure you have chrony.conf setup in /jffs/addons/ntpmerlin.d (Jacks default is fine)

$ chronyd -r -u nobody -f /jffs/addons/ntpmerlin.d/chrony.conf
I think that chrony is running, don't know why.

ps | grep chronyd
24317 admin 5436 S grep chronyd
 
I think that chrony is running, don't know why.

ps | grep chronyd
24317 admin 5436 S grep chronyd
No, unfortunately that is grep matching the command with the word chrony in it.
No, chronyd is not running.

Did you try starting chronyd from the command line? If not, try that and see if there are any error messages.
 
No, unfortunately that is grep matching the command with the word chrony in it.
No, chronyd is not running.

Did you try starting chronyd from the command line? If not, try that and see if there are any error messages.
chronyd -r -u nobody -f /jffs/addons/ntpmerlin.d/chrony.conf Could not get user/group ID of nobody


And if I try with other used, admin for example, the same.happens
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top