search for: first_socket_activation_fd

Displaying 20 results from an estimated 28 matches for "first_socket_activation_fd".

2017 Jan 31
0
[PATCH nbdkit] Add support for socket activation.
...r manual pages of interest: + +L<systemd.socket(5)>. + =head1 AUTHORS Richard W.M. Jones diff --git a/src/main.c b/src/main.c index 9453cce..e935da2 100644 --- a/src/main.c +++ b/src/main.c @@ -54,6 +54,8 @@ #include "nbdkit-plugin.h" #include "internal.h" +#define FIRST_SOCKET_ACTIVATION_FD 3 /* defined by systemd ABI */ + static char *make_random_fifo (void); static void open_plugin_so (const char *filename); static void start_serving (void); @@ -64,6 +66,7 @@ static void write_pidfile (void); static void fork_into_background (void); static uid_t parseuser (const char *); stati...
2023 Mar 23
1
[libnbd PATCH v3 07/19] socket activation: replace execvp() call with fork-safe variant
...epare_socket_activation_environment() calls set_error() internally */ - goto unlink_sockpath; + goto uninit_execvpe; pid = fork (); if (pid == -1) { set_error (errno, "fork"); goto empty_env; } if (pid == 0) { /* child - run command */ if (s != FIRST_SOCKET_ACTIVATION_FD) { if (dup2 (s, FIRST_SOCKET_ACTIVATION_FD) == -1) { nbd_internal_fork_safe_perror ("dup2"); @@ -189,45 +196,47 @@ CONNECT_SA.START: char buf[32]; const char *v = nbd_internal_fork_safe_itoa ((long) getpid (), buf, sizeof buf); strcpy (&env.ptr[0...
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 @@
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.
...generator/states-connect.c b/generator/states-connect.c index e9b3582..51b907e 100644 --- a/generator/states-connect.c +++ b/generator/states-connect.c @@ -37,6 +37,9 @@ #include <sys/socket.h> #include <sys/un.h> +/* This is baked into the systemd socket activation API. */ +#define FIRST_SOCKET_ACTIVATION_FD 3 + /* Disable Nagle's algorithm on the socket, but don't fail. */ static void 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...
2019 Oct 01
2
Re: [PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...terop tests in future.) > > The upstream spec for systemd socket activation is here: > http://0pointer.de/blog/projects/socket-activation.html > --- > +++ b/generator/states-connect-socket-activation.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 i...
2023 Mar 23
20
[libnbd PATCH v3 00/19] pass LISTEN_FDNAMES with systemd socket activation
V3 was here: <http://mid.mail-archive.com/20230215141158.2426855-1-lersek at redhat.com>. See the Notes section on each patch for the v4 updates. The series is nearly ready for merging: every patch has at least one R-b tag, except "socket activation: avoid manipulating the sign bit". The series builds, and passes "make check" and "make check-valgrind", at
2019 Sep 30
0
[PATCH libnbd v2 2/2] api: Implement local command with systemd socket activation.
...+ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> +#include <unistd.h> +#include <sys/socket.h> +#include <sys/un.h> + +#include "internal.h" + +/* 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 + * CONNEC...
2019 Sep 26
2
Re: [PATCH libnbd 2/2] api: Implement local command with systemd socket activation.
...is here: > http://0pointer.de/blog/projects/socket-activation.html > --- > +++ b/generator/states-connect.c > @@ -37,6 +37,9 @@ > #include <sys/socket.h> > #include <sys/un.h> > > +/* This is baked into the systemd socket activation API. */ > +#define FIRST_SOCKET_ACTIVATION_FD 3 > + > /* Disable Nagle's algorithm on the socket, but don't fail. */ > static void > disable_nagle (int sock) > @@ -292,4 +295,110 @@ disable_nagle (int sock) > SET_NEXT_STATE (%^MAGIC.START); > return 0; > > + CONNECT_SA.START: > + /* This...
2023 Jan 28
1
[PATCH libnbd] generator: Pass LISTEN_FDNAMES=nbd with systemd socket activation
...nect-socket-activation.c b/generator/states-connect-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...
2023 Jan 31
1
[PATCH libnbd] generator: Pass LISTEN_FDNAMES=nbd with systemd socket activation
...erator/states-connect-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...
2019 Nov 04
3
[PATCH nbdkit v2 0/2] Implement fuzzing using Clang's libFuzzer.
v1 was here: https://www.redhat.com/archives/libguestfs/2019-November/msg00003.html This version depends on: https://www.redhat.com/archives/libguestfs/2019-November/msg00004.html and this series: https://www.redhat.com/archives/libguestfs/2019-November/msg00009.html The delta has been reduced slightly because of changes made possible by cleaning up and fixing the quit path in nbdkit. It's
2019 Oct 11
0
[PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
...ruct backend *, struct connection *conn, void *handle, int readonly); diff --git a/server/main.c b/server/main.c index 5623149..935d422 100644 --- a/server/main.c +++ b/server/main.c @@ -857,6 +857,7 @@ start_serving (void) for (i = 0; i < nr_socks; ++i) socks[i] = FIRST_SOCKET_ACTIVATION_FD + i; change_user (); + backend->ready_to_serve (backend); write_pidfile (); accept_incoming_connections (socks, nr_socks); free_listening_sockets (socks, nr_socks); /* also closes them */ @@ -866,6 +867,7 @@ start_serving (void) /* Handling a single connection on stdin/...
2023 Jan 31
1
[PATCH libnbd] generator: Pass LISTEN_FDNAMES=nbd with systemd socket activation
...ctivation.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. T...
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 Nov 02
2
[PATCH nbdkit 0/2] Implement fuzzing using Clang's libFuzzer.
libFuzzer is Clang's fuzzer, and alternative to using AFL: https://llvm.org/docs/LibFuzzer.html I implemented an alternative method of fuzzing for libnbd earlier today and it's pretty simple: https://github.com/libguestfs/libnbd/commit/c19a6fbae9a21a7d4693418706c59e81ed256875 However it's considerably more difficult to use libFuzzer with non-library code -- in this case nbdkit.
2018 Nov 14
3
[PATCH nbdkit v2 0/2] build: Replace ./nbdkit with a C program.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-November/msg00147.html v2: - Use stdbool for booleans. - Use __attribute__((format(printf))). - Don't abort on invalid options, exit with failure instead. - Preserve long/short option choices in the output. - Add '=' in long option output, ie. always use --longopt=arg. - Add "--" parameter
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
2017 Feb 03
5
[PATCH 0/5] Support socket activation in virt-p2v.
As the subject says, support socket activation in virt-p2v. I have added upstream support for socket activation to nbdkit already: https://github.com/libguestfs/nbdkit/commit/7ff39d028c6359f5c0925ed2cf4a2c4c751af2e4 I posted a patch for qemu-nbd, still waiting on more reviews for that one: https://www.mail-archive.com/qemu-devel@nongnu.org/msg427246.html I tested this against old and new qemu
2018 Nov 14
5
[PATCH nbdkit v3 0/4] build: Replace ./nbdkit with a C program.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-November/msg00147.html v2 was here: https://www.redhat.com/archives/libguestfs/2018-November/msg00152.html v3: - Use optarg != NULL as a sentinel for has_arg. - Moved some variable decls into the inner loop. - Make nbdkit wrapper depend on config.status, so if srcdir or builddir changes then we rebuild the wrapper. It