If $PID_PARENT launched $PID_CHILD, how can I detach (
disown?) $PID_CHILD from $PID_PARENT so that, when I kill $PID_PARENT, $PID_CHILD keeps running like nothing happened?
Concretely, my $PID_PARENT is the process running
Jenkins (or the
Java process that runs the server that runs Jenkins) and $PID_CHILD is a reeeeeeally long job that I don't want to have to restart after restarting Jenkins (which is needed for some maintenance). Essentially, I want to stop Jenkins but not stop the long job it started and I know both PIDs.
UPDATE 1: I found out about
disown and tried from a login shell (so not the parent PID shell):
-bash: disown: 13924: no such job
The $PID_CHILD correct and doing
ps -o ppid= $PID_CHILD
UPDATE 2: As per @Rui's answer, I made a temporary hack job in Jenkins that only runs, from the parent shell this time:
but still got
disown: 13924: no such job – amphibient