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
1answer
748 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
2answers
218 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 ...
0
votes
1answer
3k 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
0answers
834 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+ ...
4
votes
2answers
2k 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 ...
2
votes
0answers
142 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
1answer
361 views

How do I kill all instances of /opt/php56/bin/php-cgi if number of running processes exceeds 20?

I need this because my shared hosting plan has a process limit of 25. Whenever there is above 25 process limit, my site gives an error 500. What I want to do is build a script that would kill all ...
1
vote
2answers
90 views

Doing something when a process finishes

Sometimes when I wanted to do something like: long_running_command; second_command I forget the ; second_command part. If I don't want to interrupt and restart the long_running_command (sometimes it'...
0
votes
1answer
37 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
0answers
67 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 ...
2
votes
1answer
34 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 ...
2
votes
1answer
279 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 ...
1
vote
6answers
261 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 ...
0
votes
1answer
4k 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
2answers
1k views

How can htop be used to suspend a process and all its child processes?

I use recoll to index files and it kicks in a inopportune times. When I use htop to change the view to a tree view using F5 and filter the process list I see a master process running and child ...
4
votes
1answer
23k 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: ...
11
votes
2answers
8k 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 ...
7
votes
1answer
3k 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 ...
6
votes
3answers
5k views

Why is there no easy way to list all processes in a given process group?

Clearly, in order to support kill(0) efficiently, the kernel must keep track of the processes in a process group. But that information is not exposed at all, in any way to the user space. To get that ...
1
vote
1answer
74 views

Kill both commands that run simultaneously in bash

I want to run two commands simultaneously in bash script (one of them is another bash script) and I need both of them to stop when I press Ctrl+C. My bash script now is: #!/bin/bash ./command1 & ...
3
votes
3answers
11k 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 ...
3
votes
1answer
3k 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 ...
1
vote
1answer
812 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 ...
0
votes
2answers
54 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 ...
3
votes
1answer
832 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/...
1
vote
1answer
60 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 ...
0
votes
1answer
360 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
1answer
76 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
2answers
1k 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 ...
23
votes
1answer
8k views

How to ensure exclusive CPU availability for a running process?

At first, the question seems to be a little bit silly/confusing as the OS does the job of managing process execution. However, I want to measure how much some processes are CPU/IO-bound and I feel ...
1
vote
1answer
629 views

How to write a crontab script, that will check a process' status and launch it if not running?

qBittorrent-nox which was running perfectly until last week, but since then it always crashes on my Ubuntu 14.04. Theoretically it's logging, but the log file only conatines these lines: ******** ...
8
votes
3answers
5k 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 ...
0
votes
1answer
996 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 ...
0
votes
1answer
388 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 ...
4
votes
1answer
233 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 ...
6
votes
1answer
3k 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
1answer
459 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 "...
8
votes
3answers
526 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
1answer
466 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 ...
6
votes
2answers
5k 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
1answer
156 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
1answer
90 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 ...
6
votes
4answers
1k views

Is there a utility for daemonizing processes as non-privileged user?

A thing I frequently want to do is launch some long running process or server as my own non-privileged user and then have a way to tell if it's still running and restart it if not. So for example I ...
4
votes
1answer
776 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
0answers
240 views

Processes blocking on shutdown

I'm working on a system running Debian Wheezy with an application that as part of it's normal behavior spawns a few child processes. Under most circumstances when the parent application is killed it ...
12
votes
1answer
886 views

What is a practical example of using the suspend command in Bash?

suspend is a builtin command in Bash. When would you naturally use this command and find it useful?
0
votes
3answers
2k views

How to allocate a process specific amount of CPU power? [duplicate]

I would like to allocate certain number of CPU cores to a specific process for performance improvement. How can I do this?
1
vote
0answers
94 views

Autostart process and respawn only if error

I am trying to start a process_A automatically (on startup) just after another process_B ends (which makes some updates in the system and needs the process_A to be off) and then if process_A crash or ...
3
votes
1answer
4k views

Start Docker container and open web browser on host

I recently faced one non-trivial (for me) case. Maybe you know any way to solve it. I have a shell script that runs Docker command to start the Ubuntu container, which ends up with running guest Bash ...
1
vote
1answer
1k views

How can I run a process in one terminal from another terminal

I have 5 processes running from one terminal (T1). All of them are running in background, but generate a lot of output. Now from other terminal (T2), I want to kill one of them using KILL pid command....