Skip to content

Implement systemd socket activation#191

Open
Nhqml wants to merge 1 commit intoekzhang:mainfrom
Nhqml:main
Open

Implement systemd socket activation#191
Nhqml wants to merge 1 commit intoekzhang:mainfrom
Nhqml:main

Conversation

@Nhqml
Copy link
Copy Markdown

@Nhqml Nhqml commented Apr 6, 2026

This PR implements systemd socket activation using listenfd crate.

If you're not familiar with systemd socket activation, I recommend reading these two blog posts that underline its goals and how it operates:

You can quickly test the behaviour with these two unit files:

# bore.socket
[Unit]
Description=Bore Control Socket

[Socket]
ListenStream=7835
KeepAlive=true

[Install]
WantedBy=sockets.target
# bore.service
[Unit]
Description=Bore Server
Requires=bore.socket
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/bore server --min-port 5000 --max-port 6000
Restart=always

[Install]
WantedBy=multi-user.target

In the event you're interested in merging this PR, I'll be happy to contribute more detailed documentation and examples on how to integrate with systemd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant