Skip to content
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 unit #83

Open
gcolpart opened this issue Aug 25, 2018 · 0 comments
Open

systemd unit #83

gcolpart opened this issue Aug 25, 2018 · 0 comments

Comments

@gcolpart
Copy link
Member

gcolpart commented Aug 25, 2018

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant