Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [process]

A process is an instance of a computer program that is being executed.

2
votes
1answer
28 views

Why are my desktop applications children of PID1

I'm launching my graphical applications with i3bar. When I look at my system's process tree with pstree,I can see my graphical applications (Firefox, Chromium, Termite etc) are all children of systemd ...
1
vote
1answer
37 views

Splash in PID =1

I have just started learning about process in Linux. I have come around this command called - ps -ef (which will shows all the process running ) I get output like this UID PID PPID LWP ...
0
votes
1answer
25 views

criu: hello-world not working

I wanted to play around with criu, a project for checkpointing/restoring linux processes. For that I am playing around with the hello-world of criu, which is checkpointing and restoring a simple loop. ...
0
votes
0answers
31 views

unshare system call c code linux namespaces

In Ubuntu 16 kernel 4.15 this work in console: root@ubuntu:~# unshare --mount-proc --pid --fork root@ubuntu:~# umount /proc root@ubuntu:~# mount -t proc proc /proc root@ubuntu:~# ls /proc (I see ...
2
votes
1answer
30 views

Why is pidof not working?

In the output of ps aux, I can see the process just fine: # ps aux | grep diff root 7787 28.7 0.0 9368 4516 pts/3 D+ 13:56 20:33 diff -qr mnt/mnt/md/ mnt/mnt2/ root 13130 0.0 0.0 ...
0
votes
0answers
17 views

Perl DNI Script - getfreethread failed: No free PIDs found

I am running a perl DNI scripts on linux machines to SFTP files from my network to outsite Getting following error - Perl DNI Script - getfreethread failed: No free PIDs found
0
votes
0answers
24 views

Total memory vs memory per CPU vs memory per process

I have troubles understanding memory (RAM) specifications of CPUs. Just as an example, the Xeon Gold 6144 specs give a maximal memory size of 768GB. If I have a mainboard with two CPU sockets and 24 ...
3
votes
3answers
78 views

Who runs the interpreter for files that are execute-only?

If the current user only has execute (--x) permissions on a file, under which user does the interpreter (specified by #!/path/to/interpreter at the beginning of the file) run? It couldn't be the ...
0
votes
0answers
30 views

Can two threads in the same process belong to different namespaces?

The task_struct structure has an entry nsproxy which points to namespaces associated with the task_struct. My understanding is that task_struct can be used to represent both process and threads in ...
1
vote
2answers
33 views

How best to start my systemd service to run multiple apps

I have a one-shot service that calls a script in /usr/ Here my .service file: [Unit] Description = Start apps After = network.target [Service] Type=simple ExecStart=/usr/start_apps.sh [Install] ...
0
votes
0answers
27 views

Cmd to check pids used by particular cpu's

In our environment we have applications running in servers with 0-3( total 4 cpu's). While seeing 'top' command and choosing 1 option, able to see 4 cpu's ( example: a server has 4 cpu's). In this ...
0
votes
3answers
51 views

How do we write script to kill PID ( If else loop )? [closed]

I have a file which will contain multiple PID's as show below. #cat /scripts/pid_$DATE.txt 12345 23456 34567 45678 I have to write a script which will read the PID's from above file one by one and ...
0
votes
1answer
76 views

Make process not exit, when exiting from SSH terminal

I just run bitcoind in centOS server. I run the following command nohup ./bitcoind > out & disown Then I exit the SSH terminal, and the process is automatically closed. Is there any way to ...
0
votes
1answer
17 views

How to create a process that runs a script until another process ends

I want to monitor the power that my system needs when i run a Benchmark. When the Benchmark ends the monitoring process should be killed . The monitor script is written in python. How do i do that?
-2
votes
2answers
30 views

Identifying shell script's subshell number from within a script itself

I am accidentally caught in a desire to reveal the subshell number (BASH_SUBSHELL) from within the script itself, but i get subshell 0 Here is the script's line echo "Operated from subshell: $...
0
votes
0answers
13 views

Ignore child cpu when reaping (don't add to /proc/[pid]/stat cutime)

I have a program that runs 24/7 and collects resource information on a system. One of the requirements is to cause as little impact to the system as possible, so there are cpu checks to kill it if it ...
0
votes
1answer
54 views

How can you figure out which program/process is creating a file? [duplicate]

Suppose there's a file that keeps appearing in my home directory automatically even after I delete it. Knowing nothing more about it, is there a way to figure how what keeps putting that file there? ...
0
votes
0answers
24 views

Shell script to execute other script not spawning other scripts

I have a shell script running in a while loop. The script accepts a number as an argument so in ps you would see something like /path/to/script.sh 2. Every 180 seconds, it should be spawning a PHP ...
1
vote
1answer
51 views

How to start and disown a process in a single line?

I noticed that many times I need to start a process and disown it immediately. I trying to achieve this in a single line. Any ideas how to do it?
1
vote
2answers
70 views

apt is always locked in other duties when I want to update my system

Very often when I want to update one of my systems, apt is "locked" by other processes. It can happen more than once the same day. I have to run this command and kill the top process to get apt back,...
1
vote
2answers
117 views

What's inside the kernel part of virtual memory of 64 bit linux processes?

I came upon this question : What's the use of having a kernel part in the virtual memory space of Linux processes? and based on the answer and the comments on the answer : the kernel memory ...
-1
votes
1answer
42 views

How can I list information about a thread/LWP by `ps`?

How can I list information about a thread/LWP by ps? Why can't I do that simply by: $ ps 10173 PID TTY STAT TIME COMMAND $ ps -L 10173 PID LWP TTY STAT TIME COMMAND The best I ...
0
votes
1answer
22 views

logname / who -u / how to get the pid of the current session

The command "logname" gives me the name of the login user irrespective of subsequent "su"-calls. E.g. in current mint, the command "logname" is broken und gives no logname. I want to get its ...
0
votes
0answers
33 views

Knowing what directory a process started in

I'd like to be able to know mid-working what directory a child process started in. Here I'm in a Bash session, I start a dash session and I'd like to know where did dash start (in the example it ...
2
votes
1answer
24 views

How does the kernel assign the nice value to a process after it has been executed?

The Linux kernel implements two separate priority ranges. The first is the nice value, a number from –20 to +19 with a default of 0. Nice values are the standard priority range used in all Unix ...
0
votes
1answer
37 views

Are processes within screen treated differently from foreground processes?

Assume I have a long running process, long_running_proc with a single TCP connection to host host.example.com. Is that process treated differently, by the OS or the shell, when it's run as a ...
1
vote
1answer
35 views

Show all running node.js scripts using bash

To find a python script, I use pgrep -af python. Is there a similar command to find node.js scripts?
0
votes
1answer
79 views

Accessing memory of parent process from child process

Say I login using bash and I define an alias. $ alias c=clear $ echo $0 bash Now I enter dash. $ dash $ echo $0 dash The alias defined in bash isn't available: $ alias $ How do I access it? ...
2
votes
2answers
39 views

Stopped process vs running service?

I stopped httpd processes on a centos 7.6 machine using kill -STOP command and the processes show up as stopped in top output. I tried to telnet the webserver's IP on port 80 and was able to do so ...
2
votes
1answer
48 views

Why is “A stop job is running” a good design choice?

In a typical modern Linux distribution, the user may experience this when trying to shut down the computer: "A stop job is running for Session c2 of user", or equivalent. Now, I understand the idea ...
0
votes
0answers
64 views

How to stop/kill thread in process

I see all of threads according process with ps -T Is there any way to kill/ stop specific thread(not all the process) by thread id/thread name? I prefer with shell script but if it impassable so in ...
3
votes
2answers
94 views

Changing capabilities of run process in Linux

is it possible in Linux to change capabilities of process that is run? Is it possible to change path to the opened files (for example to redirect output). If yes, how to?
0
votes
2answers
87 views

How to run a bash script in the same process as the calling script?

I have a bash script that calls/invokes a sub-script with command-line arguments. How can I force the sub-script to run under the same PID as the caller?
2
votes
2answers
41 views

Start systemd service before stopping it on restart

By default, when systemd is asked to restart service, it stops first process and then starts second, so timeline looks like this: PROCESS A --------[stopped] [started]-------- ...
2
votes
0answers
33 views

How a 95% full /home partition slows down processes?

I experienced a slowdown of some processes on my CentOS box. They did not use too much cpu cycles according to top. The only thing I have seen unusual was that my /home partition was 95% full. Could ...
1
vote
1answer
61 views

Is there any difference to run a process in the background with an & vs when it has --daemonize option?

Some program has --daemonize option to run itself in background, e.g. php-fpm. I was wondering is there any difference between using --daemonize or just use the old & way to run the process in ...
0
votes
2answers
65 views

Monitor process pid for change

I have a service that is always supposed to be running. I’d like to know when the service ever stops or gets restarted. I’ve thought about referencing the service’s PID. If it gets restarted, it ...
3
votes
1answer
76 views

How do the kernel and processes communicate?

In Linux there are various ways for inter process communication, for example, shared memory, (named) pipe, socket, message queue. What are equivalent or similar ways in which Linux kernel and ...
0
votes
1answer
48 views

What is the meaning of the R/D flag in ps output?

What is the meaning of R / D from ps ax? Does it indicate a problem? 3 ? R 522:45 [ksoftirqd/0] 4380 ? Rl 1240:31 gdm-session-worker [pam/gdm-launch-environment] 5938 ? ...
-1
votes
1answer
95 views

Why does the process ID change in the output of “ps -l”?

Whenever I run a command in the terminal on Linux, at runtime, its PID changes. The command I used after running one program two times at runtime, was ps -l. Why does the program change process ID?
0
votes
1answer
33 views

awk + how to capture the third field on both characters

from ps ax we get the following output ps ax PID TTY STAT TIME COMMAND 1 ? Rs 611:56 /usr/lib/systemd/systemd --switched-root --system --deserialize 21 2 ? S ...
-1
votes
1answer
95 views

Two processes with identical PID after a fork call

According to the fork documentation (man 2 fork): The child process is an exact duplicate of the parent process except for the following points: The child has its own unique process ID, and ...
0
votes
0answers
33 views

how to control process that killed

we want to know what are the options to control processes , for example /opt/important_script/gate_machine.pl is a script that must be up and running and in case from some reason script killed , ...
0
votes
1answer
29 views

Bash multiple commands via `-c` parameter weird signal behavior?

bash -c "sleep 5; echo 'test'" If I run the above, and press CTRL-C while in the sleep 5, it terminates the entire process and echo 'test' does NOT get shown. How can I have the above run and allow ...
0
votes
1answer
72 views

Does tmux kill-server shut down running applications gracefully?

Using the tmux command kill-server one can immediately shut down the tmux server and close all open tmux windows. How does this affect the processes still running inside the various tmux windows? Will ...
1
vote
0answers
58 views

High CPU load average; how to find the root cause?

It is hard task to find the root cause of CPU load average many commands are used to give partial picture. I am not sure if somewhere we can find a tool that knows how many CPU's we have on machine ...
0
votes
1answer
58 views

Where does main function get allocated?

When concerned with a memory layout for a process, all function calls within the process get a new stack-frame into the stack. I'm not sure if this is true for main function as it seems like main ...
11
votes
2answers
1k views

Bash script should only kill those instances of another script's that it has launched

In the current situation, a certain script 'calling.sh' launches another script 'called.sh' in the background, performs other operations, sleeps for a while, and then terminates 'called.sh' with a ...
0
votes
0answers
49 views

systemd: process with fork() only shows logs after child exits

I have a program that fork()s and exits. Its child remains running for about 50 seconds, while it prints out messages each 5 seconds. When I run from a terminal it runs as expected, the parent exits, ...
2
votes
1answer
40 views

Red Hat Linux - port is in listening state but could not find process ID

I have this problem for my application, port is in listening state but process ID is not showing up. Used below commands. This is cloud AWS server Red Hat Linux. $ netstat -tulpn tcp 0 ...