Created
November 25, 2018 17:43
-
-
Save pondpaun7z/88cd9c480b01cbe0f2723635182201b5 to your computer and use it in GitHub Desktop.
Revisions
-
pondpaun7z created this gist
Nov 25, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ # /etc/systemd/system/puma.service # systemctl daemon-reload # sudo systemctl [start|stop|enable|restart] puma.service [Unit] Description=Puma HTTP Server After=network.target # Uncomment for socket activation (see below) # Requires=puma.socket [Service] # Foreground process (do not use --daemon in ExecStart or config.rb) Type=simple # Preferably configure a non-privileged user User=<USER> # The path to the puma application webbased-vm # Also replace the "<WD>" place holders below with this path. WorkingDirectory=<WD>/current # Helpful for debugging socket activation, etc. Environment=RBENV_ROOT=/home/<USER>/.rbenv # The command to start Puma. This variant uses a binstub generated via # `bundle binstubs puma --path ./sbin` in the WorkingDirectory # (replace "<WD>" below) ExecStart=/home/<USER>/.rbenv/bin/rbenv exec bundle exec puma -C <WD>/shared/config/puma.rb ExecStop=/home/<USER>/.rbenv/bin/rbenv exec bundle exec pumactl -S <WD>/shared/tmp/pids/puma.state -F <WD>/shared/puma.rb stop RestartSec=10 # Variant: Use config file with `bind` directives instead: # ExecStart=<WD>/sbin/puma -C config.rb # Variant: Use `bundle exec --keep-file-descriptors puma` instead of binstub Restart=always [Install] WantedBy=multi-user.target