X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=doc%2Fcmd%2Fnncp-exec.texi;fp=doc%2Fcmd%2Fnncp-exec.texi;h=7bd7508402413b1c1f7d4666961461401fdaa622;hb=ab7c7eca0e53661f0ba904c2a6ba752990bea367;hp=0000000000000000000000000000000000000000;hpb=0ca5764d9eeff210ebf50d6c2e03fa6cbd173b99;p=nncp.git diff --git a/doc/cmd/nncp-exec.texi b/doc/cmd/nncp-exec.texi new file mode 100644 index 0000000..7bd7508 --- /dev/null +++ b/doc/cmd/nncp-exec.texi @@ -0,0 +1,51 @@ +@node nncp-exec +@section nncp-exec + +@example +$ nncp-exec [options] [-use-tmp] [-nocompress] NODE HANDLE [ARG0 ARG1 ...] +$ nncp-exec [options] [-use-tmp] [-nocompress] area:AREA HANDLE [ARG0 ARG1 ...] +@end example + +Send execution command to @option{NODE} for specified @option{HANDLE}. +Body is read from @code{stdin} into memory and compressed (unless +@option{-nocompress} is specified). After receiving, remote side will +execute specified @ref{CfgExec, handle} command with @option{ARG*} +appended and decompressed body fed to command's @code{stdin}. + +If @option{-use-tmp} option is specified, then @code{stdin} data is read +into temporary file first, requiring twice more disk space, but no +memory requirements. @ref{StdinTmpFile, Same temporary file} rules +applies as with @ref{nncp-file, nncp-file -} command. + +For example, if remote side has following configuration file for your +node: + +@verbatim +exec: { + sendmail: [/usr/sbin/sendmail, "-t"] + appender: ["/bin/sh", "-c", "cat >> /append"] +} +@end verbatim + +then executing @verb{|echo My message | nncp-exec -replynice 123 REMOTE +sendmail root@localhost|} will lead to execution of: + +@example +echo My message | + NNCP_SELF=REMOTE \ + NNCP_SENDER=OurNodeId \ + NNCP_NICE=123 \ + /usr/sbin/sendmail -t root@@localhost +@end example + +If @ref{CfgNotify, notification} is enabled on the remote side for exec +handles, then it will sent simple letter after successful command +execution with its output in message body. + +@strong{Pay attention} that packet generated with this command won't be +be chunked. + +If you use @option{area:AREA} instead of @option{NODE}, then +@ref{Multicast, multicast} packet will be sent to specified area. That +creates outgoing packet to the @strong{self} node, so you have to run +@ref{nncp-toss, tossing} to create outgoing packets to required subscribers.