Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Short of closing and reopening your tty (i.e. logging off and back on, which may also terminate some of your background processes in the process) you only have one choice left:</p> <ul> <li>attach to the process in question using gdb, and run: <ul> <li>p dup2(open("/dev/null", 0), 1)</li> <li>p dup2(open("/dev/null", 0), 2) </li> <li>detach</li> <li>quit</li> </ul></li> </ul> <p>e.g.:</p> <pre><code>$ tail -f /var/log/lastlog &amp; [1] 5636 $ ls -l /proc/5636/fd total 0 lrwx------ 1 myuser myuser 64 Feb 27 07:36 0 -&gt; /dev/pts/0 lrwx------ 1 myuser myuser 64 Feb 27 07:36 1 -&gt; /dev/pts/0 lrwx------ 1 myuser myuser 64 Feb 27 07:36 2 -&gt; /dev/pts/0 lr-x------ 1 myuser myuser 64 Feb 27 07:36 3 -&gt; /var/log/lastlog $ gdb -p 5636 GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt; This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Attaching to process 5636 Reading symbols from /usr/bin/tail...(no debugging symbols found)...done. Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/librt.so.1 Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done. [Thread debugging using libthread_db enabled] [New Thread 0x7f3c8f5a66e0 (LWP 5636)] Loaded symbols for /lib/libpthread.so.0 Reading symbols from /lib/ld-linux-x86-64.so.2...(no debugging symbols found)...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 (no debugging symbols found) 0x00007f3c8eec7b50 in nanosleep () from /lib/libc.so.6 (gdb) p dup2(open("/dev/null",0),1) [Switching to Thread 0x7f3c8f5a66e0 (LWP 5636)] $1 = 1 (gdb) p dup2(open("/dev/null",0),2) $2 = 2 (gdb) detach Detaching from program: /usr/bin/tail, process 5636 (gdb) quit $ ls -l /proc/5636/fd total 0 lrwx------ 1 myuser myuser 64 Feb 27 07:36 0 -&gt; /dev/pts/0 lrwx------ 1 myuser myuser 64 Feb 27 07:36 1 -&gt; /dev/null lrwx------ 1 myuser myuser 64 Feb 27 07:36 2 -&gt; /dev/null lr-x------ 1 myuser myuser 64 Feb 27 07:36 3 -&gt; /var/log/lastlog lr-x------ 1 myuser myuser 64 Feb 27 07:36 4 -&gt; /dev/null lr-x------ 1 myuser myuser 64 Feb 27 07:36 5 -&gt; /dev/null </code></pre> <p>You may also consider:</p> <ul> <li>using <code>screen</code>; screen provides several virtual TTYs you can switch between without having to open new SSH/telnet/etc, sessions</li> <li>using <code>nohup</code>; this allows you to close and reopen your session without losing any background processes in the... process.</li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload