diff --git a/docs/deployment.md b/docs/deployment.md index 09a51622..d692b187 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -38,6 +38,10 @@ Here are some rules of thumb: * As you grow more confident in the thread safety of your app, you can tune the workers down and the threads up. +#### Ubuntu / Systemd (Systemctl) Installation + +See [systemd.md](systemd.md) + #### Worker utilization **How do you know if you're got enough (or too many workers)?** diff --git a/docs/systemd.md b/docs/systemd.md index 342b38d0..41e13a33 100644 --- a/docs/systemd.md +++ b/docs/systemd.md @@ -32,21 +32,26 @@ Type=simple # Preferably configure a non-privileged user # User= -# The path to the puma application root -# Also replace the "" place holders below with this path. -WorkingDirectory= +# The path to the your application code root directory. +# Also replace the "" place holders below with this path. +# Example /home/username/myapp +WorkingDirectory= # Helpful for debugging socket activation, etc. # Environment=PUMA_DEBUG=1 -# The command to start Puma. This variant uses a binstub generated via -# `bundle binstubs puma --path ./sbin` in the WorkingDirectory -# (replace "" below) -ExecStart=/sbin/puma -b tcp://0.0.0.0:9292 -b ssl://0.0.0.0:9293?key=key.pem&cert=cert.pem +# SystemD will not run puma even if it is in your path. You must specify +# an absolute URL to puma. For example /usr/local/bin/puma +# Alternatively, create a binstub with `bundle binstubs puma --path ./sbin` in the WorkingDirectory +ExecStart=//bin/puma -C /puma.rb + +# Variant: Rails start. +# ExecStart=//bin/puma -C /config/puma.rb ../config.ru -# Variant: Use config file with `bind` directives instead: -# ExecStart=/sbin/puma -C config.rb # Variant: Use `bundle exec --keep-file-descriptors puma` instead of binstub +# Variant: Specify directives inline. +# ExecStart=//puma -b tcp://0.0.0.0:9292 -b ssl://0.0.0.0:9293?key=key.pem&cert=cert.pem + Restart=always