mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:55:07 -05:00
conf: don't load sourcedir during initstepslew and RTC init
If the reload sources command was received in the chronyd start-up
sequence with initstepslew and/or RTC init (-s option), the sources
loaded from sourcedirs caused a crash due to failed assertion after
adding sources specified in the config.
Ignore the reload sources command until chronyd enters the normal
operation mode.
Fixes: 519796de37 ("conf: add sourcedirs directive")
This commit is contained in:
26
test/simulation/203-initreload
Executable file
26
test/simulation/203-initreload
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
. ./test.common
|
||||
|
||||
check_config_h 'FEAT_CMDMON 1' || test_skip
|
||||
|
||||
# Test fix "conf: don't load sourcedir during initstepslew and RTC init"
|
||||
|
||||
test_start "reload during initstepslew"
|
||||
|
||||
client_conf="initstepslew 5 192.168.123.1
|
||||
sourcedir tmp"
|
||||
client_server_conf="#"
|
||||
chronyc_conf="reload sources"
|
||||
chronyc_start=4
|
||||
|
||||
echo 'server 192.168.123.1' > tmp/sources.sources
|
||||
|
||||
run_test || test_fail
|
||||
check_chronyd_exit || test_fail
|
||||
check_source_selection || test_fail
|
||||
check_sync || test_fail
|
||||
|
||||
check_log_messages "Added source 192\.168\.123\.1" 1 1 || test_fail
|
||||
|
||||
test_pass
|
||||
Reference in New Issue
Block a user