Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eriksjolund/systemd-restart-service-fdstore
Example systemd user service that uses FDSTORE=1
https://github.com/eriksjolund/systemd-restart-service-fdstore
container demo podman socket-activation systemd-service
Last synced: about 1 month ago
JSON representation
Example systemd user service that uses FDSTORE=1
- Host: GitHub
- URL: https://github.com/eriksjolund/systemd-restart-service-fdstore
- Owner: eriksjolund
- License: mit
- Created: 2022-03-20T09:40:28.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-20T16:27:48.000Z (almost 3 years ago)
- Last Synced: 2024-10-31T17:45:15.134Z (3 months ago)
- Topics: container, demo, podman, socket-activation, systemd-service
- Language: C
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# systemd-restart-service-fdstore
Example systemd user service that uses FDSTORE=1
**Status**:
Running on the host works ([email protected]). Running in a container with Podman fails ([email protected]).
See https://github.com/eriksjolund/systemd-restart-service-fdstore/issues/1.# Installation
```
git clone URL
cd systemd-restart-service-fdstore
gcc -o /tmp/server server_fdstore.c -l systemd
mkdir -p ~/.config/systemd/user
cp [email protected] ~/.config/systemd/user
cp [email protected] ~/.config/systemd/user
systemctl --user daemon-reload
Systemctl --user start [email protected]
```# Usage
```
$ socat readline tcp4:127.0.0.1:3010
aaaaa
AAAAA
bbb
BBB
ccc
CCC
dddd
DDDD
eeeeeee
EEEEEEE
fffffff
FFFFFFF
```The systemd user service [email protected] calls `exit(EXIT_FAILURE)` every nth time (n=3) it receives a string.
systemd will then pass the previously stored accepted TCP socket when restarting the service.
The client will not notice the restart because the TCP connections stays active.In another shell run
```
journalctl --user -xe -u [email protected]
```
to see the restarts happening.