There is the following code

SshClient sshClient = new SshClient(host, 22, login, password); sshClient.Connect(); /*1 этап shellStream.WriteLine("yum install httpd"); System.Threading.Thread.Sleep(1000 * 4); shellStream.WriteLine("y"); shellStream.Expect(new Regex(@"Complete!"), new TimeSpan(0, 15, 0));*/ //2 этап var cmd = sshClient.CreateCommand("chkconfig iptables off && service iptables stop"); cmd.Execute(); cmd = sshClient.CreateCommand("chkconfig ip6tables off && service ip6tables stop"); cmd.Execute(); //3 этап cmd = sshClient.CreateCommand("echo 'NETWORKING_IPV6=yes' >> /etc/sysconfig/network"); cmd.Execute(); //4 этап cmd = sshClient.CreateCommand("echo"+" "+ "> /etc/sysconfig/network-scripts/ifcfg-sit1"); cmd.Execute(); cmd = sshClient.CreateCommand("echo 'DEVICE=sit1' >> /etc/sysconfig/network-scripts/ifcfg-sit1"); cmd.Execute(); cmd = sshClient.CreateCommand("echo 'BOOTPROTO=none' >> /etc/sysconfig/network-scripts/ifcfg-sit1"); cmd.Execute(); cmd = sshClient.CreateCommand("echo 'ONBOOT=yes' >> /etc/sysconfig/network-scripts/ifcfg-sit1"); cmd.Execute(); cmd = sshClient.CreateCommand("echo 'IPV6INIT=yes' >> /etc/sysconfig/network-scripts/ifcfg-sit1"); cmd.Execute(); cmd = sshClient.CreateCommand("echo IPV6TUNNELIPV4="+REMOTE_IPV4+">> /etc/sysconfig/network-scripts/ifcfg-sit1"); cmd.Execute(); cmd = sshClient.CreateCommand("echo IPV6TUNNELIPV4LOCAL="+LOCAL_IPV4+">> /etc/sysconfig/network-scripts/ifcfg-sit1"); cmd.Execute(); cmd = sshClient.CreateCommand("echo IPV6ADDR="+LOCAL_IPV6+"::2/48"+">> /etc/sysconfig/network-scripts/ifcfg-sit1"); cmd.Execute(); //5 этап cmd = sshClient.CreateCommand("echo sit1 ::/0 > /etc/sysconfig/static-routes-ipv6"); cmd.Execute(); //6 этап cmd = sshClient.CreateCommand("echo -A INPUT -p 41 -j ACCEPT >> /etc/sysconfig/iptables"); cmd.Execute(); //7 этап cmd = sshClient.CreateCommand("echo nameserver 2001:4860:4860::8888 >> /etc/resolv.conf"); cmd.Execute(); cmd = sshClient.CreateCommand("echo nameserver 2001:4860:4860::8844 >> /etc/resolv.conf"); cmd.Execute(); //8 этап cmd = sshClient.CreateCommand("wget http://3proxy.ru/0.8.6/3proxy-0.8.6.tgz"); System.Threading.Thread.Sleep(1000 * 8); cmd.Execute(); cmd = sshClient.CreateCommand("tar -xvf 3proxy-0.8.6.tgz"); cmd.Execute(); System.Threading.Thread.Sleep(1000 * 8); cmd = sshClient.CreateCommand("cd 3proxy"); cmd.Execute(); cmd = sshClient.CreateCommand("ln -s /usr/lib64/libcrypto.so.10 /usr/lib/libcrypto.so"); cmd.Execute(); System.Threading.Thread.Sleep(1000 * 1); cmd = sshClient.CreateCommand("ln -s /usr/lib64/libssl.so.10 /usr/lib/libssl.so"); cmd.Execute(); System.Threading.Thread.Sleep(1000 * 1); //9 этап IDictionary<Renci.SshNet.Common.TerminalModes, uint> termkvp = new Dictionary<Renci.SshNet.Common.TerminalModes, uint>(); termkvp.Add(Renci.SshNet.Common.TerminalModes.ECHO, 53); ShellStream shellStream = sshClient.CreateShellStream("xterm", 80,24, 800, 600, 1024, termkvp); shellStream.WriteLine("make -f /root/3proxy/Makefile.Linux"); System.Threading.Thread.Sleep(1000 * 50); //12 этап sshClient.Disconnect(); return "ok"; 

Before step 9, everything is well executed, all data is written to files and commands are also executed. At the 9th stage, I want to build 3proxy using the make -f /root/3proxy/Makefile.Linux command - the build is not performed, although if the same code is simply written in the console, then everything works. What could be the problem? And there are no compilation errors.

  • And what does “not produced” mean? What are the error messages? - VladD
  • No error messages, absolutely normal completion - maksvolf
  • It can not be, everything would be fine, everything would work. Set up logging then. Figure out in pieces: does make run or not? - VladD
  • make is installed and working properly, I say, I tried to do it manually - everything is fine - maksvolf
  • @maksvolf, try to put delays between teams. - Alexis

0