search for: listen_pid

Displaying 20 results from an estimated 64 matches for "listen_pid".

2023 Jan 28
1
[PATCH libnbd] generator: Pass LISTEN_FDNAMES=nbd with systemd socket activation
...socket-activation.c index 9a83834915..22f06d4fd3 100644 --- a/generator/states-connect-socket-activation.c +++ b/generator/states-connect-socket-activation.c @@ -34,16 +34,18 @@ /* This is baked into the systemd socket activation API. */ #define FIRST_SOCKET_ACTIVATION_FD 3 -/* == strlen ("LISTEN_PID=") | strlen ("LISTEN_FDS=") */ -#define PREFIX_LENGTH 11 - extern char **environ; /* Prepare environment for calling execvp when doing systemd socket * activation. Takes the current environment and copies it. Removes - * any existing LISTEN_PID or LISTEN_FDS and replaces them...
2023 Jan 30
2
[PATCH libnbd v2 4/4] generator/states-connect-socket-activation.c: Set LISTEN_FDNAMES
...<stdbool.h> #include <string.h> #include <unistd.h> #include <errno.h> @@ -38,20 +39,27 @@ extern char **environ; /* Prepare environment for calling execvp when doing systemd socket * activation. Takes the current environment and copies it. Removes - * any existing LISTEN_PID or LISTEN_FDS and replaces them with new - * variables. env[0] is "LISTEN_PID=..." which is filled in by - * CONNECT_SA.START, and env[1] is "LISTEN_FDS=1". + * any existing LISTEN_PID, LISTEN_FDS or LISTEN_FDNAAMES, and + * replaces them with new variables. + * + * env[0] is &...
2023 Jan 31
1
[PATCH libnbd] generator: Pass LISTEN_FDNAMES=nbd with systemd socket activation
...915..22f06d4fd3 100644 > --- a/generator/states-connect-socket-activation.c > +++ b/generator/states-connect-socket-activation.c > @@ -34,16 +34,18 @@ > /* This is baked into the systemd socket activation API. */ > #define FIRST_SOCKET_ACTIVATION_FD 3 > > -/* == strlen ("LISTEN_PID=") | strlen ("LISTEN_FDS=") */ > -#define PREFIX_LENGTH 11 > - > extern char **environ; > > /* Prepare environment for calling execvp when doing systemd socket > * activation. Takes the current environment and copies it. Removes > - * any existing LISTEN_PI...
2023 Jan 30
4
[PATCH libnbd v2 0/4] Pass LISTEN_FDNAMES with systemd socket activation
This is an alternative approach to https://listman.redhat.com/archives/libguestfs/2023-January/030535.html After discussing this with Dan Berrange we came to the conclusion that you really might want to set LISTEN_FDNAMES to arbitrary short strings (or not set it). Especially when talking to qemu-storage-daemon which would allow you to use these names on the command line. Rich.
2019 Sep 26
2
Re: [PATCH libnbd 2/2] api: Implement local command with systemd socket activation.
...+295,110 @@ disable_nagle (int sock) > SET_NEXT_STATE (%^MAGIC.START); > return 0; > > + CONNECT_SA.START: > + /* This is in some ways similar to nbd_aio_connect_command above, > + * but we must pass a listening socket to the child process and > + * we must set LISTEN_PID and LISTEN_FDS environment variables. > + */ > + size_t len; > + int s; > + struct sockaddr_un addr; > + pid_t pid; > + int flags; > + char listen_pid[16]; > + > + assert (!h->sock); > + assert (h->argv); > + assert (h->argv[0]); > + > + /...
2023 Jan 31
1
[PATCH libnbd] generator: Pass LISTEN_FDNAMES=nbd with systemd socket activation
...- a/generator/states-connect-socket-activation.c > > +++ b/generator/states-connect-socket-activation.c > > @@ -34,16 +34,18 @@ > > /* This is baked into the systemd socket activation API. */ > > #define FIRST_SOCKET_ACTIVATION_FD 3 > > > > -/* == strlen ("LISTEN_PID=") | strlen ("LISTEN_FDS=") */ > > -#define PREFIX_LENGTH 11 > > - > > extern char **environ; > > > > /* Prepare environment for calling execvp when doing systemd socket > > * activation. Takes the current environment and copies it. Removes &...
2023 Mar 24
4
[libnbd PATCH v3 19/19] socket activation: set LISTEN_FDNAMES
...130225521.1771496-5-rjones at redhat.com>.] >> >> Signed-off-by: Laszlo Ersek <lersek at redhat.com> >> Reviewed-by: Richard W.M. Jones <rjones at redhat.com> >> --- >> > >> @@ -245,6 +245,9 @@ CONNECT_SA.START: >> "LISTEN_PID=", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", &pid_ofs); >> SACT_VAR_PUSH (sact_var, &num_vars, >> "LISTEN_FDS=", "1", NULL); >> + if (h->sact_name != NULL) >> + SACT_VAR_PUSH (sact_var, &num_vars, >>...
2023 Mar 24
2
[libnbd PATCH v3 19/19] socket activation: set LISTEN_FDNAMES
...stman.redhat.com/archives/libguestfs/2023-March/031178.html - although I may have to retry since I'm not a usual subscriber of systemd-devel] On Fri, Mar 24, 2023 at 11:32:26AM +0100, Laszlo Ersek wrote: > >> @@ -245,6 +245,9 @@ CONNECT_SA.START: > >> "LISTEN_PID=", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", &pid_ofs); > >> SACT_VAR_PUSH (sact_var, &num_vars, > >> "LISTEN_FDS=", "1", NULL); > >> + if (h->sact_name != NULL) > >> + SACT_VAR_PUSH (sact_var, &amp...
2019 Oct 01
2
Re: [PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...ivation.c > +/* This is baked into the systemd socket activation API. */ > +#define FIRST_SOCKET_ACTIVATION_FD 3 > + > +/* Prepare environment for calling execvpe when doing systemd socket > + * activation. Takes the current environment and copies it. Removes > + * any existing LISTEN_PID or LISTEN_FDS and replaces them with new > + * variables. env[0] is "LISTEN_PID=..." which is filled in by > + * CONNECT_SA.START, and env[1] is "LISTEN_FDS=1". > + */ I know that getenv()/setenv()/putenv() tend to prefer sorted environ, but I also think that exec HA...
2017 Jan 31
0
[PATCH nbdkit] Add support for socket activation.
...ocket(s), the parent process (typically +systemd) passes in pre-opened file descriptors. Socket activation +lets you serve infrequent NBD requests using a superserver without +needing nbdkit to be running the whole time. + +Socket activation is triggered when both the C<LISTEN_FDS> and +C<LISTEN_PID> environment variables are set. In this mode using +I<-i>, I<-p>, I<--run>, I<-s> or I<-U> flags on the command line is +illegal and will cause an error. Also in this mode nbdkit does not +fork into the background (ie. I<-f> is implied). + +=head2 Using sock...
2019 Nov 15
1
Re: [PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...&sys_errlist;], [ diff --git a/generator/states-connect-socket-activation.c b/generator/states-connect-socket-activation.c index 243ba36..ee08dff 100644 --- a/generator/states-connect-socket-activation.c +++ b/generator/states-connect-socket-activation.c @@ -36,7 +36,9 @@ /* == strlen ("LISTEN_PID=") | strlen ("LISTEN_FDS=") */ #define PREFIX_LENGTH 11 -/* Prepare environment for calling execvpe when doing systemd socket +extern char **environ; + +/* Prepare environment for calling execvp when doing systemd socket * activation. Takes the current environment and copies i...
2023 Mar 23
1
[libnbd PATCH v3 19/19] socket activation: set LISTEN_FDNAMES
...tml> > / msgid <20230130225521.1771496-5-rjones at redhat.com>.] > > Signed-off-by: Laszlo Ersek <lersek at redhat.com> > Reviewed-by: Richard W.M. Jones <rjones at redhat.com> > --- > > @@ -245,6 +245,9 @@ CONNECT_SA.START: > "LISTEN_PID=", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", &pid_ofs); > SACT_VAR_PUSH (sact_var, &num_vars, > "LISTEN_FDS=", "1", NULL); > + if (h->sact_name != NULL) > + SACT_VAR_PUSH (sact_var, &num_vars, > +...
2019 Sep 27
0
Re: [PATCH libnbd 2/2] api: Implement local command with systemd socket activation.
...e (in addition to > everything else) so that the child can write() error details into > the pipe, but that's a lot of effort compared to just blindly > stating that the child failed but declaring full details of why as > lost. > > >+ } > >+ > >+ snprintf (listen_pid, sizeof listen_pid, "%ld", (long) getpid ()); > >+ setenv ("LISTEN_PID", listen_pid, 1); > >+ setenv ("LISTEN_FDS", "1", 1); And we could use similar code here. > snprintf() and setenv() are also not async-signal-safe. Which is a >...
2015 Sep 24
2
v2.2.19 release candidate released
On 24 Sep 2015, at 13:43, Marcin Miros?aw <marcin at mejor.pl> wrote: > > W dniu 23.09.2015 o 15:30, Timo Sirainen pisze: >> http://dovecot.org/releases/2.2/rc/dovecot-2.2.19.rc1.tar.gz >> http://dovecot.org/releases/2.2/rc/dovecot-2.2.19.rc1.tar.gz.sig >> >> A lot of changes since v2.2.18, so here's a release candidate first. If no bugs are reported,
2019 Sep 26
5
[PATCH libnbd 1/2] lib: Avoid killing subprocess twice.
If the user calls nbd_kill_subprocess, we shouldn't kill the process again when we close the handle (since the process has likely gone and we might be killing a different process). --- lib/handle.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/handle.c b/lib/handle.c index 2af25fe..5ad818e 100644 --- a/lib/handle.c +++ b/lib/handle.c @@ -315,6 +315,8 @@
2015 Sep 24
0
v2.2.19 release candidate released
...char-subscripts -Wformat=2 -Wbad-function-cast -Wno-duplicate-decl-specifier -Wstrict-aliasing=2 -c -o sd-daemon.o sd-daemon.c > sd-daemon.c:56:19: warning: implicit declaration of function 'getenv' is invalid in C99 [-Wimplicit-function-declaration] > if (!(e = getenv("LISTEN_PID"))) { > ^ > sd-daemon.c:56:17: warning: incompatible integer to pointer conversion assigning to 'const char *' from 'int' [-Wint-conversion] > if (!(e = getenv("LISTEN_PID"))) { > ^ ~~~~~~~~~~~~~~~~~~~~ > sd-dae...
2011 Apr 20
2
possible bug leading to lmtp crashes
...vironment = TZ KRB5CCNAME=/etc/dovecot/krb5.cc With that do any of the following lines from the referenced hg rev set mean I am missing anything on my import_environment variable? Or is it all good? 10.15 +/* <settings checks> */ 10.16 +#ifdef HAVE_SYSTEMD 10.17 +# define ENV_SYSTEMD " LISTEN_PID LISTEN_FDS" 10.18 +#else 10.19 +# define ENV_SYSTEMD "" 10.20 +#endif 10.21 +#ifdef DEBUG 10.22 +# define ENV_GDB " GDB" 10.23 +#else 10.24 +# define ENV_GDB "" 10.25 +#endif 10.26 +/* </settings checks> */ 10.27 + 10.28 static const struct master_settings m...
2019 Sep 30
4
[PATCH libnbd v2 0/2] Implement systemd socket activation.
v1 was posted here: https://www.redhat.com/archives/libguestfs/2019-September/thread.html#00337 v2: - Drop the first patch. - Hopefully fix the multiple issues with fork-safety and general behaviour on error paths. Note this requires execvpe for which there seems to be no equivalent on FreeBSD, except some kind of tedious path parsing (but can we assign to environ?) Rich.
2019 Sep 26
0
[PATCH libnbd 2/2] api: Implement local command with systemd socket activation.
...id disable_nagle (int sock) @@ -292,4 +295,110 @@ disable_nagle (int sock) SET_NEXT_STATE (%^MAGIC.START); return 0; + CONNECT_SA.START: + /* This is in some ways similar to nbd_aio_connect_command above, + * but we must pass a listening socket to the child process and + * we must set LISTEN_PID and LISTEN_FDS environment variables. + */ + size_t len; + int s; + struct sockaddr_un addr; + pid_t pid; + int flags; + char listen_pid[16]; + + assert (!h->sock); + assert (h->argv); + assert (h->argv[0]); + + /* Use /tmp instead of TMPDIR because we must ensure the path is +...
2023 Mar 25
4
[libnbd PATCH v5 0/4] pass LISTEN_FDNAMES with systemd socket activation
V4 was here (incorrectly versioned on the mailing list as v3): <http://mid.mail-archive.com/20230323121016.1442655-1-lersek at redhat.com>. See the Notes section on each patch for the v5 updates. Laszlo Ersek (2): socket activation: generalize environment construction socket activation: set LISTEN_FDNAMES Richard W.M. Jones (2): common/include: Copy ascii-ctype functions from nbdkit