Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图在 Jenkins 的 Groovy postbuild 脚本中启动一个新进程之前杀死所有 ruby 进程。它看起来像这样:
def command_kill = "kill -9 `pidof ruby`" def proc_kill = command_kill.execute() proc_kill.waitFor()
这导致
KILL:stderr:错误:垃圾进程 ID“ruby`”。
这里有什么问题?这适用于同一服务器上的 Debian 终端。
尝试这个。
def procId = "pidof ruby".execute() def killProc = "kill ${procId.in.text}".execute()