Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent execution of DietPi-Run_NTPD detected #3010

Closed
Sopor opened this issue Jul 26, 2019 · 11 comments
Closed

Concurrent execution of DietPi-Run_NTPD detected #3010

Sopor opened this issue Jul 26, 2019 · 11 comments
Labels
Milestone

Comments

@Sopor
Copy link

Sopor commented Jul 26, 2019

I'm running nginx on DietPi but all the log files suddenly change to be 0 bytes. I also noticed that all the log files for the system also are 0 bytes.

I then run dietpi-software (to change the log issue), but it did have some problems with the NTP (NTPD: Waiting for completion of systemd-timesyncd (1/60) and it will try 60 times) so i follow the instructions, but now i get this after selecting my gateway as an NTP server:

image

Could you tell me how i make the log files to be persistent? This seems to not be an easy task to do :(
I was trying to follow your instructions here

@Sopor
Copy link
Author

Sopor commented Jul 26, 2019

I manage to change it on another DietPi and when it work as it should it wasn't so hard :)

@MichaIng
Copy link
Owner

MichaIng commented Jul 26, 2019

@Sopor
Many thanks for your report.

Jep logfiles are cleared every every hour due to RAMlog, otherwise RAM would fill up unlimited.
So you need to disable/uninstall DietPi-RAMlog via dietpi-software. Choose "Custom", as rsyslog is actually a very obsolete thing on modern Debian. systemd-journald is active anyway which stores all system logs well sortable and readable via journalctl in RAM. rsyslog just doubles this, making all syslogs a more-than-double effort.
I will change this to remove the rsyslog option completely and instead allow to make journald boot persistent, which is quite easy as well.
EDIT: Ah yeah RAMlog option 2 of course is an alternative as well, /var/log/ files will still be cleared hourly but content stored to disk for later review if required.

About the NTPD error:
Jep I think I know what causes this loop:

  • When you run into a time sync error, you can open dietpi-config to change settings.
  • But when you change time sync settings, the same script is called again.
  • What we need to do is from within dietpi-config, check if the script already runs and in case skip the additional call.

But in your particular case you managed to solve everything now?

@MichaIng MichaIng added this to the v6.26 milestone Jul 26, 2019
@Sopor
Copy link
Author

Sopor commented Jul 26, 2019

I still not manage to get it to work

[ INFO ] DietPi-Run_NTPD | NTPD: Waiting for completion of systemd-timesyncd (10/10)

I run pfsense as a router and i have an NTP server running... I'm not sure what it want?

It doesn't matter what i try to add to mirror it won't work. I even tried ntp.stupi.se but no success.

@MichaIng
Copy link
Owner

@Sopor
Please paste: journalctl -u systemd-timesyncd

@Sopor
Copy link
Author

Sopor commented Jul 27, 2019

$ sudo journalctl -u systemd-timesyncd
-- Logs begin at Thu 2016-11-03 18:16:42 CET, end at Sat 2019-07-27 14:23:13 CEST. --
Jun 08 00:17:14 DietPi systemd[1]: Starting Network Time Synchronization...
Jun 08 00:17:14 DietPi systemd[1]: Started Network Time Synchronization.
Jun 08 00:23:23 DietPi systemd-timesyncd[662]: Synchronized to time server 192.36.143.130:123 (0.debian.pool.ntp.org).
Jun 08 00:23:24 DietPi systemd[1]: Stopping Network Time Synchronization...
Jun 08 00:23:24 DietPi systemd[1]: Stopped Network Time Synchronization.

@MichaIng
Copy link
Owner

@Sopor

Jun 08 00:17:14 DietPi systemd[1]: Started Network Time Synchronization.
Jun 08 00:23:23 DietPi systemd-timesyncd[662]: Synchronized to time server 192.36.143.130:123 (0.debian.pool.ntp.org).

It looks like it took 6 minutes to sync time...
It should be ~1 second.
It syncs with 0.debian.pool.ntp.org currently, which is default on Debian but not optional. "Gateway" (local router) should be best in very most cases.

All instances of run_ntpd are killed, right? killall -w run_ntpd

and i have an NTP server running

What you mean by this? An NTP server in the router of on the DietPi machine? Or the "ntp" package installed?

@Sopor
Copy link
Author

Sopor commented Jul 27, 2019

Instead of syncing to time.windows.com i sync my computers to my pfsense.

@MichaIng
Copy link
Owner

MichaIng commented Jul 27, 2019

@Sopor
Yeah this makes sense for the DietPi system as well. When you choose "Gateway" in dietpi-config > Network Options: Misc > NTP mirror it should do this, if the router is the default internet gateway for the network.
Switching this and then running journalctl -u systemd-timesyncd should show:

systemd-timesyncd[662]: Synchronized to time server <ip_of_your_router>

as one of the last lines then.

@MichaIng
Copy link
Owner

MichaIng commented Sep 3, 2019

PR up: #3095
Some other enhancements are and need to be done with this, however concurrent execution from both sides are resolved.

@codebeat-nl
Copy link

@MichaIng Thanks! journalctl -u systemd-timesyncd did the trick.

@MichaIng
Copy link
Owner

journalctl -u systemd-timesyncd only prints the services logs but does not change something 😉. So I guess the time it took to search and run the command was the solution, as the concurrent script finished in the meantime 🙂.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants