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
Daemon / Silent Mode #57
Comments
I thought I'd replied to this. ngrok does let you supply -log=stdout which will turn off the console interface and just display streaming log output over stdout. There is no daemon mode and I don't intend on adding one. I think daemonizing services is almost always better left to a supervising framework like runit/upstart/supervisor/etc. |
You did, this was posted before your reply. Thanks for the tip. |
@inconshreveable I'd be fine if this solution actually let you run the thing in the background, but running something like:
doesn't even allow you to background the job. It fails with a:
If I have a config file, I need zero output from ngrok on what it's doing 99% of the time. The |
@inconshreveable also, I can see where you're coming from regarding "daemonizing", however, you have to consider your tool may be used by those who: a. cannot understand how those services work (eg, explaining to a non-technical QA person how to set it up) I'm currently trying to work on my shellfiles so they can be used by our developers to abstract away whether they are using localtunnel, ngrok, pagekite, etc. All of the other services offer some sort of "run this thing without any terminal output" except for ngrok. So if I'm to support ngrok, I not only have to know if ngrok is installed, but I also have to check to see which type of "supervising framework" they have installed, figure out whether it's configured to run ngrok, and finally execute the proper command for that framework to start ngrok. That's a lot of extra work for something that is as simple as "route all output to a log file" and optionally "drop a PID file somewhere". |
@jfelchner That's good feedback. I think you can get what you want now with:
Or if you want a log:
This is a very unintuitive UI. "-log=stdout" really means "disable the terminal UI", which is surprising and not well documented. I've recently discovered that it's possible for a program to detect whether it's attached to a tty or not and adjust its UI accordingly. I'll probably use that in the next version of ngrok to disable the terminal UI when run under supervisors or in the background, as well as possibly splitting out "do I run the terminal ui" into a separate option (or at least configuration file parameter). With regard to a daemonization: it seems like if the "&" operator works as you expect it to, that it becomes unnecessary to have a daemon option. Do you disagree? |
@inconshreveable if the I'll try out your solution above and get back with you. Thanks for the reply! |
This worked for me!
|
@rwestergren me too. :) As soon as Github actually gets a "here is a list of all the issues you're subscribed to", stuff like this won't fall through the cracks. |
Just wanted to let you know that I've run into the same UX issue and a --quiet or similar flag would have been more obvious. |
'scuse my probably stupidity, but how would I get
I can't figure out where the 'tcp' declaration would go. |
Someone know how to log -proto=tcp 22 ? |
I was successful using a tunnel for ssh in the config file and running my config file looks like this
|
When I try |
@selfagency same issue here, the -log is the problem, how to achieve the same thing with the new version? |
As of version 2.0.24, |
@gnhuy91 Doesn't this fill up the log file and cause waste of memory? I mean, does log rotation need to be turned on?? |
@IgorGanapolsky yea you should bring up your own solution, but anw above command no longer available. |
This solution no longer works (w/ 2.3.35). |
The right command is now
|
it works! now... how can i stop it? |
|
This is stupid, the ngrok team should really have a --daemon flag, because i'm sshing into my Raspberry Pi to run ngrok, except when I shut the terminal, the agent stops, so now I have to have my laptop running when when I'm using my Raspberry Pi with OMV. |
I am running ngrok in a vagrant box via puppet and it seems to error out when I start the service which I assume is because of the interface being returned. It would be great to run
ngrok --daemon 80
or--silent
which would only return a 0 status if successful or the error. If such an option does already exist I didnt see it on the help pages or in the code anywhere.The text was updated successfully, but these errors were encountered: