Skip to main content

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
5 answers
132 views

Continuously monitor a process and all its children with `top`?

I want to run a process that spawns children, e.g., for i in {1..4}; do sh -c 'echo $$; for j in {1..3}; do sh -c "echo ...\$\$; sleep 1" done' done and I would like to monitor the ...
wobtax's user avatar
  • 318
1 vote
1 answer
38 views

Reliably run, wait for, and kill a tree of processes

I'm looking for a way to run a process, which itself may spawn off more child / grandchild / etc. subprocesses. Then: Be able to send a signal (e.g. TERM or KILL) to all descendants. Be able to ...
Vladimir Panteleev's user avatar
1 vote
1 answer
55 views

Getting all pids in a systemd unit

I'm using the Linux Citrix client and the latest versions has a tendency to leave processes behind. I came up with a little script to kill them using old-school unix commands and it works very well. ...
Thomas Guyot-Sionnest's user avatar
1 vote
1 answer
54 views

Understanding memory limits in a systemd service: Are they per-process or combined?

I have a systemd service named vcoagent.service running on my Linux system, and I'm trying to understand how memory limits specified for the service (Memory: 300.3M (limit: 500.0M)) apply to the ...
Ackerman Shadow's user avatar
0 votes
0 answers
18 views

Identification of processes that are not terminated by logging out

I'm trying to better understand how to terminate all undesired processes and start a Linux session fresh. By "undesired", I mean any processes left over from applications that have crashed. ...
End Antisemitic Hate's user avatar
3 votes
1 answer
67 views

Thread Name: Is /proc/pid/comm always identical to the Name: line of /proc/pid/status and the second field of /proc/pid/stat?

A Linux thread or forked process may change its name and/or its commandline as visible by ps or in the /proc filesystem. When using the python-setproctitle package, the same change occurs on /proc/pid/...
Juergen's user avatar
  • 702
0 votes
0 answers
38 views

Why does a program launched by echoing into sh persist after parent termination?

I was looking at dmenu_run, which is the default dmenu script to launch a program, and saw this part of it that intrigued me: [..other stuff..] | dmenu | sh & So I did some testing. Prerequisites ...
mutageneral's user avatar
1 vote
3 answers
163 views

start multiple terminal windows in a "process group" so that remaining processes can be killed, if any one of the processes terminates

I have a script which starts 3 terminal emulator windows: #!/bin/sh terminator --role='terminator-left' 2>/dev/null & sleep 0.1 terminator --role='terminator-center' 2>/dev/null & sleep ...
Martin Vegter's user avatar
0 votes
1 answer
36 views

Running arbitrary binary program with cluster computers

I have 3 VPS. Let's say master, slave1, slave2. Their specifications are identic. Processor: 1CPU Memory: 1GB Disk: 10GB Network: running on LAN each other I expect any arbitrary binary program (...
Muhammad Ikhwan Perwira's user avatar
7 votes
0 answers
171 views

Why does `kill -0` return success on a non-existent process?

I'm on Ubuntu 22.04.3 LTS, (Jammy Jellyfish). $ ps -p 1635 PID TTY TIME CMD $ kill -0 1635 ; echo $? 0 $ type kill kill is a shell builtin $ echo $BASH_VERSION 5.1.16(1)-release $ mount|...
Philippe's user avatar
  • 1,455
0 votes
0 answers
25 views

Pm2 is unable to run nodejs microservices after nodejs upgradation from v10.24.1 to v16.15.1

I have upgraded from nodejs 10.24.1 to 16.15.1 on my centos machine. and updated my pm2 to latest version, and ran pm2 update all the microservice process where running sucesffully. But on rebbot the ...
Dilip Rao's user avatar
0 votes
0 answers
129 views

Fuser shows non-existing processes, so NVIDIA GPU reset fails

I am trying to reset an NVIDIA A100 card that still has memory occupied, but no process is using it. First, I killed all processes using any NVIDIA card with sudo fuser -k /dev/nvidia* then run the ...
Green绿色's user avatar
-2 votes
1 answer
402 views

How to find one of multiple processes with the same name using pgrep (or another tool)? [closed]

I have several bash scripts running. The only thing that differs between them is the pid. I want to write a script like this that only monitors one specific bash process and exclude any daughter ...
d-b's user avatar
  • 1
0 votes
0 answers
96 views

How can I force linux to limit the amount of time I play "games" on it per day, that would be protected from root override?

Problem: Struggling with video game addiction. https://www.reddit.com/r/Steam/comments/v0wj7i/is_there_a_way_to_limit_gaming_time/ Virtually no existing ways to limit gaming, outside therapy. I need ...
Anon's user avatar
  • 215
0 votes
0 answers
1k views

supervisorctl add & remove commands

Context In the supervisor documentation, I can read the following parameters, for the supervisorctl add and supervisorctl remove control commands: add <name> […] Activates any updates in config ...
Totor's user avatar
  • 20.3k
0 votes
0 answers
727 views

Embed script into docker container to run after main process starts

For a particular docker image (based on alpine) I want to run some custom code after the container starts. I want that code inside the container, so it's easy to use and everything is self-contained. ...
lonix's user avatar
  • 1,783
1 vote
1 answer
714 views

How to stop "tail -f" in a script and exit if a certain condition is fulfilled?

I'm trying to come up with a script for managing jobs on a supercomputer. The details don't matter much, but a key point is that the script starts to tail -f a file once it appears. Now this would run ...
Neinstein's user avatar
  • 286
1 vote
0 answers
411 views

Identifying suspicious bash process (high cpu and ram usage)

A couple of days ago I noticed a bash process in htop on my Arch system with relatively high, fluctuating cpu and ram usage. Started closing windows one by one to try pinpointing it, when I closed ...
alextim's user avatar
  • 11
1 vote
1 answer
235 views

^C SIGINT does not work in adb shell in Linux

I am working on an embedded Linux system, which uses kernel-5.10.24. It uses busybox as init, and has other utilities in rootfs, including adbd. I can run adb shell from PC to login to the embedded ...
wangt13's user avatar
  • 443
0 votes
1 answer
139 views

Is it possible to defer reaping of background processes in bash?

If I just run sleep 1 & in bash, the sleep process will get reaped almost instantly after it dies. This happens whether job control is enabled or disabled. Is there a way I can make bash hold off ...
Joseph Sible-Reinstate Monica's user avatar
1 vote
2 answers
172 views

Is there a performance penalty for backgrounding a process?

If I do: sleep 1 versus sleep 1 & wait $! will there be any difference in terms of CPU usage for spawning a foreground process versus a background process? Or will the performance of both lines ...
Maestro's user avatar
  • 191
1 vote
1 answer
37 views

Process name as the called executable, not the calling script

Edit: I relalised after posting the below that the machine where this 'worked' had in fact not been restarted and the running processes had been launched using an older scheme of actual aliases (...
ozpac's user avatar
  • 33
0 votes
1 answer
156 views

How to determine which processes are running on outdated packages and needs restarting?

So, I know that it is possible to view or recover deleted files that are currently being used by a process. I've found out that this also applies to packages that were updated. So, let's say we update ...
nixvega's user avatar
2 votes
1 answer
591 views

How does round-robin scheduling and context switching work from a low-level?

Using round-robin scheduling, the kernel provides time slices for different processes / tasks. It seems that the kernel will initialize a timer, and when the timer times out, this will cause the ...
Engineer999's user avatar
  • 1,171
2 votes
1 answer
1k views

Bash to instruct parent process to exit by certain PID's kill

How is the correct bash command/instruction to exit parent process by certain signal or PID's kill when being in child process?
user avatar
2 votes
0 answers
167 views

Large process id on rocky linux 8.5

I started using rocky linux 8.5, I have added cron to reboot this server everyday. server reboots everyday. When I start some application on this server the process id I get is very large. It don't ...
HappyAC's user avatar
  • 21
0 votes
1 answer
22 views

Find filepath that spawned process

I am using a Debian 9.13. Trough ps -aux | grep NaughtyProcessName i can find information about a given process that interests me in the format: user.name [ID] [CPU USAGE] [%MEM] VSZ RSS TTY STAT ...
Marco Montevechi Filho's user avatar
1 vote
2 answers
1k views

Best way to get resource usage information for a process?

What would be the best way to go about monitoring resource usage of certain running processes? For example if I wanted to generate log files of CPU and memory usage over time. From what I understand ...
Euchidna's user avatar
1 vote
0 answers
552 views

How long can kill -9 take

I am writing a custom process manager, that executes commands and monitors their execution. On their termination sometimes I want to terminate some running processes and execute other processes. I ...
debnatkh's user avatar
0 votes
1 answer
165 views

how to make sure 2 apps on 2 different servers but at the same time only 1 app on 1 server running

I am having an app written in java, the app is deployed on 2 servers. However I can only launch the app on one server. If I run the app on both servers there will be a conflict. So I'm looking for a ...
aphabeta's user avatar
2 votes
1 answer
3k views

How do I kill all subprocesses spawned by my bash script?

I have a script that looks like this. Invoked with ./myscript.sh start #!/bin/bash if [[ "$1" == "start" ]]; then echo "Dev start script process ID: $$" cd /my/path1 ...
Jay Pillai's user avatar
1 vote
1 answer
379 views

What is the equivalent of "task_struct" in linux's <linux/sched.h> for Mac OS?

I want to understand the Process Control block of Mac OS and Linux. For Lionux it was pretty strightforward, there was a post here asking about the same thing and someone replied to go take a look at &...
joao pereira's user avatar
0 votes
3 answers
951 views

Why does the same process bounce around on different "CPUs"?

I am doing some performance troubleshooting of some long running jobs which start processes that consume entire CPU cores, but are single-threaded. I observed these processes bouncing around to ...
Appleoddity's user avatar
5 votes
0 answers
331 views

Why does ps not exit when listing full command line arguments? [duplicate]

Any time I attempt to run the ps command or another similar command in a way that would make it output the arguments for any process, the command runs and produces output, but then freezes, entering ...
AJMansfield's user avatar
2 votes
1 answer
3k views

Automatically restart a process after it exits

I have a javascript program, which runs on nodejs. If I run the following command: node app.js It keeps running but sometimes it exits. But I want to start it again automatically when it exits. Is ...
Ar Rakin's user avatar
  • 189
1 vote
1 answer
2k views

No sched_min_granularity_ns in kernel parameters

According to this post, there are three kernel parameters for controlling process scheduler: kernel.sched_min_granularity_ns kernel.sched_latency_ns kernel.sched_wakeup_granularity_ns However, on my ...
mahmood's user avatar
  • 1,241
2 votes
2 answers
751 views

killall firefox does not kill firefox

When I had loads of firefox windows open and wanted to close them quickly I did killall firefox using killall from the psmisc package in Ubuntu. Nothing happened. I looked in the list of my processes ...
alle_meije's user avatar
2 votes
2 answers
1k views

Autokey - Focus App Window If Running, Launch App If Not

I'm trying to obtain the processID of pcmanfm like this: pgrep -f "pcmanfm" When pcmanfm is not running, the command above returns nothing (as I expect). However, when I run the command ...
Lonnie Best's user avatar
  • 5,175
0 votes
2 answers
163 views

List Running Commands of All Windows

You can list the process ID of each widow with this command: wmctrl -lp Does there exist a command that shows the running command of each window (kind of like htop has a column for "Command"...
Lonnie Best's user avatar
  • 5,175
0 votes
1 answer
116 views

Why do my orphaned grandchildren die only if they produce output?

I am tending to a program "master" which manages a set of concurrently running sub-processes "slaves". Sub-processes are launched and killed as needed. Many of these sub-processes ...
Hermann's user avatar
  • 6,277
1 vote
1 answer
2k views

Kill all of my processes that were started within the past hour?

How do I kill all processes with my username that were started within (past hour, past day) etc?
a6623's user avatar
  • 137
3 votes
0 answers
340 views

Running process (not a zombie) that's impossible to kill

Yes, I know this question has been asked tens if not hundreds of times before. Still, I went through all similar questions and tried everything listed on them, to no avail. After compiling some code ...
swineone's user avatar
  • 131
0 votes
2 answers
136 views

How can I make cdrecord have UNINTERRUPTED use of system resources?

I'd like to burn thirty mp3 songs to a CD-R, using say cdrecord. But I'd like to use my laptop for other things at the same time (such as using the Kate editor and the Internet). However, I've read ...
dave99's user avatar
  • 49
0 votes
1 answer
217 views

How to stop a process permanently for every session?

I have a laptop with minimal resources and this process, "gnome-software", takes up huge space in RAM. I have to kill it every time. Is there permanent way to stop this process?
deepanshu's user avatar
  • 103
1 vote
1 answer
146 views

how to detect and stop a script which calls itself in background and exits

i was working on writing a wrapper script for a tool. the wrapper script should prepare the environment and then call the tool in background then exit. it looks something like this: #!/bin/bash export ...
Lesmana's user avatar
  • 27.6k
1 vote
0 answers
231 views

What could account for a very, very large change in pid's in a short amount of time?

On an Ubuntu 20.x server, we are having some OOM Killer issues, where it kills a Java process. We have been unable to find any memory leaks. But this morning, we got a rare gift, which is two oom-...
greymatter's user avatar
1 vote
0 answers
59 views

How to kill a process completely that can re-run automatically [duplicate]

A process occupies a lot of CPU, and when I kill it by kill -9, it just re-runs with another name. How can I find it out, kill and delete it?. Its parent pid is 1, started by root user, and on the ...
user avatar
1 vote
1 answer
50 views

what is the right way to know all script PIDS that runs under folder

Under the folder /home/testing/scripts on a Linux machine, we have 234 different scripts that do sanity and testing as /home/testing/scripts/test.network.py /home/testing/scripts/test.hw.py /home/...
yael's user avatar
  • 13.4k
0 votes
1 answer
97 views

Start process and access the "shell" at a later time

I have a remote testing machine which is experiencing some failures. What I would like to do is trigger a gdb process upon failure on the remote machine, and then ssh into the remote machine and ...
Madden's user avatar
  • 345
2 votes
2 answers
801 views

Run commands in parallel and wait for one group of commands to start before starting the next

I have created a script to run two threads in parallel using for loops. for i in 1 2 do echo "for loop in shell script iteration begins.." & done As expected it runs in parallel, but I ...
Alan Varghese Aniyan's user avatar

1
2 3 4 5
8