Network Time Daemon not running/ SOLVED disabled and switch to chrony

Started by Yewtink, November 02, 2024, 02:28:34 AM

Previous topic - Next topic
A while back I change the NTP server to one closer to me.  It worked for a while but I noticed it stopped.  I tried to enter the default 0.opnsense.pool.ntp.org and attempted to restart the service.  service ntpd restart, when I did I got this error:
ntpd does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable



Quote from: Yewtink on November 02, 2024, 02:28:34 AM
A while back I change the NTP server to one closer to me.  It worked for a while but I noticed it stopped.  I tried to enter the default 0.opnsense.pool.ntp.org and attempted to restart the service.  service ntpd restart, when I did I got this error:
ntpd does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable

You cannot use the service command to control OPNsense components. You must use the UI or configctl on the CLI.

OPNsense is not stock FreeBSD, you cannot apply arbitrary howtos that show up in google.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

I was reconfiguring my OPNsense setup, and when I attempted to restart, the screen flashed but refused to reboot. I checked the logs, but there was no helpful information to diagnose the issue. After some research, I found a suggestion to run the command service ntpd restart, but that only displayed an error.

I noticed that the ntpd.conf listed the servers as:

pool 0.opnsense.pool.ntp.org
pool 1.opnsense.pool.ntp.org
pool 2.opnsense.pool.ntp.org
pool 3.opnsense.pool.ntp.org

This was different from the usual server 0.opnsense.pool.ntp.org I expected to find. I'm guessing this might be due to modifications in this custom OS.  Or could it affect the NTP service?

What you found in the file is how pools should be configured. And again - "service" does not work apart from some community plugins in OPNsense so your research turned up something completely wrong.

The best source of information is the official documentation, the second best probably this forum. Unless folks confuse keys and certificates  ;)
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Is their a page that list the proper command lines to run when I am trying to figure out why X service is bugged?

I like the command line just because I gives me the details the UI doesn't.

What does the command line show that the lig file viewer in the UI doesn't?

https://docs.opnsense.org/manual/logging_services.html
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

The NTP service wasn't logging anything at all. Typically, when you run a command from the command line, you receive an immediate response—like whether the service started, was disabled, or if there was a bad configuration. However, the UI didn't provide any feedback, and the service just wouldn't start

In the logfile viewer there is a selector in the top right corner picking which log level to display. Everything in the log that can be viewed from the command line is accessible in the UI.

And that error message you got from "service ntpd start" was downright misleading because OPNsense does not use the FreeBSD rcng framework.

But you do you. I just tried to explain how things are supposed to work.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

The NTP service was working fine with a green icon, but then it suddenly showed a large red icon in the Web UI indicating that it had stopped. I checked the logs within the UI but didn't find any entries, even after clicking through all the options. I attempted to restart the service from the UI, but the screen flashed briefly and it still wouldn't start. After rebooting OPNsense, the NTP service remained red and inactive.

I then searched online for the command to restart or reset the OPNsense NTP service. While I didn't find a specific command in the documentation, I did come across a generic Linux command for restarting services. That's when I turned to the forum for guidance on the correct command or potential fixes. I also regularly clear logs, so I'm unsure exactly when the NTP service stopped functioning.

I understand I'm still learning OPNsense; I have some Linux experience, but I'm not an expert.

Regarding the misleading error message from "service ntpd start," I'd appreciate if, instead of insults, you could share the proper syntax to restart the NTP service from the command line. When using the shell, I usually get immediate feedback on what went wrong or what's missing, and that's all I was seeking.

In the end, I disabled NTP and switched to Chrony, which I got up and running within minutes, and it's now reporting corrections successfully

Quote from: Yewtink on November 03, 2024, 12:23:12 AM
The NTP service was working fine with a green icon, but then it suddenly showed a large red icon in the Web UI indicating that it had stopped. I checked the logs within the UI but didn't find any entries, even after clicking through all the options. I attempted to restart the service from the UI, but the screen flashed briefly and it still wouldn't start. After rebooting OPNsense, the NTP service remained red and inactive.

That's bad and should not be the case of course.

Quote from: Yewtink on November 03, 2024, 12:23:12 AM
I then searched online for the command to restart or reset the OPNsense NTP service. While I didn't find a specific command in the documentation, I did come across a generic Linux command for restarting services. That's when I turned to the forum for guidance on the correct command or potential fixes. I also regularly clear logs, so I'm unsure exactly when the NTP service stopped functioning.

And this is a bit of a problem because OPNsense is an appliance built on FreeBSD - but not even stock FreeBSD but OPNsense.

Which leads to:

- any search engine result leading to Stackoverflow and friends referring to Linux is most probably plain wrong
- any search engine result leading to e.g. the FreeBSD forum might be helpful but then again might not, because "OPNsense, not FreeBSD"


Quote from: Yewtink on November 03, 2024, 12:23:12 AM
Regarding the misleading error message from "service ntpd start," I'd appreciate if, instead of insults, you could share the proper syntax to restart the NTP service from the command line. When using the shell, I usually get immediate feedback on what went wrong or what's missing, and that's all I was seeking.

Seriously no insult intended. Being a network engineer by profession and a Unix nerd for decades I sometimes fail to find the correct tone/words.

I looked for a way to restart ntpd via configctl and I did not find one. I never used anything but the UI for that area of the configuration and ntpd has always been working fine for me.

If chrony works for you - great.

Now, did you get that SSH access problem solved? It *should* be dead easy to enable password authentication in the UI and then just log in.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

QuoteNow, did you get that SSH access problem solved? It *should* be dead easy to enable password authentication in the UI and then just log in

Yea once I gave up on trying to use Putty.
The windows ssh works to good.  Kinda has me afraid anyone can ssh in.  Been watching way to many Network Chuck and Linus tech tips.

If I am not working on my computer for work I am on the network looking how to improve my security.



I am so glad that there is another converted away from putty. Great piece of software that has been the mainstay for so very long for Window users, but truly it is time to use Terminal+WSL when possible. Good for you.

Windows Terminal has been a nice change for me... But I still install Teraterm as well.

Not to get too far off topic, but is there a way to get a serial connection from Terminal? Minicom for Windows would also be a good choice, if it existed, has become my default for Linux devices that I need to use with a serial console.