ruby - Chef : 在节点上将 jenkins 代理作为后台进程运行
问题描述
我在控制台上手动运行这个命令,java -jar agent.jar -jnlpUrl {{master_url}}/computer/{{slave_name}}/slave-agent.jnlp -secret {{secret_key}} > /dev/null 2>&1 &
基本上它是在后台启动詹金斯奴隶并且它工作正常,现在当我尝试在厨师中做同样的事情时,厨师客户端进程挂起并超时,因为进程永远不会进入后台并且会话保持活动状态。
command = Mixlib::ShellOut.new("java -jar agent.jar -jnlpUrl {{master_url}}/computer/{{slave_name}}/slave-agent.jnlp -secret {{secret_key}}" > /dev/null 2>&1 &")
command.run_command
解决方案
你真的应该为此使用适当的服务层,它在所有现代 Linux 发行版中都是 systemd。
推荐阅读
- apache-spark - 在数据帧的子集上应用火花窗口函数
- python - AWS-Greengrass BLE 扫描仪。运行 python 脚本的问题 Sockets Bad File Descriptor
- oauth-2.0 - 将自定义 URI 架构与 OAuth 2.0 一起使用
- wix - 错误 ICE18:组件的 KeyPath:“DeviceStartup”是目录:
- angular - RXJS BehaviorSubject.next() 不调用订阅者
- vue.js - 如何抽象 vee-validate 错误属性?
- c++ - c ++ cuda:cudaMalloc在构造函数之外管理访问
- hibernate - HIbernate Envers:修改的外键
- powershell - 如何制作导入 csv、搜索特定短语然后导出结果的 Powershell 脚本?
- php - 在 Twig/Timber 的搜索结果中突出显示搜索词