From 37fe75a2e64690055e8cd45ad7420419874d2ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Wed, 1 Feb 2023 17:13:45 +0100 Subject: [PATCH] socket-proxyd: support Type=notify update examples in the man page too --- man/systemd-socket-proxyd.xml | 2 ++ src/socket-proxy/socket-proxyd.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/man/systemd-socket-proxyd.xml b/man/systemd-socket-proxyd.xml index e512a4334e9..bf51c0558c4 100644 --- a/man/systemd-socket-proxyd.xml +++ b/man/systemd-socket-proxyd.xml @@ -104,6 +104,7 @@ Requires=proxy-to-nginx.socket After=proxy-to-nginx.socket [Service] +Type=notify ExecStart=/usr/lib/systemd/systemd-socket-proxyd /run/nginx/socket PrivateTmp=yes PrivateNetwork=yes]]> @@ -151,6 +152,7 @@ After=proxy-to-nginx.socket JoinsNamespaceOf=nginx.service [Service] +Type=notify ExecStart=/usr/lib/systemd/systemd-socket-proxyd 127.0.0.1:8080 PrivateTmp=yes PrivateNetwork=yes]]> diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c index 821049e6675..f336fbd55ed 100644 --- a/src/socket-proxy/socket-proxyd.c +++ b/src/socket-proxy/socket-proxyd.c @@ -15,6 +15,7 @@ #include "alloc-util.h" #include "build.h" +#include "daemon-util.h" #include "errno-util.h" #include "fd-util.h" #include "log.h" @@ -672,6 +673,7 @@ static int parse_argv(int argc, char *argv[]) { static int run(int argc, char *argv[]) { _cleanup_(context_clear) Context context = {}; + _unused_ _cleanup_(notify_on_cleanup) const char *notify_stop = NULL; int r, n, fd; log_parse_environment(); @@ -709,6 +711,7 @@ static int run(int argc, char *argv[]) { return r; } + notify_stop = notify_start(NOTIFY_READY, NOTIFY_STOPPING); r = sd_event_loop(context.event); if (r < 0) return log_error_errno(r, "Failed to run event loop: %m");