Kixunil / Kixunil/systemd_socket

Should not always unset env vars

Open
#2 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
7
Forks
0
PR merge metrics
No merged PRs in 30d

Description

The low level system call `sd_listen_fds` allows keeping env vars by accepting an int parameter. By the same token I would propose to at least making the unsetting of env vars optional. There are legitimate use cases that require the env vars to persist. For instance, a systemd managed service can reload itself by creating a child process for which the systemd sockets must be inherited. This child process will eventually replace the original service process and become the new main process, until then this reload process can occur again. Cloudflare has open sourced a Rust library for graceful process restart using this approach. One can read the details [here](https://blog.cloudflare.com/oxy-the-journey-of-graceful-restarts/).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the issue's reference to the systemd sd_listen_fds API and the linked Cloudflare graceful-restart article. Inspect the crate's public socket-activation API to determine where environment variables are unset, then verify that an optional setting can preserve them for inherited child processes without changing the default behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
operating-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.