Questions tagged [process-management]

Use this tag when the topic is about system process management. Commands used for this are like ps and kill -9 xxxx and service xyz start|stop|restart and htop, for example. Often used in conjunction with memory management.

Filter by
Sorted by
Tagged with
2 votes
1 answer
62 views

Is it possible to adjust number of sub-jobs for GNU parallel after invocation?

If I have already started a job with GNU parallel in a similar fashion to: $ cat jobs | parallel -j 70 "program {};" is it possible, by e.g. some signal, to adjust the number of jobs of this ...
4 votes
2 answers
6k views

How to run groups of commands in parallel?

I am trying to run groups of commands in parallel. There are 10 groups and each group has 3 commands. I want sequential execution within each group and parallel execution of the 10 groups. I am trying ...
4 votes
1 answer
2k views

Move application explicitly to swap

Is it possible in Linux/Unix systems, to move a process explicitly to the memory swap? I've investigated swap* tools and kill but they can't do anything I want. Example: Process FOO is currently ...
0 votes
2 answers
1k views

Is there the possibility to set a parent process when creating a new process?

I'd like to set the parent of a newly started process, is that possible? Example, let us assume that we start a new desktop environment session via a login manager, so our process tree would look ...
1 vote
1 answer
11k views

How to find difference between two epoch time stamps? [duplicate]

I am writing a script to kill a job which runs more than 30 minutes. My epoch time format is like 1503935475067 and I am using current_time_stamp=`date +%s%3N` How to find difference between two ...
1 vote
0 answers
1k views

Kill running process

I own some old processes on a shared compute server. They consume a lot of CPU and according to htop they're in the running-state: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ ...
2 votes
0 answers
393 views

Strange behaviour of "ps aux" in the CPU time column

I am periodically running "ps aux" that outputs values in a following format: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND If I understand TIME is a cumulative CPU time, ...
0 votes
1 answer
177 views

List of processes allowed to run

Is there a program in Linux to control which processes are allowed to run with some kind of control list? So that, when you will try to run a process that is not in the list you will be notified ...
2 votes
0 answers
109 views

Time between process runs is occasionally too long, how can I set a maximum time? [closed]

I am using a raspberry pi to grab data through a SPI port. Attached to the SPI port is a PIC, programmed so that it samples on an A/D at 12.8kHz, and stores the samples in a 256 long buffer. (to cope ...
3 votes
1 answer
1k views

Prevent gnome-pty-helper from running again

I terminated the gnome-pty-helper process with $ kill -9 9753 After a while it was running again with another process number. There wasn't a restart of a system. Why is it located under ~/.config/...
2 votes
1 answer
573 views

How to capture a command process

As we know, the lsof can know which file/directory is take up by process. But I want to capture a command process to judge which file/directory the command will call. For example,the useradd will ...
5 votes
3 answers
7k views

How to find and print arguments of a command in ps?

sudo ps o gpid,comm reports something like 3029 bash but the command has parameters --arbitrary -other -searchword is there a way to display these arguments?
1 vote
6 answers
2k views

How can I run a program from bash ignoring its stdout so i can run more programs? [closed]

I'm trying to do is create a new process, from within bash, like nothing ever happened, except my terminal is on the next line, where that process would normally steal my stdout... Let's say I want ...
4 votes
1 answer
19k views

How to force a PID to terminate? [duplicate]

Yes, I've tried all the basic kill, pkill, etc. methods that come up with a Google search. Sometimes it works, other times it seems something is preventing the process from terminating. There is no ...
2 votes
3 answers
20k views

What is background and Foreground processes in Jobs

I'm studying Redhat Linux 7, topic Monitoring and managing Linux processes in it I understand Processess and its command. But I do not understand "Controlling Jobs" and Running jobs in the background ...
8 votes
1 answer
43k views

How to kill all processes owned by `user` on Centos 7? [duplicate]

I read in an online flash card that the command is: pkill -u bob $(pgrep -u bob) However, I think this is wrong. I think it's saying: Kill all the processed owned by bob, and 4572\n4600 Because: ...
26 votes
2 answers
31k views

Is SIGQUIT the same as SIGTERM?

I'm learning CentOS/RHEL and currently doing some stuff about process management. The RHCSA book I'm reading describes running kill 1234 as sending SIGQUIT. I always thought the kill command without ...
9 votes
1 answer
8k views

Why can't we kill uninterruptible D state process?

I have often issues with processes stuck in D state, due to NFS shares behind firewalls. If I lose connections, processes get stuck in D state and I can't kill them. The only solution becomes hard ...
12 votes
3 answers
13k views

Why do top and ps show different PIDs for the same processes?

When I run top -H, I see that my multiple mysql threads all have the same PID. However, in ps -eLf I see each one has a different PID: ps -eLf UID PID PPID LWP C NLWP STIME TTY ...
4 votes
1 answer
13k views

What is a limit for number of threads?

I was wondering how many processes can I create on my machine (x64 with 8Gb of RAM and running Ubuntu). So I made simple master process which was continiously creating child processes, and that child ...
4 votes
1 answer
533 views

Why is CPU usage/time not showing in process information?

When I invoke top, the %CPU and TIME+ columns appear to be frozen and never update. Instead, the first few lines of the process list always look like this: PID USER PR NI VIRT RES ...
0 votes
2 answers
71 views

How can i automatically handle hogging process before system freeze?

First of all hello, and thank you for taking the time to read my question. Update: What my desired outcome with this question is to know the best way to handle a browser process using up all the ...
1 vote
1 answer
2k views

How do I start 3 processes on the same terminal, and then exit all 3 easily?

I can easily start 3 processes on 3 different terminals, and kill each one by pressing Ctrl+C. Now, is there any way to start all 3 processes at once, and then finish them equally easily? Ideas: If I ...
1 vote
1 answer
682 views

Prevent starting processes automatically

How can I prevent starting processes automatically. (e.g. I used mysql database about a year ago). I killed the mysqld processs and now I see it's running again. And many other processes I don't know ...
4 votes
4 answers
6k views

Killing all the process of a command except first process

I am sometimes stuck in a situation where a script/command kept in Cron runs more than once because of some reasons (the first instance is not completed fully, the second instance of the same process ...
0 votes
1 answer
622 views

Custom "garbage collector" to manually close a program

I'm running Ubuntu 16.04 I have this process X running from multiple tty. I run it from other pseudo terminals using the screen command and it also runs from crontab. This program is launched from a ...
0 votes
1 answer
228 views

Killing some processes also kills others that I do not want to kill

I am goofing around in Metasploitable and trying some commands. Whenever I kill a process using fuser -k 23/tcp to close the port, I get other processes also killed by the process and their ports ...
1 vote
2 answers
2k views

Stop bash command without killing script

So I have the following command running from the shell ~/for ip in $(cat ip_list);do mkdir $ip; cd $ip; for vuln in $(snmap http);do nmap --script=$vuln $ip -oN $vuln;done cd ../ ; done and it's ...
8 votes
3 answers
16k views

How can I check to see if a process is stopped from the command-line?

I have the pid and I just stopped a program using kill -stop PID Now I want to continue it by doing kill -cont PID But only if it's already stopped. How would I check to see if it's stopped or ...
4 votes
3 answers
6k views

Intelligently switch between multiple BASH processes

Say you're in a directory and you want to check something in another directory, so you type bash to spawn a new shell so you can cd and check that thing and then type exit to get out and go back to ...
7 votes
1 answer
4k views

How to find out what is using swap on FreeBSD?

I'm trying to pinpoint what process(es) is eating swap on my FreeBSD server. I can only see how much is being used (top) but not what process is swapping its guts out. I tried searching Google for ...
0 votes
1 answer
3k views

How to Check a Process is Running on Another Server

How do I go about checking that a certain process is running in another box and return a value? For example, if I wanted to check that process 'FTP' is running in 192.168.1.1 from box 192.168.1.2, how ...
8 votes
3 answers
602 views

Command with which a process was run

Suppose I ran the process with the following command: myapp -e -c -f myapp.config > /var/log/myapp/myapp.log 2>&1 After a while I only have pid of myapp process, e.g. 1234. Is there a way ...
0 votes
1 answer
1k views

Process name 'masked' by /usr/bin/python and /bin/su

I'm trying to use the pidof command to see my script is already running as I only want this executable if the script is not already running, however, it seems the pidof command is not returning the ...
8 votes
2 answers
11k views

How does systemd handle the death of a child of a managed process?

How does systemd handle the death of the children of managed processes? Suppose that systemd launches the daemon foo, which then launches three other daemons: bar1, bar2, and bar3. Will systemd do ...
0 votes
1 answer
973 views

Edit file with vim using Dialog

I am trying to build a terminal based GUI for a tool. The following code invokes something like this while true do CHOICE=$(dialog --keep-window --clear --no-shadow \ --backtitle "...
0 votes
1 answer
2k views

How do I run a process and send it a SIGNAL while its running?

I need to run a program xyz. It finishes execution in a few seconds. It has some signal handling I need to test. From the shell or a bash script how do I execute the program and while it is executing ...
0 votes
1 answer
303 views

How we will conclude there is memory leaks in a process without any support from memory leak detection tools like valgrind?

If RSS value of process(obtained from top or ps command) increases rapidly can it treated as memory leaks. Assume there is less provision to modify the code and no adequate support to install new ...
4 votes
1 answer
248 views

When process groups are usually created?

I have a program that spawns many instances of other programs. I want to have a clean way to kill them after timeout, even if they spawn subprocesses, sometimes accidentally daemonize, etc. Right now ...
2 votes
1 answer
539 views

Get pid of long running command executed via at

I would like to spawn a persistent netcat server. My command of choice is the following: echo "bash -c \"while [ 1 ]; do nc -l -p 1111 >> check; done\"" | at now I am wondering how I can get ...
3 votes
1 answer
2k views

How can I manage jobs after I disconnect from my tty/ssh session?

If I ssh to a box and start a task that will take some time to complete I usually press control+z to pause the process, and then immediately type bg 1 to put run it in the background. I can then type ...
2 votes
1 answer
544 views

What's the best strategy to catch mystery process?

I have running processes on my server that get killed every night at midnight. It's at work, I'm not around when it happens and I don't have remote access. The kill occurs very predicably at 23:59 ...
11 votes
3 answers
8k views

What happens to suspended jobs in unix?

We can issue CTRL+Z to suspend any jobs in Unix and then later on bring them back to life using fg or bg. I want to understand what happens to those jobs that are suspended like this ? Are they ...
6 votes
4 answers
2k views

Best practices for job/process tracking and multi-tasking

I run 10+ different commands from 10+ different directories, and I need a better process to track everything. I do a lot of debugging, and often times I need to work on multiple issues in parallel. I ...
18 votes
3 answers
11k views

Simulate an unkillable process in D state

For catastrophe testing scenarios on out server environment we're looking for an easy way to make a process stuck in D (uninterruptible sleep) state. Any easy ways? An example C sample code would be ...
2 votes
1 answer
196 views

Is there a way to suspend an process belongs to shell A and foreground it in shell B?

I knew how to suspend one process and bring it into foreground in current shell, but I have no idea about that If I have run a process in shell A and now I want to bring it into foreground in current ...
-2 votes
5 answers
14k views

How to find PID of an ongoing job in UNIX?

I executed a shell script which will call some internal applications and will take few hours. Due to some problems, I have to stop or kill that job. For this, first of all, I ran ps -u $uname to list ...
2 votes
2 answers
4k views

Live monitoring of background jobs

I executed a command like this: nohup some_command &. Now this command is in the background. I can see it with the command jobs. Example output: [1]+ Running nohup some_command &...
4 votes
1 answer
2k views

SCHED_FIFO and SCHED_OTHER

I was trying to change linux process priority using chrt. I changed priority of one process to SCHED_FIFO from SCHED_OTHER. I could see some improvement in the perfomance. I run linux angstrom ...
1 vote
1 answer
82 views

See which file using postfix

I have a - what I think Malware - problem on my site. Using my server to send spam mail. When running top and SHIFT+M I get the following: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ ...

1
4
5
6 7 8