-
Notifications
You must be signed in to change notification settings - Fork 160
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
runproc sample #21
base: master
Are you sure you want to change the base?
runproc sample #21
Conversation
…f the element via the json
args := x.Args() | ||
|
||
if len(args) != 1 && !x.Bool("all") { | ||
fatalf("runproc needs an anchor argument or use the --all flag to do the entire circuit") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"to do the entire circuit" should be "to execute on every host in the circuit"
Let me know if any of the comments are unclear. |
Good comments. I wanted your feedback on the timeout thing. I knew it was bad. |
I think I've got it all fixed up. |
I took this branch, merged current master back in, and fixed the resulting compile errors: |
This was pretty easy to get going. It still has json on stdin, but it closes stdin, returns stdout, and scrubs the element. Is this a decent way to proceed? This already makes it much more shell friendly. This kind of thing looks nice:
https://gist.github.com/8c7864a67b24eac38ab8
Also I added a --all flag so it will go across the entire circuit. This example does a netstat and tags each line of output and does the entire circuit. The calls across the circuit go asyncronously.
cat netstat.in | circuit runproc --tag --all -d circuit://10.9.201.38:11022/9317/Q18f5f14751995021
The input json looks like this:
{
"Path": "/usr/bin/sudo",
"Args":["/bin/netstat", "-pant"],
"Name": "netstat"
}