summaryrefslogtreecommitdiffstats
path: root/lib/systemd.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-09 13:16:35 +0000
commite2bbf175a2184bd76f6c54ccf8456babeb1a46fc (patch)
treef0b76550d6e6f500ada964a3a4ee933a45e5a6f1 /lib/systemd.h
parentInitial commit. (diff)
downloadfrr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.tar.xz
frr-e2bbf175a2184bd76f6c54ccf8456babeb1a46fc.zip
Adding upstream version 9.1.upstream/9.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/systemd.h')
-rw-r--r--lib/systemd.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/systemd.h b/lib/systemd.h
new file mode 100644
index 0000000..ba2461b
--- /dev/null
+++ b/lib/systemd.h
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* lib/systemd Code
+ * Copyright (C) 2016 Cumulus Networks, Inc.
+ * Donald Sharp
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* fd 1/2 connected to journald? */
+extern bool sd_stdout_is_journal;
+extern bool sd_stderr_is_journal;
+
+/*
+ * Wrapper functions to systemd calls.
+ *
+ * Design point is that if systemd is not being used on this system
+ * then these functions becomes a no-op.
+ */
+void systemd_send_stopping(void);
+
+/*
+ * master - The struct event_loop * to use to schedule ourself
+ * the_process - Should we send watchdog if we are not the requested
+ * process?
+ */
+void systemd_send_started(struct event_loop *master);
+
+/*
+ * status - A status string to send to systemd
+ */
+void systemd_send_status(const char *status);
+
+/*
+ * grab startup state from env vars
+ */
+void systemd_init_env(void);
+
+#ifdef __cplusplus
+}
+#endif