I encountered a problem using winexe with BackupPC.
I used log level 11 and I got the following output in a bash shell
I execute the shell under bash... no problem
I execute the shell under BackupPC and it stalls (have to kill manually the process)
the point it stalls one can find hereafter
---> shell
IN: async_open(\pipe\ahexec, 2)
IN: async_open_recv
CTRL: Sending command: get version
CTRL: Sending command: run cmd.exe /c c:\backuppc\pre-exec.cmd
CTRL: Recieved command: std_io_err 0FB40002
IN: async_open(\pipe\ahexec_stdin0FB40002, 2)
IN: async_open(\pipe\ahexec_stdout0FB40002, 2)
IN: async_open(\pipe\ahexec_stderr0FB40002, 2)
IN: async_open_recv
IN: async_open_recv
IN: async_open_recv
---> Backuppc (2013-07-18 17:46:43 Output from DumpPreUserCmd:)
IN: async_open(\pipe\ahexec, 2)
IN: async_open_recv
CTRL: Sending command: get version
CTRL: Sending command: run cmd /c c:\backuppc\pre-exec.cmd
CTRL: Recieved command: std_io_err 0E680002
IN: async_open(\pipe\ahexec_stdin0E680002, 2)
IN: async_open(\pipe\ahexec_stdout0E680002, 2)
IN: async_open(\pipe\ahexec_stderr0E680002, 2)
IN: async_open_recv
tevent: EPOLL_CTL_ADD failed (Operation not permitted) - falling back to select()
Aborting...
I ran under the same user (backuppc) and also under root (shell)... always the same
Mark
Which version of winexe are you using? Have you tried the development version (pre 1.1) from the winexe-waf repository?
Try running "cat </dev/null | winexe..." instead of "winexe...".
This is most probably the "doesn't work with stdin redirected" bug which has since been fixed.
Hi - I have the same problem (and same application use) as the original ticket. What build is this fixed in? I'm using 1.00-2.3.i686 from http://download.opensuse.org/repositories/home:/ahajda:/winexe/CentOS_CentOS-6/
on CentOS6 (obviously).
I'm also running v1.00 and getting this error. Please reopen.
This is a workaround for the BackupPC implementation. Basically, Winexe runs, the target machine is turned off, but then Winexe persists.
Source: http://www.goodjobsucking.com/?p=62&cpage=2#comment-3900
(Edit: messed up the block quote)
Last edit: Kris Lou 2013-10-23
I think it should be fixed in winexe. The problem is that it is samba code. I will look for some workaround which will not affect samba.
Kris, Oblio: you are running winexe 1.00. Please build winexe from the "current" (a.k.a. "winexe-waf") git repository and report whether or not the bug has been fixed there.
I'll build and test, but it'll take me a bit of time to get my dev environment up. For obvious reasons, I prefer repository-provided packages in my production server ... Is there a timeline for 1.1 to hit a yum repo?
I have compiled the source code with dynamic libraries (git co as of yesterday) and still have the same thing happening to me. For me, this happens in any script (i.e. I must manually hit the enter key in order to continue). Running cat </dev/null | ./winexe ... just seems to freeze it, while doing it without that gives the stopping error per op.
edit: this is running on x86_64 Arch Linux.
edit 2: also see this stackexchange post for some more debugging output: http://unix.stackexchange.com/questions/82825/using-winexe-to-run-wmic-commands-on-a-windows-machine/91467
Last edit: Shaun 2013-11-06
Shaun: Please build winexe from the "current" (a.k.a. "winexe-waf") git repository and report whether or not the bug has been fixed there.
I have just uploaded patch which should fix the issue. If not please reopen it.
I apologize about the long delay. I no longer work at my previous employer where I was trying to get this to work. However, I am still interested in seeing it fully work.
I did a git clone on a new personal laptop running Arch Linux x86-64. Made sure base-devel and mingw-w64-toolchain (which includes w32) were installed. Then
cd source/
./waf configure build
It compiled rather quickly on this new machine. I then ran
./winexe -d 9 -U Administrator%Password01 //192.168.10.122 "Powershell (Get-WmiObject -Class Win32_Product | Select-Object -Property Name)"
and observed the same behavior.
(i.e. command line is paused, and once I hit any key I get
CTRL: Received: return_code 00000000
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
)
Version does show 1.1:
./winexe -V
winexe version 1.1
Hi Shaun
This bug report is about poll/select bug, indicated by the following winexe message:
tevent: EPOLL_CTL_ADD failed (Operation not permitted) - falling back to select()
Your issue is totaly different, powershell is a console application and do not works correctly with simple stdin/out/error pipes provided by winexe.
Some workaround for this is to use additional windows redirection:
./winexe ... 'echo . | powershell ...'
as advised on numerous web pages, for example:
http://stackoverflow.com/questions/19129770/escape-special-chars-in-powershell-commands
Thanks ahajda. I hadn't realized where the bug was. Non-powershell commands do indeed work fine for me, even on version 1.0.