Project

General

Profile

Actions

Bug #22630

closed

REX task using job template for reboot might hang despite reboot succeeded

Added by Pavel Moravec about 6 years ago. Updated about 6 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Fixed in Releases:
Found in Releases:

Description

After issuing a host reboot job through SSH-based REX, the job may remain in Pending state on Satellite. The host reboots just fine as expected but even after 18+ hours the task still shows Pending.

This happens just sometimes, with some random probability depending on several factors.

The problem is expected to appear in situation when the `reboot` command switches off network before the command returns success value back to `ssh`. Therefore, the `ssh` command is not properly completed.

A simple solution is to replace `reboot` by e.g. `shutdown -r +1` to delay the reboot by 1 minute, which allows the command and ssh to properly terminate. The negs is the reboot will happen with one minute delay.

We can try to come up with some bash tricks like:

(sleep 2; reboot) &
true

but I am afraid some gotchas can be found there as well - anyway I am open to any suggestion, the `shutdown -r +1` is just a proposal (with its own drawback).

PR for it on the way..


Related issues 1 (0 open1 closed)

Copied to Foreman - Bug #22679: REX task using job template for reboot might hang despite reboot succeededClosed02/20/2018Actions
Actions #1

Updated by The Foreman Bot about 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/319 added
Actions #2

Updated by Pavel Moravec about 6 years ago

  • Bugzilla link set to 1543636
Actions #3

Updated by Pavel Moravec about 6 years ago

  • Pull request https://github.com/theforeman/community-templates/pull/456 added
Actions #4

Updated by Pavel Moravec about 6 years ago

  • Copied to Bug #22679: REX task using job template for reboot might hang despite reboot succeeded added
Actions #5

Updated by Pavel Moravec about 6 years ago

Please close this ticket - work is done in http://projects.theforeman.org/issues/22679 and I dont have permissions to close this ticket..

Actions #6

Updated by Ewoud Kohl van Wijngaarden about 6 years ago

  • Status changed from Ready For Testing to Duplicate
Actions

Also available in: Atom PDF