Nitrux / nitrux-bug-tracker

Bug Repository for Nitrux
https://nxos.org
5 stars 2 forks source link

Add service file for NTP service #168

Closed UriHerrera closed 6 months ago

UriHerrera commented 6 months ago

Issue Description

Describe the bug

When booting the distribution, the date and time have to be manually adjusted; otherwise, various problems can occur, primarily when the user connects to the Internet.

Steps to reproduce the bug

  1. Boot Nitrux
  2. Use software like wget or Firefox
  3. SSL certificate errors will be displayed

Expected behavior

No certificate errors are displayed.

Additional context

Debian has replaced ntpupdate with the NTPsec version of NTP; however, as usual, they don't provide a service script, only a Systemd service unit. So, we need to add a service script for OpenRC to start an NTP daemon and adjust the date and time automatically.

UriHerrera commented 6 months ago

Service file added to OpenRC in https://github.com/Nitrux/openrc-config/commit/722098cec18e0087614c5d31ba5f7892141ee976 and working when booting the Live session.

Captura de pantalla de 2024-05-07 15-59-31

However, as noted in #66, Plasma will continue to display an error because it relies on timedated, a component of systemd. Plasma doesn't use /usr/bin/ntpupdate as a fallback because it is deprecated; now, it uses /sbin/ntpdate.

Captura de pantalla de 2024-05-07 15-57-14

Nonetheless, checking "Set date and time automatically" and then searching for the desired timezone will automatically adjust the time despite the error message, which was the previously lost functionality.

UriHerrera commented 5 months ago

I have updated the service script to run ntpd directly instead of using the wrapper that the Systemd unit file executes by default in Debian.

It does seem to work better since the time in Plasma was automatically changed to my timezone once the graphical session started, whereas before, it defaulted to UTC.


I have further updated the service script. The service script will display the command output to the boot log.

Captura de pantalla de 2024-05-20 19-23-12

To select a timezone in the Live session, right-click the clock and select Adjust date and time. Then click on the Time Zone tab, search for the desired timezone, and click Apply. The Live session will default to UTC because that is the default timezone.

Since the user is expected to be connected to the Internet during installation, Calamares will automatically select the appropriate timezone. The correct timezone will be used upon booting the installed system.