fjl / os-timesync

Check whether NTP time sync is enabled in OS settings
2 stars 5 forks source link

fixed NTP recognition on some linux distros #4

Closed luclu closed 8 years ago

luclu commented 8 years ago

Tested on Archinux and Ubuntu.

luclu commented 8 years ago

@fjl what can I change to improve this situation?

fjl commented 8 years ago

The function shouldn't check for 'NTP sychronized'. The purpose of this thing is checking whether the user has somehow enabled time sync, and not whether the time sync is actually working. We can do two things:

In checkLinux, we can check for ntpd always (haven't tested this)

function checkLinux(cb) {
    checkSystemd(function (err, enabled) {
        if (enabled && !err) {
            return cb(null, true);
        }
        checkNtpd(cb);
    });
}

On the mist side, we can make the error less visible because it isn't reliable. Users should still be able to launch the application even if enabled is false. It would be better to present the notification in another way. The dialog box is super ugly anyway.