linuxmuster / linuxmuster-linbo

Linbo imaging system for linuxmuster.net
23 stars 22 forks source link

PID of screen launched #146

Closed kiarn closed 3 years ago

kiarn commented 3 years ago

I always must do a linbo-remote -l to get the PID of the screen launched, and then I can follow the result of the command with screen -r PID So this little PR is just here to already print the PID of the screen in background.

HappyBasher commented 3 years ago

You use -D and fork the screen with & to bg. I fear in this case the screen process terminates when the parent konsole process terminates, isn't it?

kiarn commented 3 years ago

I think it's not the case, because it inherits 1 as ppid. I have tested the following behaviour : 2 terminals T1 and t2 opened with ssh. In T1 I give linbo-remote -i pxtest3 -c sync:1,start:1 and the screen process then have a PID of 14022 :

# linbo-remote -l
  1 14022   10.0.100.3.linbo-remote (11/11/2020 15:37:15)   (Detached)
# ps -o ppid= -p 14022
    1

We can already see that the parent PID is 1, but even this result, I go further and close the terminal T1. I confirm in the terminal T2 that the screen process is still running :

# screen -r 14022
[detached from 14022.10.0.100.3.linbo-remote]

And it worked.

HappyBasher commented 3 years ago

PID will be printed in the next release. Do you know that you can get the screen output also by socketname? screen -r hostname.linbo-remote

kiarn commented 3 years ago

PID will be printed in the next release.

Thanks :+1:

Do you know that you can get the screen output also by socketname? screen -r hostname.linbo-remote

No, I didn't know that, good to know !