Tag Info

Hot answers tagged

5

If you run ps -el instead of ps -ef, you'll get an S column with the process state. My guess is that the process is in state D, which means uninterruptible wait. In other words, the process is stuck in the messier parts of a device driver, and the kernel doesn't think it's safe to kill it until the device driver lets go of it. You sometimes see this with ...


4

One approach could be to attach a debugger to the process and make it open stdout on /dev/null: gdb --batch -ex 'call close(1)' -ex 'call open("/dev/null",2)' -p "$pid"


3

There's a tool called cryopid that lets you snapshot a running process so you can resume it later. I haven't tried, but I see no reason why you couldn't "resume" the snapshotted process while the original is still running. As terdon's comment implied, there's a lot of things to consider when snapshotting a process, so cryopid can be finicky; the best ...


3

From man jobs(1P): <current> The character '+' identifies the job that would be used as a default for the fg or bg utilities; this job can also be specified using the job_id %+ or "%%". The character '−' identifies the job that would become the default if the current default job were to exit; this job can also be ...


2

Check the bash manual: When bash is interactive, in the absence of any traps, it ignores SIGTERM https://www.gnu.org/software/bash/manual/bashref.html#Signals Check the kill help text (help kill at a bash prompt): If neither SIGSPEC nor SIGNUM is present, then SIGTERM is assumed. ...


2

You can, but the shell tries hard not to die unless it's absolutely sure that's what is required. SIGHUP works (as does SIGKILL), and you can try this - kill -HUP $$ (If you prefer numeric signal identifiers the HUP can be replaced with 1.) The reason that SIGHUP works is that this is the signal that would have been sent when a serial line connection ...


2

On busybox, "ps" doesn't have a "-o" option, but "ps l" includes the RSS column. If the underlying O/S is Linux, you can also get more specific details for a given process from: cat /proc/PID/status The output looks like this: Name: ash State: S (sleeping) Tgid: 1990 Pid: 1990 PPid: 1 TracerPid: 0 Uid: 0 0 0 0 Gid: 0 0 0 0 ...


1

let me yank here the solution @jimmij pointed to , with minor modification . (gdb) attach <pid> ... (gdb) call open("/dev/null",O_WRONLY) $1 = 3 (gdb) call dup2($1,fileno(stdout)) $2 = 1 (gdb) call close($1) ... (gdb) detach ... for those not familiar with gdb , "attach" "call" "detach" are gdb commands . get information with "help attach" ...


1

You can use gdb to do this: gdb --batch -ex 'handle all print' -ex 'handle all nostop' -ex 'handle all pass' -ex 'run' cat will run cat under GDB and print all signals, pass them to the program and not stop execution. Doing this for a background program is harder, as GDB will try and go into the background instead. You might be better off starting it with ...


1

The OS has permissions on the directories and if they don't permit a user to create anything in /etc it would be a security hole if some other mechanism would have the OS open other files than it thinks it is doing. (If the user has the permissions there is no need to fool the OS, then she can just change the files). That permissions on /etc are normally ...


1

Under the hood, the way environment variables transit from program to program is through the execve system call, which loads a new program image from disk. (This image replaces the current program; there's another system call, fork, which duplicates the current program; functions like system combine fork, execve and a few other system calls to launch a ...


1

The shell builtin set shows all variables, not just those that have been exported to the environment. If you want to add a variable to the environment, simply do export variablename in your shell.



Only top voted, non community-wiki answers of a minimum length are eligible