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
systemd AF_UNIX domain socket activation not working #1976
Comments
Just tried with master, same error:
The code around there is this: if File.exist? path
begin
old = UNIXSocket.new path
rescue SystemCallError, IOError
File.unlink path
else
old.close
raise "There is already a server bound to: #{path}"
end
end
s = UNIXServer.new(path) … UNIXSocket.new('puma.sock') doesn't raise an exception until you do somethin with it, not sure how this check is supposed to work. |
👋 I've just committed an example Dockerfile to the repo: 58acb80 If you could kindly construct a Dockerfile that reproduces the issue, we can nail down the problem 👍 |
@nateberkopec i need to do this too #1970 (comment) |
👍 |
I'm not sure what you're asking… this is about socket activation with systemd. Running systemd in a Docker container is pretty difficult, Docker and systemd don't play nice together (see: https://lwn.net/Articles/676831/ for example). Also, did you intend to close this issue? |
whoops, I did not |
@risen Ah I didn't know that. I guess I'll have to repro on AWS or something then, as I don't have access to a physical Linux machine. |
Vagrant is pretty sweet for stuff like this |
try |
I've just tried again with version 4.3.5, and it seems to work now. The socket triggers the service, as expected. Puma mentions LISTEN_FDS on startup:
For completeness sake, here's my
And my
I'm not sure in which version this issue got resolved, but thanks for fixing this. |
Even though I try to follow the guide at: systemd.md, if the systemd
hellopuma.socket
file is started first and creates an AF_UNIX domain socket file, then thehellopuma.service
fails with:systemd config
using a per-user systemd instance, using
loginctl enable-linger user
andsystemctl --user …
rack application
expected behavior
Puma takes over/binds to systemd's AF_UNIX domain socket file
used versions
full log
The text was updated successfully, but these errors were encountered: