0

On a server I ran a debug intense script and unfortunately my session was interrupted (broken pipe).

I logged in again and apparently the script is still running:

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                                                     
 139038 root      20   0  844140 339612  35460 S  21.6   4.2 189:38.92 python3.10                                                                                                                                  
  96624 root      20   0 1519664 106096  15672 S   3.3   1.3 436:23.05 python3                                                                                                                                     
  75514 root      20   0  636272 187972  12116 S   0.3   2.3  10:37.75 python3.10                                                                                                                                  
      1 root      20   0    4152     48      4 S   0.0   0.0   0:00.04 bash   

Is there any chance to re-enter the script?

Qohelet
  • 145
  • 1
  • 1
  • 9
  • 1
    *Maybe* [`reptyr`](https://superuser.com/a/1293299/432690). – Kamil Maciorowski Feb 27 '23 at 15:29
  • @KamilMaciorowski - I am not sure if I understood that correctly but it has to be separated already. But it won't work: `# reptyr -T 139038 Unable to attach to pid 139038: Operation not permitted The kernel denied permission while attaching. If your uid matches the target's, check the value of /proc/sys/kernel/yama/ptrace_scope. For more information, see /etc/sysctl.d/10-ptrace.conf ` – Qohelet Feb 27 '23 at 15:43
  • Please confirm you did not miss where the linked answer says "don't miss this note". – Kamil Maciorowski Feb 27 '23 at 16:08
  • `# kernel.yama.ptrace_scope = 0 bash: kernel.yama.ptrace_scope: command not found` - also I would have to reboot anyway – Qohelet Feb 27 '23 at 17:06
  • 1
    Sigh… My impression is you don't read thoroughly. `echo 0 > /proc/sys/kernel/yama/ptrace_scope` is a shell command to change the setting immediately. `kernel.yama.ptrace_scope = 0` is not a command, it's a line to place in the mentioned file `/etc/sysctl.d/10-ptrace.conf`. – Kamil Maciorowski Feb 27 '23 at 17:19

0 Answers0