> On 09/26/2014 06:31 PM, lee wrote:
>> is there an easy way to force chronyd to get into/remain in its online
>> mode rather than going into offline mode?

I had the same problem. My workaround was to run the following python
script from /etc/cron.hourly/

#! /usr/bin/env python

import os
import time

def main():
    chronyd_running = False
    for line in os.popen("ps -ef", "r").readlines():
        if "/usr/sbin/chronyd" in line:
            chronyd_running = True
    sources_ok = False
    if chronyd_running:
        for line in os.popen("chronyc sources", "r").readlines():
            if line.startswith("^") and "10y" not in line:
                sources_ok = True
    if not sources_ok:
        os.system("/etc/init.d/chrony stop")
        time.sleep(3)
        os.system("/etc/init.d/chrony start")

if __name__ == "__main__": main()

--
Dieter Deyke
mailto:dieter.de...@gmail.com


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/87zjdjmx2o....@deyke2.deyke.net

Reply via email to