summaryrefslogtreecommitdiffstats
path: root/platform.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2024-04-03 05:40:32 +0200
committerDamien Miller <djm@mindrot.org>2024-04-03 05:40:32 +0200
commit08f579231cd38a1c657aaa6ddeb8ab57a1fd4f5c (patch)
treed36e7486497b6a4cec4509c82cd3faad584b7508 /platform.c
parentPort changes from selfhosted to upstream tests. (diff)
downloadopenssh-08f579231cd38a1c657aaa6ddeb8ab57a1fd4f5c.tar.xz
openssh-08f579231cd38a1c657aaa6ddeb8ab57a1fd4f5c.zip
notify systemd on listen and reload
Standalone implementation that does not depend on libsystemd. With assistance from Luca Boccassi, and feedback/testing from Colin Watson. bz2641
Diffstat (limited to 'platform.c')
-rw-r--r--platform.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/platform.c b/platform.c
index 4fe8744ee..9cf818153 100644
--- a/platform.c
+++ b/platform.c
@@ -45,6 +45,14 @@ platform_pre_listen(void)
}
void
+platform_post_listen(void)
+{
+#ifdef SYSTEMD_NOTIFY
+ ssh_systemd_notify_ready();
+#endif
+}
+
+void
platform_pre_fork(void)
{
#ifdef USE_SOLARIS_PROCESS_CONTRACTS
@@ -55,6 +63,9 @@ platform_pre_fork(void)
void
platform_pre_restart(void)
{
+#ifdef SYSTEMD_NOTIFY
+ ssh_systemd_notify_reload();
+#endif
#ifdef LINUX_OOM_ADJUST
oom_adjust_restore();
#endif