Manjaro Cinnamon: Network time not working.

System: Manjaro Cinnamon, testing branch
Computer: Dell XPS13 9343
I tried to turn on network time in time setting to sync time automatically, but after I switch on network time option, nothing happens.
I close the setting and re-opened it, the option is back to off state.

I use:

timedatectl status

It turns out NTP service is not running.

So I use:

timedatectl set-ntp true

and checked again, now the NTP service is running.
Go into time setting, turn on network time, the time synced successfully, but just once. I close setting and re-open, the option go back to off, and it's not syncing again.

Have you tried the systemd-timesyncd service?

sudo systemctl enable --now systemd-timesyncd
1 Like

I tried that command, now the time is syncing.
But, the network time option in Date&time menu is totally useless now. Regardless if I turn the network time on or off, it will force time syncing thus prohibiting manual time setting.

It is set in Manjaro Settings Manager Time and Date and it is this that overrides the cinnamon one.

1 Like

wow, thank you!

It's not that MSM "overrides" the configuration in Cinnamon Settings. It is just that for some reasons I do not know, it simply fails to enable or disable NTP. See these errors I get if I launch Cinnamon Settings from the terminal.

[awesome@i56400 ~]$ cinnamon-settings
libgoa-backend-1.0.so.1: cannot open shared object file: No such file or directory
Failed to load module: /usr/lib/cinnamon-control-center-1/panels/libonline-accounts.so
True
Using pam module (python3-pampy)
Loading Calendar module

(cinnamon-settings.py:2988): datetime-cc-panel-WARNING **: 16:49:13.804: Failed to get using ntp: GDBus.Error:org.cinnamon.SettingsDaemon.DateTimeMechanism.GeneralError: Error enabling NTP: OS variant not supported

(cinnamon-settings.py:2988): datetime-cc-panel-WARNING **: 16:49:25.714: Could not set system to use NTP: GDBus.Error:org.cinnamon.SettingsDaemon.DateTimeMechanism.GeneralError: Error enabling NTP: OS variant not supported

(cinnamon-settings.py:2988): datetime-cc-panel-WARNING **: 16:49:29.468: Could not set system to use NTP: GDBus.Error:org.cinnamon.SettingsDaemon.DateTimeMechanism.GeneralError: Error enabling NTP: OS variant not supported

OK, I understand now. It is because it will only work on supported OSes, and for now, it only works on Fedora (perhaps any distro in the RedHat family), in distros in the Debian family or distros in the SUSE family. And if you happen to run anything else, it will simply not work and you will get the "OS variant not supported" error.

See is part of the code for Cinnamon Settings Daemon.

csd_datetime_mechanism_get_using_ntp  (CsdDatetimeMechanism    *mechanism,
                                       DBusGMethodInvocation   *context)
{
        GError *error = NULL;
        gboolean ret;

        if (g_file_test ("/etc/redhat-release", G_FILE_TEST_EXISTS)) /* Fedora */
                ret = _get_using_ntp_fedora (context);
        else if (g_file_test ("/usr/sbin/update-rc.d", G_FILE_TEST_EXISTS)) /* Debian */
                ret = _get_using_ntp_debian (context);
	else if (g_file_test ("/etc/SuSE-release", G_FILE_TEST_EXISTS)) /* SUSE variant */
                ret = _get_using_ntp_suse (context);
        else {
                error = g_error_new (CSD_DATETIME_MECHANISM_ERROR,
                                     CSD_DATETIME_MECHANISM_ERROR_GENERAL,
                                     "Error enabling NTP: OS variant not supported");
                dbus_g_method_return_error (context, error);
                g_error_free (error);
                return FALSE;
        }

        return ret;
}

Source: https://github.com/linuxmint/cinnamon-settings-daemon/blob/master/plugins/datetime/csd-datetime-mechanism.c

This is not very well implemented: the option should simply not be shown on unsupported OSes.

1 Like