Create a process that isn't killed with the job #26925
-
Is there a way to purposefully spawn a background process that won’t be cleaned up at the end of the job? Jenkins uses env vars to keep track of its processes, so I’m able to mess with that to keep processes going in their CI, but I can’t figure out how GitHub runners keep track of processes. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Github hosted runners are VMs that are destroyed after the job ends, so there is no way to keep anything running there. If you just mean starting a process in one step and using it in other steps of the same job, regular services should do. I haven’t tried interacting with the init system in hosted runners yet, but starting Docker containers works just fine. |
Beta Was this translation helpful? Give feedback.
-
I should have specified, this is with a self hosted runner. |
Beta Was this translation helpful? Give feedback.
-
Figured this out, it actually does the same thing as Jenkins, I was just grabbing the env vars wrong. The runner uses the env var |
Beta Was this translation helpful? Give feedback.
Figured this out, it actually does the same thing as Jenkins, I was just grabbing the env vars wrong. The runner uses the env var
RUNNER_TRACKING_ID
to keep track of processes. If this is overwritten, the runner won’t clean up the process.