mirror of
https://github.com/systemd/systemd.git
synced 2024-12-22 17:35:35 +03:00
socket-proxyd: support Type=notify
update examples in the man page too
This commit is contained in:
parent
fd4ba8a7db
commit
37fe75a2e6
@ -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]]></programlisting>
|
||||
@ -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]]></programlisting>
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user