[ https://issues.apache.org/jira/browse/VCL-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16121799#comment-16121799 ]
ASF subversion and git services commented on VCL-1073: ------------------------------------------------------ Commit 1804679 from arku...@apache.org in branch 'vcl/trunk' [ https://svn.apache.org/r1804679 ] VCL-1073 Added '&' after call to shutdown in Linux.pm::reboot and Linux.pm::shutdown so that they doesn't wait for the command to complete. Added 'max_attempts' = 1 argument to execute call so that multiple attempts aren't tried if the connection is quickly broken after the reboot starts. Removed error checking on the result of executing this command. Later on, the code waits for the computer to either shut down or not respond to ping and monitors the reboot. If the shutdown command failed for some reason, the code would still attempt a hard reset or power off. Other Moved activate_interfaces call to earlier in Linux.pm::post_load. It was being called after update_public_ip_address, synchronize_time, and possibly other steps that would require the interfaces to be up. Replaced duplicated code calling ifup in Linux.pm::activate_interfaces with call to start_network_interface. > Linux.pm::reboot may fail because it doesn't detect broken SSH connection > during first attempt > ---------------------------------------------------------------------------------------------- > > Key: VCL-1073 > URL: https://issues.apache.org/jira/browse/VCL-1073 > Project: VCL > Issue Type: Bug > Components: vcld (backend) > Affects Versions: 2.4.2 > Reporter: Andy Kurth > Assignee: Andy Kurth > Fix For: 2.5 > > > On occasion, the SSH connection to the machine being rebooted is not > gracefully terminated after _shutdown -r_ is executed by *Linux.pm::reboot*. > The SSH command returns *Connection to <VM IP address> closed by remote > host.*: > {panel} > utils.pm:run_ssh_command|4382| ---- WARNING ---- > utils.pm:run_ssh_command|4382| 2017-08-05 > 14:04:32utils.pm:run_ssh_command|4382|attempt 1/3: failed to execute SSH > command on <VM IP address> (<VM>): '/sbin/shutdown -r now', exit status: 255, > SSH exits with the exit status of the remote command or with 255 if an error > occurred, output 2: > utils.pm:run_ssh_command|4382| ssh output (/sbin/shut...): > *{color:red}Connection to <VM IP address> closed by remote host.{color}* > utils.pm:run_ssh_command|4382| ( 0) utils.pm, run_ssh_command (line: 4382) > utils.pm:run_ssh_command|4382| (-1) OS.pm, execute (line: 3281) > utils.pm:run_ssh_command|4382| (-2) Linux.pm, reboot (line: 2714) > utils.pm:run_ssh_command|4382| (-3) inuse.pm, process (line: 123) > utils.pm:run_ssh_command|4382| (-4) vcld, make_new_child (line: 601) > utils.pm:run_ssh_command|4382| (-5) vcld, main (line: 353) > {panel} > *utils.pm::run\_ssh\_command* then makes 2 more attempts to call _shutdown > -r_. Both of which expectedly fail because the computer is already in the > process of rebooting. > {panel} > utils.pm:run_ssh_command|4363| ---- WARNING ---- > utils.pm:run_ssh_command|4363| attempt 2/3: failed to execute SSH command on > <VM IP address> (<VM>): '/sbin/shutdown -r now', exit status: 255, output: > utils.pm:run_ssh_command|4363| ssh output (/sbin/shut...): ssh: connect to > host <VM IP address> port 22: Connection refused > ... > utils.pm:run_ssh_command|4400| ---- WARNING ---- > utils.pm:run_ssh_command|4400| failed to run SSH command after 3 attempts, > command: /usr/bin/ssh -i /etc/vcl/vcl.key -o StrictHostKeyChecking=no -o > UserKnownHostsFile=/dev/null -o ConnectionAttempts=1 -o ConnectTimeout=30 -o > BatchMode=no -o PasswordAuthentication=no -l root -p 22 -x <VM IP address> > '/sbin/shutdown -r now' 2>&1, exit status: 255, output: > utils.pm:run_ssh_command|4400| ssh output (/sbin/shut...): ssh: connect to > host <VM IP address> port 22: Connection timed out > ... > Linux.pm:reboot|2716| ---- WARNING ---- > Linux.pm:reboot|2716| failed to execute command to reboot <VM> > {panel} > If the user initiated a reboot, a CRITICAL message is sent: > {panel} > inuse.pm:process|123| ---- CRITICAL ---- > inuse.pm:process|123| user requested reboot of <VM> failed > {panel} -- This message was sent by Atlassian JIRA (v6.4.14#64029)