coreos / bugs

Issue tracker for CoreOS Container Linux
https://coreos.com/os/eol/
146 stars 30 forks source link

ntpd wedges itself on startup #304

Closed crawford closed 9 years ago

crawford commented 9 years ago

As @marineam discovered, this bug looks suspicious.

crawford commented 9 years ago

I'm about to trigger the wedge with this script:

#!/bin/bash

while $(ntpq -p | grep jitter > /dev/null); do
    sudo systemctl stop ntpd
    sleep 1
    sudo systemctl start ntpd
    sleep 1
    echo -n .
done

It takes about 4 restarts on my qemu instances.

crawford commented 9 years ago

The current workaround is to run the daemon as root, avoiding the capabilities problem on the worker thread.

$ cat /etc/systemd/system/ntpd.service.d/debug.conf 
[Service]
ExecStart=
ExecStart=/usr/sbin/ntpd -g -n -f /var/lib/ntp/ntp.drift
ianblenke commented 9 years ago

Why is there an empty ExecStart= line in the example in this issue thread above? Does this actually serve some deep mystical purpose within systemd, or is it (most likely) simply a typo?

This issue was referenced from Deis issue 3300 for this reason. Rather than let sleeping dogs lie, it seemed like a good idea to ask.

crawford commented 9 years ago

From http://www.freedesktop.org/software/systemd/man/systemd.unit.html#Description

"Various settings are allowed to be specified more than once, in which case the interpretation depends on the setting. Often, multiple settings form a list, and setting to an empty value "resets", which means that previous assignments are ignored."

If I left off the empty assignment, ntpd.service would have multiple ExecStart lines.