jenkinsci / jenkinsci/command-launcher-plugin

[JENKINS-50842] command-launcher terminates the process

Open
#127 3 comments 0 reactions 0 assignees View on GitHub
component:command-launcher-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
9
Forks
26
Avg merge
8h 29m
Merged PRs (30d)
2

Description

The command launcher is difficult to use for powering on and off instances as they are needed.

As can be seen in https://groups.google.com/forum/?nomobile=true#!topic/jenkinsci-users/EckKCU1rg9o users might want to have a script which: powers on a remote computer,  starts the remote agent, power off the remote computer. This can be useful when the instance is in the cloud, used rarely, and it's very expensive to keep it on.

Currently the powering off is very difficult to do because the command-launcher-plugin kills the process (when running the remote agent), so the "power-off" command is not executed.

Maybe you can use TERM instead of KILL to stop the process, in which case the script can handle the event. Best would be if the script is not killed at all, and instead leave the remote agent and the script to stop by themselves. Then it would be possible to run the remaining commands in the script, as expected. This would also eliminate the need to detail this termination behaviour in the plugin documentation.

---
Originally reported by aleb, imported from: command-launcher terminates the process


  • status: Open
  • priority: Minor
  • component(s): command-launcher-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 3
  • imported: 20251215-193512

Raw content of original issue

The command launcher is difficult to use for powering on and off instances as they are needed.

As can be seen in https://groups.google.com/forum/?nomobile=true#!topic/jenkinsci-users/EckKCU1rg9o users might want to have a script which: powers on a remote computer,  starts the remote agent, power off the remote computer. This can be useful when the instance is in the cloud, used rarely, and it's very expensive to keep it on.

Currently the powering off is very difficult to do because the command-launcher-plugin kills the process (when running the remote agent), so the "power-off" command is not executed.

Maybe you can use TERM instead of KILL to stop the process, in which case the script can handle the event. Best would be if the script is not killed at all, and instead leave the remote agent and the script to stop by themselves. Then it would be possible to run the remaining commands in the script, as expected. This would also eliminate the need to detail this termination behaviour in the plugin documentation.

  • environment: Jenkins ver. 2.107.1

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the command-launcher behavior with a script that powers on a remote instance, starts the remote agent, and powers it off. Compare termination using TERM, KILL, or no termination, and verify that the script's remaining power-off command executes. The issue mentions no source files or tests, so the relevant implementation and test coverage must first be located.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.