Skip to content

Instantly share code, notes, and snippets.

@robypez
Created March 23, 2018 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robypez/6be9aad139e1ed300c94611227a15d49 to your computer and use it in GitHub Desktop.
Save robypez/6be9aad139e1ed300c94611227a15d49 to your computer and use it in GitHub Desktop.
scriptamanent@next:~$ systemctl status next-dday-staging.service
● next-dday-staging.service - Puma HTTP Forking Server - Day staging app
Loaded: loaded (/etc/systemd/system/next-dday-staging.service; enabled; vendor preset: enabled)
Active: active (running) since ven 2018-03-23 17:35:27 CET; 31min ago
Process: 788 ExecStart=/home/scriptamanent/.rbenv/bin/rbenv exec bundle exec puma -C /home/scriptamanent/dday/dday.it/shared/config/puma.rb --daemon (code=exited, status=0/SUCCESS)
Main PID: 1046 (ruby)
CGroup: /system.slice/next-dday-staging.service
└─1046 puma 3.8.1 (unix:///home/scriptamanent/dday/dday.it/shared/tmp/sockets/dday.it-puma.sock)
mar 23 17:34:30 next systemd[1]: Starting Puma HTTP Forking Server - Day staging app...
mar 23 17:34:49 next rbenv[788]: Puma starting in single mode...
mar 23 17:34:49 next systemd[1]: next-dday-staging.service: PID file /home/scriptamanent/dday/dday.it/shared/tmp/pids/puma.pid not readable (yet?) after start: No such file or directory
mar 23 17:35:27 next systemd[1]: Started Puma HTTP Forking Server - Day staging app.
[Unit]
Description=Puma HTTP Forking Server - Day staging app
After=network.target
[Service]
# Background process configuration (use with --daemon in ExecStart)
Type=forking
# Preferably configure a non-privileged user
User=scriptamanent
WorkingDirectory=/home/scriptamanent/dday/dday.it/current
# The command to start Puma
# Replace "<WD>" below, with the application root or working directory
ExecStart=/home/scriptamanent/.rbenv/bin/rbenv exec bundle exec puma -C /home/scriptamanent/dday/dday.it/shared/config/puma.rb --daemon
# The command to stop Puma
# Replace "<WD>" below
ExecStop=/home/scriptamanent/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/scriptamanent/dday/dday.it/shared/tmp/pids/puma.state -F /home/scriptamanent/dday/dday.it/shared/config/puma.rb stop
# Path to PID file so that systemd knows which is the master process
PIDFile=/home/scriptamanent/dday/dday.it/shared/tmp/pids/puma.pid
# Should systemd restart puma?
# Use "no" (the default) to ensure no interference when using
# stop/start/restart via `pumactl`. The "on-failure" setting might
# work better for this purpose, but you must test it.
# Use "always" if only `systemctl` is used for start/stop/restart, and
# reconsider if you actually need the forking config.
Restart=no
[Install]
WantedBy=multi-user.target
@robypez
Copy link
Author

robypez commented Mar 23, 2018

cap staging puma:start
00:00 puma:make_dirs
01 mkdir /home/scriptamanent/dday/dday.it/shared/tmp/sockets -p
✔ 01 scriptamanent@next.dday.it 0.050s
02 mkdir /home/scriptamanent/dday/dday.it/shared/tmp/pids -p
✔ 02 scriptamanent@next.dday.it 0.053s
00:00 puma:start
using conf file /home/scriptamanent/dday/dday.it/shared/config/puma.rb
01 $HOME/.rbenv/bin/rbenv exec bundle exec puma -C /home/scriptamanent/dday/dday.it/shared/config/puma.rb --daemon
01 Puma starting in single mode...
01 * Version 3.8.1 (ruby 2.4.1-p111), codename: Sassy Salamander
01 * Min threads: 4, max threads: 16
01 * Environment: staging
01 * Daemonizing...
✔ 01 scriptamanent@next.dday.it 0.798s
scrivoaroby at MacBook-Pro-3 in ~/Projects/dday.it on production*
$ cap staging puma:stop
00:00 puma:stop
01 $HOME/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/scriptamanent/dday/dday.it/shared/tmp/pids/puma.state -F /home/scriptamanent/dday/dday.it/shared/config/puma.rb stop
01 Command stop sent success
01
✔ 01 scriptamanent@next.dday.it 1.137s

@robypez
Copy link
Author

robypez commented Mar 23, 2018

scriptamanent@next:~$ systemctl status next-dday-staging.service
● next-dday-staging.service - Puma HTTP Forking Server - Day staging app
Loaded: loaded (/etc/systemd/system/next-dday-staging.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since ven 2018-03-23 18:16:05 CET; 1min 36s ago
Process: 2966 ExecStop=/home/scriptamanent/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/scriptamanent/dday/dday.it/shared/tmp/pids/puma.state -F /home/scriptamanent/dday/dday.it/shared/config/pum
Process: 2737 ExecStart=/home/scriptamanent/.rbenv/bin/rbenv exec bundle exec puma -C /home/scriptamanent/dday/dday.it/shared/config/puma.rb --daemon (code=exited, status=0/SUCCESS)
Main PID: 2755 (code=exited, status=0/SUCCESS)

mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/exe/bundle:35:in block in <top (required)>' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/friendly_errors.rb:121:in with_friendly_errors'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/exe/bundle:27:in <top (required)>' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/bin/bundle:23:in load'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/bin/bundle:23:in <main>' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/bin/ruby_executable_hooks:15:in eval'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/bin/ruby_executable_hooks:15:in `

'
mar 23 18:16:05 next systemd[1]: next-dday-staging.service: Control process exited, code=exited status=1
mar 23 18:16:05 next systemd[1]: next-dday-staging.service: Unit entered failed state.
mar 23 18:16:05 next systemd[1]: next-dday-staging.service: Failed with result 'exit-code'.

@robypez
Copy link
Author

robypez commented Mar 23, 2018

ar 23 18:14:54 next rbenv[2737]: * Daemonizing...
mar 23 18:14:54 next systemd[1]: next-dday-staging.service: PID file /home/scriptamanent/dday/dday.it/shared/tmp/pids/puma.pid not readable (yet?) after start: No such file or directory
mar 23 18:15:08 next systemd[1]: Started Puma HTTP Forking Server - Day staging app.
mar 23 18:16:05 next rbenv[2966]: No pid '2755' found
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/dday/dday.it/shared/bundle/ruby/2.4.0/gems/puma-3.8.1/lib/puma/control_cli.rb:215:in rescue in send_signal' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/dday/dday.it/shared/bundle/ruby/2.4.0/gems/puma-3.8.1/lib/puma/control_cli.rb:183:in send_signal'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/dday/dday.it/shared/bundle/ruby/2.4.0/gems/puma-3.8.1/lib/puma/control_cli.rb:230:in run' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/dday/dday.it/shared/bundle/ruby/2.4.0/gems/puma-3.8.1/bin/pumactl:8:in <top (required)>'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/dday/dday.it/shared/bundle/ruby/2.4.0/bin/pumactl:23:in load' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/dday/dday.it/shared/bundle/ruby/2.4.0/bin/pumactl:23:in <top (required)>'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:74:in load' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:74:in kernel_load'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/cli/exec.rb:27:in run' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/cli.rb:360:in exec'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in invoke_command'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor.rb:369:in dispatch' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/cli.rb:20:in dispatch'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/vendor/thor/lib/thor/base.rb:444:in start' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/cli.rb:10:in start'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/exe/bundle:35:in block in <top (required)>' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/friendly_errors.rb:121:in with_friendly_errors'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/exe/bundle:27:in <top (required)>' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/bin/bundle:23:in load'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/bin/bundle:23:in <main>' mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/bin/ruby_executable_hooks:15:in eval'
mar 23 18:16:05 next rbenv[2966]: /home/scriptamanent/.rbenv/versions/2.4.1/bin/ruby_executable_hooks:15:in `

'
mar 23 18:16:05 next systemd[1]: next-dday-staging.service: Control process exited, code=exited status=1
mar 23 18:16:05 next systemd[1]: next-dday-staging.service: Unit entered failed state.
mar 23 18:16:05 next systemd[1]: next-dday-staging.service: Failed with result 'exit-code'.
mar 23 18:18:34 next systemd[1]: Stopped Puma HTTP Forking Server - Day staging app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment