Hot answers tagged

41 votes

How can I copy a /tmp/ directory that is created & deleted by a process?

You could always run the application under: gdb --args /path/to/your/your-program and its args Then add breakpoints on unlink(), unlinkat(), rmdir() functions or syscalls: catch syscall unlink catch ...
user avatar
7 votes

How can I copy a /tmp/ directory that is created & deleted by a process?

I found this shell script that uses inotify-tools, and it did exactly what I was looking for (author: https://unix.stackexchange.com/a/265995/536771): #!/bin/sh TMP_DIR=/tmp CLONE_DIR=/tmp/clone ...
user avatar
5 votes
Accepted

kernel code is a dedicated process running?

In Unix-style contexts, some people think of the kernel as “process 0” (coming before process 1, init). However that’s not really accurate, notably because kernels aren’t scheduled in the same way as ...
user avatar
5 votes

How can I copy a /tmp/ directory that is created & deleted by a process?

I had a similar situation in the past. I vaguely remember running something similar to chattr -R -a /tmp, essentially making /tmp append-only. Processes can create files/directories but not delete ...
user avatar
  • 4,314
5 votes

How can I copy a /tmp/ directory that is created & deleted by a process?

The solution, I once used for a different function (listen) was to create a simple dynamic library where you redefine functions of interest (e.g. unlink or fopen). Compile, link it with -fPIC to ...
user avatar
  • 1,085
2 votes

Blocking and unblocking internet access of a running process

The answer is "it depends". Does the application access a known set of remote services or use a specific (unique) set of ports? In either case, you can create rules that block only access ...
user avatar
  • 26k
1 vote

In linux, cannot kill sleep processes (trash.so or dolphin). what to do?

From what I see there process are defunct, not sleep. AFAIK there is tool to "kill" defunct (zombie) processes in Solaris. But I am not sure there is such tool in Linux. If you reboot the ...
user avatar
  • 13.9k
1 vote

Blocking and unblocking internet access of a running process

You can do that using cgroup2 and iptables. Let's say you want to block all network access (including loopback) to the firefox process. # CGROUP_MOUNT_POINT=/sys/fs/cgroup create cgroup # mkdir $...
user avatar
  • 261

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