HOME BLOG ARCHIVE TAGS

Watch out if you have to spawn ntpd

October 20, 2015

For whatever reason, if you need to spawn ntpd from a program/script, beware of your signal mask. If SIGALRM is blocked before fork/exec, the daemon may start, read its configuration, and do nothing besides talking to ntpq/ntpc.

As server dispatching is driven by FD IO and timing, without SIGALRM, server/peer stuff is just not processed (see ntpd.c, version 4.2.6p5).