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

pumactl example in README doesn't work #1427

Closed
garybernhardt opened this issue Oct 4, 2017 · 2 comments
Closed

pumactl example in README doesn't work #1427

garybernhardt opened this issue Oct 4, 2017 · 2 comments

Comments

@garybernhardt
Copy link

Steps to reproduce

Here's what happens when I copy and paste the two commands in the "Control/Status Server" section of the README. (My only change is the & to put the server in the background.)

$ puma --control tcp://127.0.0.1:9293 --control-token foo&
Puma starting in single mode...
* Version 3.10.0 (ruby 2.4.1-p111), codename: Russell's Teapot
* Min threads: 0, max threads: 16
* Environment: development
* Listening on tcp://0.0.0.0:9292
* Starting control server on tcp://127.0.0.1:9293
Use Ctrl-C to stop

$ pumactl restart --control-token foo
Neither pid nor control url available
/Users/grb/proj/japanese/.gem/ruby/2.4.1/gems/puma-3.10.0/lib/puma/control_cli.rb:180:in `send_signal'
/Users/grb/proj/japanese/.gem/ruby/2.4.1/gems/puma-3.10.0/lib/puma/control_cli.rb:230:in `run'
/Users/grb/proj/japanese/.gem/ruby/2.4.1/gems/puma-3.10.0/bin/pumactl:8:in `<top (required)>'
/Users/grb/proj/japanese/.gem/ruby/2.4.1/bin/pumactl:22:in `load'
/Users/grb/proj/japanese/.gem/ruby/2.4.1/bin/pumactl:22:in `<main>'

Expected behavior

It restarts the server, as the README says it will.

Actual behavior

See above.

System configuration

Ruby version:2.4.1p11
Rails version:nil
Puma version:3.10.0

The same thing happens if I run the server via puma --control tcp://127.0.0.1:9293 --control-token foo&, then try to restart it with pumactl restart -C 'tcp://127.0.0.1:9293' --control-token foo. So maybe the docs are right but my puma installation is broken in some way? It's a fresh install with no configuration or anything, though.

@nateberkopec
Copy link
Member

Whoops, yeah in the docs that should say something like:

pumactl -C 'tcp://127.0.0.1:9293' --control-token foo restart

or

pumactl -p <puma-pid> --control-token foo restart

We're just using OptionParser so it's too dumb to allow "command-before-arguments", even though it feels more natural here. All options must come before the command.

@garybernhardt
Copy link
Author

That did it, thanks!

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

2 participants