search for: run_command

Displaying 20 results from an estimated 334 matches for "run_command".

2017 Jun 20
2
[PATCH v2 1/2] mllib: add new Common_utils.run_commands
Mostly modelled after a snippet implemented in dib, it is an helper function to run multiple commands in parallel, waiting for all of them at once, and returning all their exit codes. It is possible to pass custom descriptors for collecting stdout and stderr of each command. Common_utils.run_command is adapted to use few helper methods used by run_commands, so all the existing code using it keeps working; in addition, it gets labelled parameters for stdout and stderr FDs. Add a simple unit tests for them. --- mllib/common_utils.ml | 87 ++++++++++++++++++++++++++++++++++++--------- mll...
2016 May 23
0
[PATCH 5/5] mllib: add a new run_command helper
...tch cmdline.format with + | None -> [] + | Some format -> [ "--format"; format ]) @ + (match cmdline.output with + | None -> [] + | Some output -> [ "--output"; output ]) @ + [ "--add"; cmdline.arg ] in + exit (run_command (Array.of_list cmd)) | `Delete_cache -> (* --delete-cache *) (match cmdline.cache with @@ -550,14 +549,14 @@ let main () = let ifile = List.assoc `Filename itags in let ofile = List.assoc `Filename otags in message (f_"Copying"); -...
2017 Apr 07
1
[PATCH 1/2] mllib: add new Common_utils.run_commands
Mostly modelled after a snippet implemented in dib, it is an helper function to run multiple commands in parallel, waiting for all of them at once, and returning all their exit codes. It is possible to pass custom descriptors for collecting stdout and stderr of each command. Common_utils.run_command is adapted to use it, so all the existing code using it keeps working. Add a simple unit tests for it. --- mllib/common_utils.ml | 85 +++++++++++++++++++++++++++++++++------------ mllib/common_utils.mli | 19 ++++++++++ mllib/common_utils_tests.ml | 50 ++++++++++++++++++++++++++ 3 fi...
2016 Aug 02
1
Re: [PATCH] mllib: check for executable existance in run_command (RHBZ#1362357)
On Tue, Aug 02, 2016 at 07:14:09PM +0200, Pino Toscano wrote: > run_command uses Unix.create_process which forks a child process, and > executes execve: the latter fails when the executable does not exist, > triggering the exit which, in older OCaml versions [1], also runs the > at_exit handlers. > > Since there is not much that can be done to avoid this on...
2010 May 13
2
Compiling R with --enable-R-shlib for rpy2 error
Hi, I am trying to compile R with the command below in order to install rpy2. ./configure --prefix=/usr/local/R/R-2.9.2 --with-gnu-ld --with-cairo --with-x --enable-R-shlib However, error the I have gotten was: /usr/bin/ld: CConverters.o: relocation R_X86_64_32S against `R_FunTab' can not be used when making a shared object; recompile with -fPIC CConverters.o: could not read symbols: Bad
2016 Aug 02
0
[PATCH] mllib: check for executable existance in run_command (RHBZ#1362357)
run_command uses Unix.create_process which forks a child process, and executes execve: the latter fails when the executable does not exist, triggering the exit which, in older OCaml versions [1], also runs the at_exit handlers. Since there is not much that can be done to avoid this on the OCaml side, to keep...
2019 Jan 08
1
[PATCH] v2v: -o openstack: Don't echo full commands (RHBZ#1664310).
...3ff1e1269 100644 --- a/v2v/output_openstack.ml +++ b/v2v/output_openstack.ml @@ -177,8 +177,10 @@ class output_openstack output_conn output_password output_storage let stdout_fd = if verbose () then None else Some (openfile "/dev/null" [O_WRONLY] 0) in - (* Note that run_command will close stdout_fd if defined. *) - Tools_utils.run_command ?stdout_fd cmd + (* Note that run_command will close stdout_fd if defined. + * Don't echo the command because it can contain passwords. + *) + Tools_utils.run_command ~echo_cmd:false ?stdout_fd cmd in (* Simi...
2016 Dec 24
1
lua.c32 : run_command() does not work if ALLOWOPTIONS from menu is set to 0
Good day, If I set allowoptions to 0 to hide editing menu entries and then select to run lua.c32 from menu , run_command() from inside the script it seems to invoke kernel/com32 modules without any parameter. For example pxechn.c32 will never be happy no matter what the command line is. But if you set allowoptions to 1 everything starts to work as expected, except the menu itself.
2006 Mar 08
3
Run command via SSH session displaying results via AJAX
I am trying to create a web app that allows me to invoke a command on another server via an SSH session. I am currently doing this as follows: 1) User is presented with a form to enter server, command, username and password. 2) User clicks "Run" and form is submitted to the "run_command" action. 3) The "run_command" action initiates an SSH session using net-ssh and registers callbacks with the SSH session to append any command output to the web session[:command_output]. Thus, session[:command_output] grows until all results (stdout and stderr) are accumulated. 4...
2015 Sep 29
8
[PATCH 0/7] copy-in/copy-out: Capture errors from tar subprocess (RHBZ#1267032).
Commits 3c27f3d91e1566854747bbe844186783fc84f3a8 and 1b6f0daa9ae7fcc94e389232d0c397816cda973d added an internal API for running commands asynchronously. It is only used by the copy-in and copy-out APIs. Unfortunately this made the command code very complex: it was almost impossible to redirect stderr to a file, and there were a lot of long-range dependencies through the file. It was also buggy:
2016 May 23
7
[PATCH 1/5] mllib: make external_command echo the command executed
Add an optional parameter to disable this behaviour, so the Curl module in v2v won't print user-sensible data (like passwords). --- builder/checksums.ml | 1 - builder/downloader.ml | 1 - builder/sigchecker.ml | 1 - mllib/common_utils.ml | 4 +++- mllib/common_utils.mli | 7 +++++-- v2v/curl.ml | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git
2017 Jun 20
0
[PATCH v2 2/2] dib: use Common_utils.run_commands
...- let matching_pair = List.hd matching_pair in - let _, csum_tool, outfd = matching_pair in - Unix.close outfd; - pids := new_pids; - match stat with - | Unix.WEXITED 0 -> () - | Unix.WEXITED i -> + let res = run_commands cmds in + iteri ( + fun i code -> + if code <> 0 then ( + let args, _, _ = List.nth cmds i in error (f_"external command ā€˜%sā€™ exited with error %d") - csum_tool i - | Unix.WSIGNALED i -> -...
2018 Aug 17
8
[PATCH v3 4/4] v2v: Add --print-estimate option to print copy size
I rethought this again, as I think that it's a dangerous assumption to bake qemu-img measure output into our API. This patch series runs qemu-img measure behind the scenes, but then parses the output and sums it to a single number which we print. Doing that required a bit of reworking, moving the Jansson [JSON parser] bindings from virt-builder into the common directory and a couple of other
2016 Sep 13
1
[PATCH] v2v: -o glance: set all properties during creation (RHBZ#1374405)
...k%d" source.s_name (i+1) in - let cmd = [ "glance"; "image-create"; "--name"; name; - "--disk-format=" ^ target_format; - "--container-format=bare"; "--file"; target_file ] in - if run_command cmd <> 0 then - error (f_"glance: image upload to glance failed, see earlier errors"); - (* Set the properties (ie. metadata). *) let min_ram = source.s_memory /^ 1024L /^ 1024L in let properties = [ @@ -114,26 +108,18 @@ object | x, 0...
2015 Feb 02
8
[PATCH 0/7 v2] Make copy_in & copy_out APIs, and use copy_in in customize
Hi, attached there is the second version of the patch series adding copy_in and copy_out in the library, mostly moving them from guestfish. It also adds the copy_in usage in virt-customize, as aid in a new image building. Thanks, Pino Toscano (7): cmd: add a way to run (and wait) asynchronously commands cmd: add a child-setup callback cmd: add the possibility to get a fd to the process
2008 Dec 10
1
[PATCH 1/2] COM32: lua - add syslinux library
Hi, the attached patch adds a new call to lua (patch is against latest lua branch): syslinux.run_command(...) It's just a little glue to call syslinux_run_command() from lua. Other syslinux functions should be easy to add. usage: syslinux.run_command("memdisk initrd=/dos/BIOS/FSC-P7935-108.img raw") Bye, Marcel -------------- next part -------------- A non-text attachment was sc...
2015 Jan 26
6
[PATCH 1/6] cmd: add a way to run (and wait) asynchronously commands
...++++++++++++++++++++------- src/guestfs-internal.h | 3 +++ 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/command.c b/src/command.c index 4bb469b..e26573d 100644 --- a/src/command.c +++ b/src/command.c @@ -360,7 +360,7 @@ debug_command (struct command *cmd) } static int -run_command (struct command *cmd) +run_command (struct command *cmd, bool get_stdout_fd, bool get_stderr_fd) { struct sigaction sa; int i, fd, max_fd, r; @@ -368,8 +368,11 @@ run_command (struct command *cmd) int outfd[2] = { -1, -1 }; char status_string[80]; + get_stdout_fd = get_stdout_fd ||...
2016 Jul 20
1
[PATCH] v2v: make virsh command quiet if v2v is quiet (RHBZ#1358142)
...uri; "pool-refresh"; output_pool ] in + let cmd = [ "virsh" ] @ + (if quiet () then [ "-q" ] else []) @ + (match oc with + | None -> [] + | Some uri -> [ "-c"; uri; ]) @ + [ "pool-refresh"; output_pool ] in if run_command cmd <> 0 then warning (f_"could not refresh libvirt pool %s") output_pool; @@ -425,10 +427,12 @@ class output_libvirt oc output_pool = object ); (* Define the domain in libvirt. *) - let cmd = - match oc with - | None -> [ "virsh"; &quo...
2016 Aug 02
2
[PATCH] mllib: move which and its exception from dib
Rename it from "tool" to "executable" in the process, but otherwise it is just code motion (with minimal adjustments in dib). --- dib/dib.ml | 2 +- dib/utils.ml | 16 +--------------- mllib/common_utils.ml | 14 ++++++++++++++ mllib/common_utils.mli | 9 +++++++++ 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/dib/dib.ml b/dib/dib.ml
2009 Jul 13
0
[PATCH server] remove vm forward vnc and vm host history
...p = find_host_ip(server) - return " -p tcp --dport " + vm.forward_vnc_port.to_s + " -j DNAT --to " + ip + ":" + vnc_port, - " -d " + ip + " -p tcp --dport " + vnc_port + " -j SNAT --to " + local_ip - end - - def self.run_command(cmd) - debug("Running command " + cmd) - status = system(cmd) - raise 'Command terminated with error code ' + $?.to_s unless status - end - - public - - def self.forward(vm) - return unless vm.forward_vnc - - allocate_forward_vnc_port(vm) -...