mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 03:15:07 -05:00
cmdmon: add reload sources command
Add the command which reloads the files from the directories specified by the sourcedirs directive.
This commit is contained in:
13
cmdmon.c
13
cmdmon.c
@@ -139,6 +139,7 @@ static const char permissions[] = {
|
||||
PERMIT_AUTH, /* AUTH_DATA */
|
||||
PERMIT_AUTH, /* CLIENT_ACCESSES_BY_INDEX3 */
|
||||
PERMIT_AUTH, /* SELECT_DATA */
|
||||
PERMIT_AUTH, /* RELOAD_SOURCES */
|
||||
};
|
||||
|
||||
/* ================================================== */
|
||||
@@ -1232,6 +1233,14 @@ handle_ntp_source_name(CMD_Request *rx_message, CMD_Reply *tx_message)
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
static void
|
||||
handle_reload_sources(CMD_Request *rx_message, CMD_Reply *tx_message)
|
||||
{
|
||||
CNF_ReloadSources();
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
static void
|
||||
handle_reset_sources(CMD_Request *rx_message, CMD_Reply *tx_message)
|
||||
{
|
||||
@@ -1710,6 +1719,10 @@ read_from_cmd_socket(int sock_fd, int event, void *anything)
|
||||
handle_select_data(&rx_message, &tx_message);
|
||||
break;
|
||||
|
||||
case REQ_RELOAD_SOURCES:
|
||||
handle_reload_sources(&rx_message, &tx_message);
|
||||
break;
|
||||
|
||||
default:
|
||||
DEBUG_LOG("Unhandled command %d", rx_command);
|
||||
tx_message.status = htons(STT_FAILED);
|
||||
|
||||
Reference in New Issue
Block a user