Closed jphastings closed 9 years ago
+1
There is no reason to make port
a default option.
I'm working on removing it via metaprogramming for now...
--kill [PORT]
, since it should be described by pid, and pid file name does not depend on port, and kill_arg
is never used in stop
.trap 'INT'
, while dante insists on putting it to ensure
:Dante.run('myapp') do |opts|
begin
loop do
sleep 1
end
ensure do
p "SHUTDOWN!"
end
end
opts
passed to a block:
docs: # opts: host, pid_path, port, daemonize, user, group
code: {:host=>"0.0.0.0", :pid_path=>"/var/run/myapp.pid", :log_path=>false, :debug=>true}
Why log_path is false by default, not /var/log/myapp.log
as help mentions?
Is there a CLI option to override host?myapp [-p port] [-P file] [-d] [-k]
- no -L
, -u
, -G
, -l
mentioned.Sorry for putting this as a list, this is all related to options.
Besides that, when running without -d
option, it's impossible to stop app with ^C
:
$ ./1.rb --pid ./1.pid --log 1.log
Starting myapp service...
^C^C^C^C[1] 21801 killed ./1.rb --pid ./1.pid --log 1.log
From another terminal:
$ ./1.rb --pid ./1.pid --log 1.log -k
No myapp processes are running
$ ps aux g 1
pirj 21801 4.9 1.6 65644 53772 pts/7 Sl+ 19:48 0:42 ruby ./1.rb --pid ./1.pid --log 1.log
Killed it with kill 21801. Odd.
You can remove the switches with this code:
class OptionParser
def remove_switch(short_name, long_name)
@stack[2].long.reject! { |k| k == long_name }
@stack[2].short.reject! { |k| k == short_name }
end
end
And then whenever you have the opts, you can do:
opts.remove_switch("port", "p")
This will remove the switches in --help
but it is obviously a hack!
+1 in order to get a clean solution.
Moved to new repository: libdante/dante.gem/issues/4
Hi, I'm planning on using Dante for a script which doesn't open any ports (it listens and emits to MQs) - I think there ought to be a way for folks to remove the -p PORT option (or any other) from dante's default listings.