Skip to content

systemd unit #83

@gcolpart

Description

@gcolpart

I suggest to add this example of systemd unit :

[Unit]
Description=Puma HTTP Server for Chexpire
After=network.target

[Service]
WorkingDirectory=/home/%u/www/current
UMask=0027
Environment="GEM_HOME=/home/%u/www/shared/bundle/ruby/2.3.0/"
Environment="RBENV_ROOT=/home/%u/.rbenv"
Environment="RAILS_ENV=production"
Environment="RACK_ENV=production"
ExecStart=/home/%u/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/%u/www/shared/tmp/pids/puma.state -F /home/%u/www/shared/puma.rb restart
Type=forking
RemainAfterExit=yes

[Install]
WantedBy=default.target

and add documentation to explain how to use it :

* Ensure to enable systemd units for your user by executing in root : loginctl enable-linger <user>
* Create chexpire.service in ~/.config/systemd/user/
* Adjust GEM_HOME with your ruby version
* systemctl --user enable chexpire && systemctl --user start chexpire

Note: unfortunatly capistrano doesn't use systemd unit by default, it breaks "systemctl status"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions