summaryrefslogtreecommitdiff
path: root/src/shim/vyshim.c
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-04-29 09:47:52 +0200
committerGitHub <noreply@github.com>2024-04-29 09:47:52 +0200
commitc1507d684cc9e0aaabf45bf9d5ef39d741b96c81 (patch)
tree9e88758a2a4f28e86bd76d905dc3bd41590e223d /src/shim/vyshim.c
parentf980f8b8010a9681c387d47c476254c89b0c4a25 (diff)
parent2479ed1a6a71c10d5b399e4f176494f761b84fab (diff)
downloadvyos-1x-c1507d684cc9e0aaabf45bf9d5ef39d741b96c81.tar.gz
vyos-1x-c1507d684cc9e0aaabf45bf9d5ef39d741b96c81.zip
Merge pull request #3373 from jestabro/sagitta-configdep-redundancy
T5660: Remove redundant calls to config dependency scripts
Diffstat (limited to 'src/shim/vyshim.c')
-rw-r--r--src/shim/vyshim.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/shim/vyshim.c b/src/shim/vyshim.c
index cae8b6152..41723e7a4 100644
--- a/src/shim/vyshim.c
+++ b/src/shim/vyshim.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020 VyOS maintainers and contributors
+ * Copyright (C) 2020-2024 VyOS maintainers and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 or later as
@@ -49,6 +49,7 @@
#define GET_SESSION "cli-shell-api --show-working-only --show-show-defaults --show-ignore-edit showConfig"
#define COMMIT_MARKER "/var/tmp/initial_in_commit"
+#define QUEUE_MARKER "/var/tmp/last_in_queue"
enum {
SUCCESS = 1 << 0,
@@ -77,6 +78,7 @@ int main(int argc, char* argv[])
int ex_index;
int init_timeout = 0;
+ int last = 0;
debug_print("Connecting to vyos-configd ...\n");
zmq_connect(requester, SOCKET_PATH);
@@ -101,10 +103,16 @@ int main(int argc, char* argv[])
return ret;
}
+ if (access(QUEUE_MARKER, F_OK) != -1) {
+ last = 1;
+ remove(QUEUE_MARKER);
+ }
+
char error_code[1];
debug_print("Sending node data ...\n");
- char *string_node_data_msg = mkjson(MKJSON_OBJ, 2,
+ char *string_node_data_msg = mkjson(MKJSON_OBJ, 3,
MKJSON_STRING, "type", "node",
+ MKJSON_BOOL, "last", last,
MKJSON_STRING, "data", &string_node_data[0]);
zmq_send(requester, string_node_data_msg, strlen(string_node_data_msg), 0);