Questions tagged [process]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

Killing all python scripts except grep process and a specific python script

How can I run command in bash to kill all python scripts except script called test.py and the grep's pid itself, in case we are using something like ps -ef |grep I think I can use something like ...
0
votes
3answers
38 views

How to get the pid of a process that is run through ssh

Lets say I have two servers, server1 & server2 In server 1, i do ssh root@server2 "some_command" How do I find the pid of this some_command from server1?
0
votes
1answer
25 views

why crtl-C or ctrl-Z is not working in this program?

during this process is running i am trying to stop it by Ctrl+C or Ctrl+Z but any of this is not working. #include <stdio.h> void main(void) { process(); } void process(void) { ...
87
votes
5answers
52k views

If processes inherit the parent's environment, why do we need export?

I read here that the purpose of export in a shell is to make the variable available to sub-processes started from the shell. However, I have also read here and here that "Processes inherit their ...
0
votes
1answer
14 views

Can't Use “stop” Command with Bash Script Running Python Script

I have a bash script that calls a Python script that I want running continuously in the background. I can start the bash script, and the Python script runs, but I can't stop it using the "stop&...
0
votes
3answers
357 views

Get process information (the command, etc) from pid

I have this code: for job in `jobs -p`; do code=0; wait ${job} || code=$? if [[ "${code}" != "0" ]]; then echo "At least one job failed with exit code =>...
0
votes
1answer
1k views

How to create a process in Linux?

I am a research student working on an experiment involving Linux, and for it I need to create processes. I know how to create them with the fork() system call, but I was wondering if there was an ...
0
votes
0answers
28 views

docker service + service is down but not know the reason

we have docker service installed on all or rhel 7.5 machines ( 5 machines ) from some unclear reason we see that docker service is stooped on all machines ( machine are up last 1 year ) this is ...
3
votes
2answers
1k views

API Monitoring and Hooking

I am currently reading the "Malware Analyst's Cookbook and DVD". There is a chapter "Dynamic Analysis" and there are also some recipes about hooking and monitoring API calls of process but it is for ...
0
votes
0answers
32 views

CPU utilization = 101? [duplicate]

I don't understand how can the CPU utilization of my Linux system be 101 for a process on Linux system. What does the %CPU actually indicate if it is not percentage utilization? USER PID %CPU %...
13
votes
4answers
4k views

How does Linux retain control of the CPU on a single-core machine?

In How does Linux “kill” a process? it is explained that Linux kills a process by returning its memory to the pool. On a single-core machine, how does it actually do this? It must require CPU time to ...
0
votes
1answer
24 views

Whether my process is hung or running

I am running a heavy process on a Linux Machine with GPU. nvidia-smi shows 15GB/16GB used up. CPU utilization is around 70% and MEM around 98.5% but the tqdm progress bar of my process is not being ...
1
vote
1answer
16 views

Demanding processes lock up the entire system

I write programs on a daily basis. However, whenever I try to do something a bit too demanding (e.g. multithreaded compilations) the system can lock up from too much CPU usage, I assume. Even when I'm ...
1
vote
1answer
55 views

FIFO number of processes, sustained growth

I have a FIFO question: Why the fifo thread_num limit 2, but number of processes, sustained growth when one process ends, two processes start, and then got 3 processes. sustained growth 2n-1 #!bin/...
1
vote
1answer
31 views

Keep reverse SSH tunnel opened via java application when the app is stopped

As discussed in the following StackOverflow question I am creating a Java program that starts a reverse SSH tunnel. I have created a script /root/reverse.sh that starts a subshell and creates a ...
0
votes
1answer
14 views

Two processes mapped in the same address space

I have noticed that when I open two processes with GDB for debugging, /proc/PID/maps indicate the same address regions for the two : cat /proc/4170/maps 555555554000-555555555000 r--p 00000000 08:01 ...
1
vote
0answers
25 views

Which process generated specific DNS query?

Context: I have a few Mac OS laptops, Catalina 10.15. I noticed suspicious DNS requests in our firewall logs (capable of showing DNS queries), and traced the source IPs to these Mac Books. I checked ...
0
votes
1answer
1k views

Unix - ps to check if script running

I'm running a script which is meant to process a few utilities in order to recover some data. This script is situated in a directory where the users can place their file that needs to be recovered. ...
0
votes
0answers
21 views

Why do CTRL+Z doesn't works after issuing bg command?

I suspend a NodeJS instance by issuing CTRL+Z then bring it back by issuing bg command but after that I can't issue CTRL+Z as it has no effect. What causes this?
12
votes
2answers
35k views

Understanding the differences between pid_max, ulimit -u and thread_max

I am trying to understand the Linux processes. I'm confused on the respective terms pid_max, ulimit -u and thread_max. What exactly is the difference between these terms? Can someone clarify the ...
0
votes
0answers
23 views

Make API requests recursively without large number of processes running

I have the following Script File 'bored.sh'. This file recursively calls itself. curl "https://www.boredapi.com/api/activity" >>./bored.json sleep 1s bash ./bored.sh I realized that ...
0
votes
1answer
18 views

Get UTC process start time in Linux

This ps command gives timezone-specific time: $ date Mon Mar 22 19:17:54 MSK 2021 $ ps -eo pid,cmd,lstart PID CMD STARTED 1 /init ...
1
vote
1answer
19 views

Extracting value of nc_pid variable residing inside function

I want to update nc_pid so I can use it to check if process with pid nc_pid is running. #!/usr/bin/bash function start () { trap 'echo "Clean up and exit"; kill $nc_pid; exit' TERM ...
4
votes
2answers
7k views

How to hide a specific process?

The command hidepid is used to prevent users from seeing all processes that do not belong to them, but it doesn't offer the possibility of selecting a specific process. Is it possible to hide only one ...
94
votes
5answers
30k views

What process created this X11 window?

Given an X11 window ID, is there a way to find the ID of the process that created it? Of course this isn't always possible, for example if the window came over a TCP connection. For that case I'd ...
0
votes
1answer
24 views

Terminate X11 Application with Mouse

There is a feature in X11 that temporarily transforms your mouse pointer into a "kill X11 application" icon (I don't even know what to call it) and allows you to forcibly terminate a process ...
0
votes
0answers
135 views

Wordpress site has been hit with gutenblock-64/stealth process

The process has been taking up a lot of resources and has been sending DDos(?) to other sites. It ran under as www-data. What it does : it downloaded under wordpress's wp-content folder and run ...
13
votes
4answers
12k views

What's the easiest way to detect what signals are being sent to a process?

I'm trying to debug an issue with my shell (specifically, fish) sending signals to my background processes. I'd like to be able to recognize what signals a process is receiving. Ideally, I'd like ...
249
votes
11answers
682k views

How to terminate a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to terminate its process, then re-run the command. How can I terminate it? I haven't closed ...
-1
votes
2answers
44 views

bash + how to perfrom ssh test as proccess

in my bash script , I used the following syntax in order to test the ssh connection test IP=12.3.4.55 sshpass -p secret123 /usr/bin/ssh -n -o ConnectTimeout=100 -o StrictHostKeyChecking=no -xaq -q ...
24
votes
5answers
59k views

What is the difference between ps and top command?

What is the difference between ps and top command ? I see that both can display information about running processes . Which one should be used when ?
0
votes
0answers
16 views

listener to read incoming mail to Sendmail Linux and run some processes based on the email content

I will setup Sendmail or Postfix on Linux to receive emails from a certain user through my company's mail server. I need to create a listener that grabs incoming mail and based on the subject run a ...
1
vote
1answer
25 views

Does command line arguments and File I/O operation consume CPU Time potentially?

According to the definition of the CPU Time: CPU time (or CPU Execution time) is the time between the start and the end of execution of a given program. This time accounts for the time CPU is ...
0
votes
1answer
6 views

tools to start many background processes and close cleanly on sigint

I have an ad-hoc case where I as a user want to start a handful of service processes and also be able to interrupt them all together for clean and easy start-stops. The behavior of "docker-...
1
vote
1answer
1k views

How to check latest restart processes in unix?

I am checking processes by "p" command and output is like below. UID PID PPID C STIME TTY TIME CMD myapp 10235 20365 99 Feb15 ? 11-...
123
votes
5answers
178k views

How do I attach a terminal to a detached process?

I have detached a process from my terminal, like this: $ process & That terminal is now long closed, but process is still running, and I want to send some commands to that process's stdin. Is ...
4
votes
1answer
2k views

Why does running sudo cp show two processes

I am trying to copy some files and folders on a CentOS machine. I do it like so: sudo cp source destination & to run it in the background. I see there are three cp processes now when I run ps aux ...
0
votes
2answers
86 views

how to create a pipe forks two processes

could anyone help me in understanding what does this question requires? and the steps to do it? "Write a simple program that creates a pipe forks two processes and then sends data through the ...
0
votes
0answers
9 views

How can I detect if a node process running in a detached screen session crashed and restart it?

I am running a http node server inside a screen session which occasionally crashes. I want to write a bash script that can detect if a server inside the screen session crashed and if yes, restart it. ...
30
votes
6answers
11k views

How to renice all threads (and children) of one process on Linux?

Linux does not (yet) follow the POSIX.1 standard which says that a renice on a process affects "all system scope threads in the process", because according to the pthreads(7) doc "threads do not share ...
0
votes
2answers
55 views

How do I automatically close the process left behind by a misbehaving application after it exits?

There are applications that do not exit cleanly leaving behind their process. One example I've found is Foxit Reader. Of course, the ideal would be to report a bug and have the application fixed, but ...
23
votes
4answers
11k views

Are Linux kernel threads really kernel processes?

I've read in many places that Linux creates a kernel thread for each user thread in a Java VM. (I see the term "kernel thread" used in two different ways: a thread created to do core OS work and a ...
2
votes
2answers
2k views

List running processes without procfs

I'd like to list running process (like using ps or top), but there is no procfs mounted. The procfs not being mounted is intentional, and is made to prevent malicious user to access systems ...
5
votes
4answers
26k views

Find and kill the process that is using a serial port

I have multiple serial ports to each of which devices are connected. They are listed as /dev/ttyUSB*. Now, I need to make sure using a python script that no other process is using any of these before ...
1
vote
3answers
58 views

How to assign process to work on partial CPU's? [duplicate]

We want to run our applications ( process ) only on the first 6 CPUs. We have a RHEL machine. We have physical DELL machine with total 12 cores (from lscpu) Is it possible to assign the process to ...
0
votes
2answers
22 views

Process with dynamic id won't kill; has no parent

I am trying to kill process like this: root@xxx:~# ps -ef | grep mosquitto root 3083 1912 0 11:59 pts/0 00:00:00 grep --color=auto mosquitto root@xxx:~# kill 3083 -bash: kill: (3083) - ...
1
vote
0answers
13 views

Load a core dump continue running

I can create a coredump as a snapshot of a process's image and continue running. Can I then, on another run of the program load the coredump and continue at that same point in time? If so how? ...
88
votes
3answers
42k views

What are “session leaders” in `ps`?

What are session leaders, as in ps -d which selects all processes except session leaders?
1
vote
2answers
30 views

Restart a process if a message is detected on stdout

Is there a way of monitoring a process (like for example with supervisord), and then restarting the process if the stdout outputs a specific line of text? In my case the line to check for would be: ...
0
votes
1answer
17 views

Give user permission to change priority of an IRQ/root process

Is it possible, in Linux, to allow an user to change the priority of a process owned by root? More specifically an IRQ process? For an embedded real-time application I want to raise the priority of ...

1
2 3 4 5
48