Commit graph

50 commits

Author SHA1 Message Date
Miroslav Lichvar
c6e064200d rtc: move preinit call to RTC_Initialise() 2014-08-19 10:46:32 +02:00
Miroslav Lichvar
cb74f3e7ad Update copyright years 2014-06-05 18:06:56 +02:00
Miroslav Lichvar
ead3ca14a0 main: delay switching to normal mode after initstepslew
This prevents polling interval shorter than the burst interval
if some configured servers were used also for initstepslew.
2014-06-03 18:10:27 +02:00
Miroslav Lichvar
e176587e96 main: initialize reference mode properly 2014-05-23 12:00:16 +02:00
Miroslav Lichvar
fe35de6931 main: switch errors in initialization to fatal errors 2014-04-30 18:47:53 +02:00
Miroslav Lichvar
6ee357d230 ntp: use async name resolving for NTP sources
Use the new asynchronous call to resolve addresses of NTP servers
configured by the server/peer directives. Introduce a callback to be
notified when the first resolving attempt ends to correctly finish
chronyd initialization (dumpfile reload and reference mode end).
2014-04-29 12:43:03 +02:00
Miroslav Lichvar
779e40ed66 ntp: delay initial transmission until first resolving ends
This will be needed to prevent loading of dump files after sources have
already accumulated samples and possibly reference was already updated
when async resolving of sources is implemented.
2014-04-29 12:42:45 +02:00
Miroslav Lichvar
46951b8598 main: setup access restrictions before initstepslew 2014-04-10 18:22:09 +02:00
Miroslav Lichvar
7fa22d4c25 sources: ignore inactive sources in special mode ending 2014-04-10 17:50:24 +02:00
Miroslav Lichvar
ff31702f74 configure: add option to set default user
The default user is root by default, which disables root dropping by
default. The user directive or the -u option can still be used to set
the user.
2014-04-09 16:30:06 +02:00
Miroslav Lichvar
3edd3fe5a4 main: support configuration commands on command line
If there are extra arguments on the chronyd command line, they will be
parsed as lines in a configuration file and the normal configuration file
will be ignored.
2014-04-09 15:16:35 +02:00
Miroslav Lichvar
70feea48f8 main: add -q/-Q options to set clock/print offset once and exit 2014-04-09 12:15:07 +02:00
Miroslav Lichvar
788e7fcd89 logging: set debug level instead of on/off
Prefix messages written to terminal with filename, line and function
name only with debug level 2 and higher.
2014-04-09 12:09:23 +02:00
Miroslav Lichvar
93b66ac141 reference: exit with non-zero code when maxchange limit is reached
Use ending of normal mode to signal a failure.
2014-04-09 09:59:58 +02:00
Miroslav Lichvar
7fda9c6723 ntp: drop initstepslew NTP implementation
The initstepslew code has its own minimal NTP implementation. Drop the
code, add a new initstepslew mode to the reference updating code and
use regular NTP sources with iburst flag for initstepslew addresses
instead. When an update is made or a source is found unreachable, log a
message, remove the initstepslew sources and switch to normal mode.

This reduces code duplication and makes initstepslew use features
implemented only in the main code like source combining or SO_TIMESTAMP
support.
2014-04-09 09:54:40 +02:00
Miroslav Lichvar
4bbc5520b8 Add support for debug messages
Add new DEBUG_LOG macro for debug messages. The messages are enabled
when compiled with --enable-debug and they are printed when the -d
option is used twice.
2013-11-27 14:35:38 +01:00
Miroslav Lichvar
1c901b82dc Add option to generate command key on start
With generatecommandkey directive, if no command key is found in the key
file on start, one will be generated automatically from /dev/urandom.
2013-05-21 14:02:31 +02:00
Miroslav Lichvar
72d0b3c913 Create sockets only in selected family with -4 or -6 option 2013-05-20 15:37:25 +02:00
Miroslav Lichvar
0f8def4ca4 Refactor command parsing
- normalize command line before parsing
- compare whole words
- check for missing/extra arguments in config parsing
- use strdup for string allocation
- share code for reporting syntax errors
- avoid using function pointers
- cleanup the code a bit
2013-05-15 11:27:38 +02:00
Miroslav Lichvar
edda0c60b3 Add user directive for dropping root privileges
This is equivalent to the -u option.
2013-04-26 17:38:40 +02:00
Miroslav Lichvar
f2eb6b165a Add option to ignore initstepslew and makestep directives
When chronyd is started with -R, the initstepslew directive and the
makestep directive with a positive limit will be ignored. This is useful
when restarting chronyd to avoid unnecessary clock adjustments. It can
be used with -r.
2013-04-26 17:38:37 +02:00
Miroslav Lichvar
0c738d84af Update copyright years 2012-02-28 13:11:56 +01:00
Miroslav Lichvar
2a305d8e16 Fix compiler warnings 2012-02-27 16:08:21 +01:00
Miroslav Lichvar
1d2a0856b4 Wait in foreground process until daemon is fully initialized
Exit when all sockets are ready and initstepslew command and rtc step
are completed. Also, in case of a fatal error, print the error message
and exit with a non-zero status.
2011-08-26 18:31:26 +02:00
Miroslav Lichvar
919b5b5a7d Change working directory to / 2011-08-25 18:49:34 +02:00
Miroslav Lichvar
1e35b26826 Read config after opening syslog 2011-08-25 14:46:16 +02:00
Miroslav Lichvar
103a520aa6 Create logdir before making first tracking write 2011-06-15 15:35:14 +02:00
Miroslav Lichvar
4ba3dd66ad Set version string in config.h 2011-06-09 14:32:22 +02:00
Miroslav Lichvar
da2c8d9076 Use config.h 2011-05-24 18:07:06 +02:00
Miroslav Lichvar
cb9055072d Make starting log even in debug mode 2011-02-14 18:21:38 +01:00
Miroslav Lichvar
0fc9b555f1 Don't log in signal handler 2011-02-14 18:19:58 +01:00
Miroslav Lichvar
e8c5d15690 Remove CVS headers 2011-01-28 12:56:09 +01:00
Miroslav Lichvar
3a222336d7 Fix reloading sample histories with refclocks 2010-08-25 18:10:35 +02:00
Miroslav Lichvar
fe4b661fe7 Add -n option to allow using syslog without forking 2010-08-19 17:21:11 +02:00
Miroslav Lichvar
9775f3a030 Read chrony.conf before checking/writing pid file
This fixes the pidfile directive.
2010-05-20 16:10:51 +02:00
Miroslav Lichvar
c386d11765 Add temperature compensation
A new tempcomp directive can be used to specify a file for reading
current temperature, update interval and compensation coefficients. The
clock frequency corrections are applied in local module and are invisible
in upper layers. The measurements and corrections can be logged to
tempcomp.log file.
2010-04-27 14:35:11 +02:00
Miroslav Lichvar
e78e65ef22 Refactor file logging 2010-04-13 15:16:41 +02:00
Miroslav Lichvar
dbb550e6db Don't start chronyd with unrecognized command line options 2010-01-27 13:53:49 +01:00
Miroslav Lichvar
e3234465e2 Clean up system options code
Abort with error message when trying to use unsupported/disabled
system specific option.
2009-11-25 14:37:41 +01:00
Miroslav Lichvar
8e23110aec Update COPYING and FSF address 2009-10-28 17:53:33 +01:00
Miroslav Lichvar
f7e08d0c30 Update copyrights 2009-10-28 17:53:10 +01:00
Miroslav Lichvar
fbd20c429e Add -4 and -6 options to set address family when resolving names 2009-10-13 16:15:49 +02:00
Miroslav Lichvar
ac30bb06ef Add support for reference clocks 2009-05-05 23:05:59 +02:00
Miroslav Lichvar
9416a24f03 Don't finalise from signal handler 2009-04-29 13:53:02 +02:00
Miroslav Lichvar
96759116e2 Fix memlockall patch 2009-02-11 18:01:23 +01:00
John Hasler
35e662d810 Add mlockall and SCHED_FIFO support
The attached patch adds support for mlockall() as well as the SCHED_FIFO
real-time scheduler. It should result in reduced (and more consistent)
latency. Usage is documented in all the documents.
2009-02-10 18:02:28 +01:00
Miroslav Lichvar
be42b4eeea Linux capabilities support
Attached is a patch adding a linux capabilities support to chronyd. It
adds -u option which can be used to specify the user which chronyd
should switch to.
2008-11-05 23:50:48 +00:00
Richard P. Curnow
1e7e7d3231 Remove volatile keyword from function declarations
This silences a lot of gcc-4 compile warnings
2006-04-15 00:10:21 +01:00
richard
6672f045c2 Update copyright to 2003 2006-01-19 21:37:13 +00:00
Richard P. Curnow
8884034104 Equivalent to V1.19.99.1
This is a verbatim copy of the files at that stage of the repository that was
built from the CVS import.  It allows future development to see a bit of recent
history, but without carrying around the baggage going back to 1997.  If that
is really required, git grafts can be used.
2006-01-19 21:34:28 +00:00