通过Rundeck在屏幕上运行脚本

问题描述 投票:0回答:1

我在rundeck上的工作量很大,到最后试图通过命令打开屏幕

screen -S s1

但是我在梯级日志中看到错误

must be connected to terminal

未创建屏幕

有没有一种方法可以模拟通过Rundeck到终端的连接,或者可以通过其他方式构造命令?我的最终目标是在屏幕内运行脚本,以便在作业结束时继续运行脚本。目标服务器在Centos 7.6上运行

linux centos7 rundeck
1个回答
0
投票

Rundeck不能用作终端屏幕管理器或interactive shell,这是因为screen打开了一个新的多路复用终端,Rundeck的工作方式更像是专注于自动化的脚本解释器,运行脚本的最简单方法是步骤(内联脚本),然后用一些解释器(bash,python等)调用它。

我举个例子:

<joblist>
  <job>
    <defaultTab>nodes</defaultTab>
    <description></description>
    <executionEnabled>true</executionEnabled>
    <id>bfd52579-5161-4003-8cf4-ac570fbf5e7b</id>
    <loglevel>INFO</loglevel>
    <name>HelloWorld</name>
    <nodeFilterEditable>false</nodeFilterEditable>
    <plugins />
    <scheduleEnabled>true</scheduleEnabled>
    <sequence keepgoing='false' strategy='node-first'>
      <command>
        <fileExtension>.sh</fileExtension>
        <script><![CDATA[#!/bin/sh
echo "hi"]]></script>
        <scriptargs />
        <scriptinterpreter>/bin/bash</scriptinterpreter>
      </command>
    </sequence>
    <uuid>bfd52579-5161-4003-8cf4-ac570fbf5e7b</uuid>
  </job>
</joblist>
© www.soinside.com 2019 - 2024. All rights reserved.