Skip to content

Instantly share code, notes, and snippets.

@murilomothsin
Created May 22, 2018 11:50
Show Gist options
  • Save murilomothsin/9e1632d96c7ea04e1dbc93c83f695d77 to your computer and use it in GitHub Desktop.
Save murilomothsin/9e1632d96c7ea04e1dbc93c83f695d77 to your computer and use it in GitHub Desktop.
Systemd scripts (/etc/systemd/system)
[Unit]
# https://github.com/puma/puma/blob/master/docs/systemd.md
Description=Puma HTTP Server
After=network.target
[Service]
Type=simple
User=user
WorkingDirectory=/path/to/your/project
ExecStart=/bin/bash -lc 'bundle exec puma -C /path/to/your/project/config/puma.rb'
Restart=always
[Install]
WantedBy=multi-user.target
[Unit]
Description=sidekiq
After=syslog.target network.target
[Service]
Type=simple
WorkingDirectory=/path/to/your/project
# If you use rbenv:
ExecStart=/bin/bash -lc 'bundle exec sidekiq -e production 2>&1 > /path/to/your/project/log/sidekiq.log'
User=user
Group=user
UMask=0002
Environment=MALLOC_ARENA_MAX=2
RestartSec=1
Restart=on-failure
# This will default to "bundler" if we don't specify it
SyslogIdentifier=sidekiq
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment