我有一个重新启动服务器的rundeck作业,它发送命令" sudo reboot"。这有效,服务器正在重启。
问题是rundeck没有收回信号,因此作业失败。
有没有办法让这项工作在rundeck中得到完整的信号?
答案 0 :(得分:0)
也许将命令包装在脚本中,后台重启操作,然后返回0?我正在做一些类似于一组开发虚拟机的东西,但我正在使用virsh。我不明白为什么用物理服务器无法做到这一点:
#!/bin/bash
ssh rundeck@yourserver sudo reboot &
exit 0
您可能需要尝试使用ssh选项(可能是'-f'和/或'-n')以使其正常工作。
答案 1 :(得分:0)
现在好好玩,我只是用作Local Command步骤:
import java.util.Scanner;
public class Assignment{
public static void main(String[] args){
try {
System.out.println("Welcome.");
System.out.println("To quit at anytime please type \"Q\". Enter value for first point X:");
Scanner scan = new Scanner (System.in);
while (scan.hasNext()) {
if (scan.hasNextDouble()) {
double x = scan.nextDouble();
//System.out.println(x); //Printing for verification
System.out.println("Please enter vlaue for first point Y:");
double y = scan.nextDouble();
//System.out.println(y); //Printing for verification
//Point point1 = new Point(x,y);
System.out.println("First point created.");
System.out.println("Please enter value for second point X:");
double x2 = scan.nextDouble();
//System.out.println(x2); //Printing for verification
System.out.println("Please enter value for second point Y:");
double y2 = scan.nextDouble();
//System.out.println(x2); //Printing for verification
break;
}
else {
String input = scan.next();
if (input.equalsIgnoreCase("Q")) {
System.out.println("Exiting");
break;
}
else {
System.out.println("You did not enter a valid value. Please enter a number or \"Q\" to quit.");
}
}
}
}
catch(Exception e){
System.out.println("Exiting Program.");
}
}
}
返回代码是ZERO,每个人都很高兴。