-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a systemd.socket is started by the according systemd.service #12
Conversation
data/os/RedHat.yaml
Outdated
@@ -2,4 +2,4 @@ | |||
tang::package_name: | |||
- 'tang' | |||
|
|||
tang::service_name: 'tang.socket' | |||
tang::service_name: 'tang.service' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check if this works?
It looks like the package only provide a multiinstance unit: https://centos.pkgs.org/8-stream/centos-appstream-x86_64/tang-7-8.el8.x86_64.rpm.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should work: /usr/lib/systemd/system/tangd@.service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to move switch from socket activation?
Yes: https://www.freedesktop.org/software/systemd/man/systemd.socket.html For each socket unit, a matching service unit must exist, describing the service to start on incoming traffic on the socket (see systemd.service(5) for more information about .service units). |
@tuxmea Generally, when using systemd socket activation the service unit itself is disabled. |
changed back to socket. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verified that this works:
[root@rocky-8gb-fsn1-1 ~]# systemctl status tangd.socket
● tangd.socket - Tang Server socket
Loaded: loaded (/usr/lib/systemd/system/tangd.socket; disabled; preset: disabled)
Drop-In: /etc/systemd/system/tangd.socket.d
└─override.conf
Active: active (listening) since Wed 2023-10-25 16:14:27 UTC; 4min 24s ago
Until: Wed 2023-10-25 16:14:27 UTC; 4min 24s ago
Listen: [::]:7500 (Stream)
Accepted: 0; Connected: 0;
Tasks: 0 (limit: 49300)
Memory: 8.0K
CPU: 818us
CGroup: /system.slice/tangd.socket
Oct 25 16:14:27 rocky-8gb-fsn1-1 systemd[1]: Listening on Tang Server socket.
[root@rocky-8gb-fsn1-1 ~]# systemctl cat tangd@.service
# /usr/lib/systemd/system/tangd@.service
[Unit]
Description=Tang Server
[Service]
StandardInput=socket
StandardOutput=socket
StandardError=journal
ExecStart=/usr/libexec/tangd /var/db/tang
User=tang
User=tang
[root@rocky-8gb-fsn1-1 ~]# systemctl cat tangd.socket
# /usr/lib/systemd/system/tangd.socket
[Unit]
Description=Tang Server socket
[Socket]
ListenStream=80
Accept=true
[Install]
WantedBy=sockets.target
# /etc/systemd/system/tangd.socket.d/override.conf
[Socket]
ListenStream=
ListenStream=7500
[root@rocky-8gb-fsn1-1 ~]# curl http://127.0.0.1:7500/adv
{"payload": "eyJrZXlzIjogW3siYWxnIjogIkVTNTEyIiwgImt0eSI6ICJFQyIsICJjcnYiOiAiUC01MjEiLCAieCI6ICJBWmZVNVNXRHUyc3I4UEdCbFZ0dGlyaS16a3h5ZnE5aS1od3RqNVBwWUhDX2ZRVThRWGxQdUhBUDlEQXM3VFBid200anFPcGFvekZqTTN1N3NDMThXMko4IiwgInkiOiAiQVhtdEtyX0JEVThERXV3N2ppTzBuZEZkMk9NX3BZZlJucV9Mb0wyOVJicWFtZ2hINkRrTFd0WkZ6Q29IX0NVbkpDMV9hMENmam41OWV0NUJrVk1wbHlNaiIsICJrZXlfb3BzIjogWyJ2ZXJpZnkiXX0sIHsiYWxnIjogIkVDTVIiLCAia3R5IjogIkVDIiwgImNydiI6ICJQLTUyMSIsICJ4IjogIkFQNDVkU0g1cUtiYXUwU3ZXRzV3aVdrTkRhc0pYUDNVSlNSanJhZUt0YnVSVDdNMHFncEN2aE1rVHdBMDRFNGh6WGdCZVAwZTdaTWlVUWlfaHJuM3Z1TjAiLCAieSI6ICJBUnF6NmI1VGtlTTZ3N3hvdEtmQW9WdmxOTExINFd3a3RYa0VMRWlzdGp3XzZfaVYzbmdBeU82UmR5blRDZnFLSk9qNHQzLS1aSHJldjNTb2lHbW1DdFJOIiwgImtleV9vcHMiOiBbImRlcml2ZUtleSJdfV19", "protected": "eyJhbGciOiJFUzUxMiIsImN0eSI6Imp3ay1zZXQranNvbiJ9", "signature": "AOth4yxhO34NIlo4xocAKuPsKhOE_WKhQToFPsU-Eg7JhsDQehYwIkJJQKqmSVRDv1kwrmhWoR9it0cfjUyrlA9mAaZgVWW1HUDyJUp6cawKw-BjektGmzneWYztfRgKNP_VO8YIeekWS3hdaKL0gXcgUWhDLCAZcjbRgm7JPhg0Z2t_"}[root@rocky-8gb-fsn1-1 ~]#
see https://centos.pkgs.org/8-stream/centos-appstream-x86_64/tang-7-8.el8.x86_64.rpm.html /usr/lib/systemd/system/tangd@.service
…lf is disabled also add devcontainer option devcontainer still needs more work, as we need a systemd running container.
a1c9830
to
3cb31e5
Compare
No description provided.