Questions tagged [process]
A process is an instance of a computer program that is being executed.
2,681 questions
3
votes
2
answers
92
views
What would be the most reliable way to obtain PID, remote address and port combinations for all connections?
I tried tcp_connect, udp_sendmsg kprobes together on an eBPF program and it worked, but it missed a lot of connections. I couldn't really get any reliable results with other kprobes as well so I tried ...
-4
votes
2
answers
303
views
Linux kill command returns "No such process"
In the below shell script I have list of process IDs which need to be killed. When killing a process I am getting kill: 1234567: no such process error even after checking if the process id existence ...
0
votes
1
answer
131
views
Getting PID from PHP shell_exec to kill server process later
I'm running a server on Linux, and I need the specific PID so I can kill it later. I'm using PHP with shell_exec to run the server, but how do I get the specific PID of this server?
while($...
0
votes
2
answers
123
views
Killing a process PID starts a new process instead
I have a running process on localhost on port 5000. I have tried kill - 9 <PID> which it works for that PID but it starts a new process with a new PID instead. What's the issue here?
I'll put ...
1
vote
0
answers
30
views
Process Maps in s390x linux systems
So I am working on a debugger for linux s390x system and have the whole disassembler etc set up for reading the ELF file. For debugger I just run it on the process with base address from the process ...
0
votes
1
answer
161
views
In one process, any way to know whether there exists any other same program is running? [duplicate]
So I am designing a feature to redirect log file if there are multiple processes of this very program are running.
I guess this requires me to somehow get to know whether there exists yet unfinished ...
4
votes
0
answers
123
views
Recovering text of Unsaved document from process memory? (frozen Xed window - process still "running" but in Sleeping status)
The window of my text editor Xed froze with Unsaved documents just as I was doing 'File'->'Save as...' to save them... [How ironic.]
Since the process still exists, I am trying to recover the text ...
0
votes
1
answer
90
views
Is there any advantage to changing process priorities using a kernel module instead of nice / chrt?
I'm working on a project where I want to study the impact of process priority on system behavior.
I know that tools like nice, renice, and chrt can change the priority or scheduling policy (e.g., ...
0
votes
2
answers
123
views
how do I prevent script continuation when the process run queue is full?
Environment: shell is BusyBox bash 3.2 running in what started-out as Ubuntu Server many years ago, but has since been tweaked a great deal by the manufacturer of this particular box to become a ...
7
votes
2
answers
414
views
How can I find location of PRI in /proc
I have sshd with PID of 1957:
mohsen@debian:~$ ps ax -o pid,nice,pri,cmd |grep 1957
1957 -2 21 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
According to above, my nice number is -2 ...
2
votes
1
answer
171
views
Mapping two users to host with user namespaces
I'm trying to understand whether it's possible to map two users from a user namespace to two different users on the host.
The goal is to replicate the same permissions I have on my host inside a ...
0
votes
0
answers
62
views
Why does there appear to be a discrepancy when trying to programmatically access files associated with different tasks in Linux from kernel space?
As a way to better understand Linux kernel structures, interacting with and pulling information from these (and also getting more experience coding in C), I've been building simple kernel modules to ...
0
votes
1
answer
102
views
Can you use `inotify` with `/sys/fs/cgroup/pids.peak`?
I am trying to implement a program that would run as PID1 in a Podman container and would wait for the the user to podman exec into the container at least once before exiting. /sys/fs/cgroup/pids.peak ...
2
votes
1
answer
927
views
What do programs use to read their environment?
I'm on Fedora, where all preinstalled shells apparently support bashisms: bash --posix does, and even sh. Still, when I used this function,
pathprepend () {
if [[ ":$PATH:" != *":$1:...
0
votes
1
answer
75
views
How long has a process been idle since it last ran?
I am interested in finding out the last time a process was scheduled to run. That is, how long it has been sleeping, since it last ran. When was it last active? Basically, a generalization of what the ...
1
vote
1
answer
70
views
Why read process doesn't show up in ps -ef
I open two terminal windows. In one, I run:
$ read foo
I don't press RETURN, so read is blocking. In the other terminal window, I search for the process:
$ ps -ef | grep foo
user 95292 94814 ...
0
votes
1
answer
169
views
Writable and executable memory regions
I wrote a simple Python script to scan /proc/{pid}/maps for regions that are writable and executable on my computer. It came up with a few hits surprisingly, all private anonymous. Wondering why a ...
1
vote
1
answer
312
views
What exactly does %wait in pidstat mean?
Environment
Ubuntu22.04
sysstat version 12.2.0
Number of logical CPUs 16
man pidstat shows the following, but I would like to know more specifically about the denominator and numerator of %wait.
...
12
votes
2
answers
1k
views
How to automatically terminate shell scripts after 1 minute of no output
I need to run multiple shell scripts sequentially (s1.sh, s2.sh, s3.sh) with the following requirement:
If a script produces no output (stdout or stderr) for 1 minute, it should be terminated
After ...
1
vote
1
answer
85
views
Hit a strange signal settings of a kernel thread in Linux
I am working on an embedded Linux system (kernel-5.10.24), and using busybox as init.
Now I hit a strange problem about signal settings of a kernel thread in system.
The kernel thread is from a device ...
0
votes
1
answer
189
views
Understanding the concepts of commands, processes and namespaces
I am not a strong linux user, but I want to better understand the material in this post here which talks about linux namespaces
https://stackoverflow.com/questions/44666700/unshare-pid-bin-bash-fork-...
0
votes
0
answers
97
views
Linux Server swap memory problem
I have the same problem on all servers running Java processes.
I have lots of available memory. But my swap is full of Java-related pages.
But the system never cleans its swap, Java pages stay there &...
2
votes
0
answers
115
views
Why do I have 2 bash processes when I openede only one terminal session?
I am using windows WSL2, and opened just one terminal session. I used the command ps and ps a. From what I know, the bash with PID 559 is the shell I am interacting with. The question is, why do I ...
0
votes
1
answer
64
views
Are reads of /proc/pid/environ atomic in Linux 6.x (e.g: 6.1.99)?
When a process execs, looking at kernel code for environ_read(), it seems that if the mm_struct doesn't yet exist / is null or the env_end member of that mm_struct is null, environ_read() will return ...
1
vote
1
answer
86
views
cron jobs to inherit cron daemons environment variable
Let's say, we export an environment variable from the shell,
export A=thisisa
and from the same shell, we start the cron daemon, the shell would then pass the environment variable A to its sub ...
1
vote
0
answers
87
views
Processes launched from "su -" are not closed when killing terminal
I have a question regarding the processes launched via a SSH session, after having performed a su - user. My question applies to RHEL 8, but might as well to other O/S. The SSH connection is initiated ...
1
vote
1
answer
109
views
Swap out a stopped process' memory to swap file
I want to move the resident/virtual data of a SIGSTOPped process out of main memory and into any suitable swap. With the ability to revert the procedure before SIGCONTinuing the process.
The system ...
1
vote
1
answer
144
views
/proc/pid exists but does pid not found in ps
I am seeing a very odd behavior.
/proc/1154/cmdline exists, and kill -0 1154 succeeds,
but ps -ef | grep 1154 and ls /proc | grep 1154 do not show anything.
1154 was a postgres process in the middle ...
5
votes
2
answers
1k
views
Why does exception in interrupt always lead to Kernel Panic?
If a CPU exception in kernel, such as bad memory access or invalid opcode, happens in the context of servicing a user process (like syscall or page-in), or in a kthread process, then, until ...
0
votes
2
answers
155
views
How to remove a background process whose pid was hidden
According to this answer to How to Hide PID and Exit Status When Running a Background Command in Terminal, using (some command &) one can stop the PID of the background process from appearing in a ...
1
vote
0
answers
40
views
Retrieving the process descriptor during syscall
In Linux, there is a per-process kernel stack that stores at the bottom of it (or top if the stack grows upwards) a small struct named thread_info, which in turn points to the task_struct of the ...
0
votes
1
answer
153
views
why nr_involuntary_switches of a process runs on an isolated cpu is constantly increasing?
I have a server (linux 4.18+intel xeon) which has isolated cpus for latency-sensitive service.
I noticed that the service process's nr_involuntary_switches is gradually increasing every a few seconds ...
0
votes
0
answers
96
views
dbus shows a registered service provided by a PID that doesn't exist?
Consider this:
> dbus-send --session --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.GetConnectionUnixProcessID string:org.gnome.keyring
method return time=1724158870.854936 sender=...
1
vote
1
answer
253
views
A few potential race conditions with signals and PIDs
I'm aware that because of PID-reuse on Unix-like kernels, signals can be delivered to the wrong process if they are sent after the PID has already been reaped.
Discussion of what follows will probably ...
3
votes
2
answers
573
views
Get GNU tar PID inside of --to-command
We have this GNU tar command as shown:
$ tar -xjf /dev/st0 --to-command='sh -c '\''printf "%s\n" "$TAR_SIZE $TAR_REALNAME" >> "$TAR_ARCHIVE.sizes.txt"'\'
Is there ...
0
votes
1
answer
106
views
How to get PID of running sh script if I run process in background there?
I wish to ping my router in background process. Also I want to control ping process as a service: start, status, stop. So, I create lock file and store PID in it. But actually PID is changing, and I ...
0
votes
1
answer
574
views
How can I make bluetoothctl quit running?
I have been experimenting with bluetoothctl and blueman. I have closed the window of blueman. I have also typed quit in bluetoothctl's command line interface. I have also run systemctl stop bluetooth. ...
0
votes
1
answer
263
views
After using the timeout command in the container of the alpine image, a dead process will be left
I ran a container using the alpine image and used timeout to run a command in it. After the timeout command ran, there is a dead process left in alpine, and I cannot kill it using the kill command. My ...
0
votes
0
answers
99
views
How to limit ram usage of a process in Linux?
Consider a Linux process that is currently running. We want to limit the amount of RAM used by this process so that it does not interfere with the operation of the system. What tools or commands can ...
0
votes
2
answers
96
views
What other channels besides /proc are there to obtain process information?
We know that process information can be obtained from the /proc directory, such as being able to see the PID of all processes, etc.
And many user commands, such as top, ps, and so on, essentially ...
0
votes
1
answer
72
views
Limiting a process to only allowed to use specified network interface
I have binary program named wstunnel.
That program has no option to specify outgoing traffic. By default it will use ens3. I expect the program will use warp interface.
I'm not sure iptables can solve ...
0
votes
1
answer
83
views
Is there a way to find out which process is writing to a file on a server with restricted permissions?
Let's say I have a file named "app.log" and I want to find out which process is writing the log, but I have restricted permissions, I have tried the following:
lsof /path/to/file, which I ...
0
votes
1
answer
214
views
FUSE filesystems look at saved UID/GID?
While attempting to create a program that reads some configuration before launching programs as a normal user and then as the root user, I noticed this odd behavior. I can't seem to find mention of it ...
0
votes
1
answer
180
views
process ID of process launched with system command
Suppose I open a shell on ubuntu OS, then open a software such as matlab via
matlab &
In the matlab GUI, I do a system command
system('/path/to/my/cppprog') % <-- PID of this running program?
...
1
vote
0
answers
56
views
Send Input to Interactive Process via File Descriptor
How can I find the file descriptor that a process reads input from?
Background
I run a Vite (pronounced veet) server when developing in an Alpine container. Currently I login to the container and ...
-3
votes
1
answer
153
views
why don't we create processes from scratch and make it a "fork", in linux? [duplicate]
why in Linux do we not create a process from scratch, as "init" is created, but create a "fork" of it by the method of branching?
0
votes
0
answers
78
views
What killed my process? No relevant entries seen via dmesg or journalctl on Rocky Linux 9.2 (Blue Onyx)
A program from a vendor gets killed instantly. I need to know why. Log shows nothing relevant. Any advice? I looked into OOM killer etc. Added tons of swap. Did not specify log in journalctl so I ...
1
vote
0
answers
175
views
mysqld thread count exceeds max_connections
As the question title suggests: I have set max_connections = 2 in my my.cnf file, but when I activate my mysql daemon, the thread count sits at 37. I am searching online but cannot find indication my ...
1
vote
1
answer
97
views
Run Additional Commands on a Specific PID
I'm completely new with Linux so forgive me if this seems like an absurd question.
I am trying to open new tabs on Firefox without a url from the terminal. So my command is:
$ firefox -new-tab -search ...
1
vote
1
answer
873
views
Capturing output from a bash function without using a subshell [closed]
I have a bash script listening on a pipe for commands. When it sees a command it runs it. However, I would like it to support the "sideloading" of bash functions that can be called at a ...