Re: [systemd-devel] Help with making socket activation work.

2025-06-29 Thread Stef Bon
Hi, it is working now. I've disabled the forking of my service. I think that in general services started by systemd or any other service manager do not have to fork: they are already forked/exec. Thanks, S. Bon

Re: [systemd-devel] Help with making socket activation work.

2025-06-27 Thread Stef Bon
Yes I see. I understand now. I think - as you suggest - it's best to stop the service from forking if started by systemd. S. Bon

Re: [systemd-devel] Help with making socket activation work.

2025-06-27 Thread Andrei Borzenkov
27.06.2025 17:50, Stef Bon wrote: Ok. The environment variable won't change when calling sd_notify. I understand that. But how can I make socket activation work after the main process osns system has forked? Is it required to fork anyway Invoke sd_listen_fds before fork, parse LISTEN_FDS

Re: [systemd-devel] Help with making socket activation work.

2025-06-27 Thread Stef Bon
Op vr 27 jun 2025 om 15:23 schreef Andrei Borzenkov : > > > How do you expect this environment variable to change? It was set when > systemd invoked your program. How systemd is supposed to change the > value of this variable inside already started process? How systemd is > supposed to predict th

Re: [systemd-devel] Help with making socket activation work.

2025-06-27 Thread Nils Kattenbeck
The systemd APIs to receive the socket check that the PID matches that of the original process and otherwise returns. I assume you are running into this. This is a deliberate decision as otherwise things might go awry if multiple processes assume they can use the same socket. Ideally you would also

Re: [systemd-devel] Help with making socket activation work.

2025-06-27 Thread Andrei Borzenkov
27.06.2025 14:59, Stef Bon wrote: Hi, I've got a system daemon, and I want to make use of socket activation. It has a socket /run/osns/system.sock, where clients belonging to user sessions can connect to. What I've tried I do not get it to work. It used to fork, and the forked process created t

[systemd-devel] Help with making socket activation work.

2025-06-27 Thread Stef Bon
Hi, I've got a system daemon, and I want to make use of socket activation. It has a socket /run/osns/system.sock, where clients belonging to user sessions can connect to. What I've tried I do not get it to work. It used to fork, and the forked process created the socket. I've changed this using t