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
0 votes
0 answers
15 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
26 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
126 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,713
0 votes
0 answers
37 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
141 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
  • 19.5k
0 votes
0 answers
96 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,639
1 vote
1 answer
269 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
187 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
92 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
  • 327
0 votes
1 answer
59 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
92 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
  • 179
0 votes
0 answers
34 views

Is there any way for supervisord to reload only a single program configuration?

Supervisord looks nice at first glance, and I'm already used to it the way I get used to any tool after a while even if it is suboptimal. But I'm getting more and more annoyed with one situation: I ...
q.undertow's user avatar
0 votes
0 answers
36 views

Spawning a second terminal with inherited environment

From a shell running in one terminal window, I'd like to be able to run a command that spawns a second shell in a new terminal window, inheriting the environment of the first shell. With an executable ...
ivan's user avatar
  • 1,848
1 vote
1 answer
34 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
0 answers
23 views

How do I make it so that when a user logs out, all of the stuff they were doing gets forcefully terminated?

I have a server where there is a user that runs browsh when logged in. When I terminate the process really quick when it starts several times, the server gets really, really slow. How do I make it so ...
AnonymouseCoder's user avatar
0 votes
1 answer
96 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
0 votes
0 answers
13 views

Suspend/terminate a shell script running in background and called from another shell script

If I run the shell script below : #!/bin/bash /bin/bash loop.sh & that calls this one (loop.sh) : #!/bin/bash while true do echo "Hello" done I can't suspend it (ctrl + z) or ...
Aminos's user avatar
  • 131
2 votes
1 answer
360 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,121
2 votes
1 answer
631 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
111 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
20 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
303 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
289 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
122 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
2k 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
294 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
410 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
329 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
1 vote
1 answer
1k 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,151
2 votes
2 answers
509 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
850 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
  • 4,975
0 votes
2 answers
132 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
  • 4,975
0 votes
1 answer
90 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
  • 5,799
1 vote
1 answer
1k 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
263 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
119 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
162 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
114 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
  • 27k
1 vote
0 answers
143 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
41 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
  • 12.7k
0 votes
1 answer
78 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
  • 335
2 votes
2 answers
624 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
18 votes
1 answer
3k views

Process states in OS theory vs in Linux

I'm trying to map Linux process state codes (as in ps) to states in the OS state diagram but I can't seem to map them. Is it because Linux process states don't necessarily match the theoretical OS ...
trainsushi's user avatar
3 votes
0 answers
73 views

2>&1 causes process to block

I am trying to debug what I have done wrong in GNU Parallel (>=20190122). This runs as expected: ( echo 1 | parallel-20190122 --pipe -j0 --tee dummy {} ::: {1..1000}; echo Parallel is done here:...
Ole Tange's user avatar
  • 33.8k
2 votes
0 answers
955 views

QEMU on macOS: the background process gradually freezes if the QEMU window is not visible

I have a similar setup on a Windows 10 machine that doesn't have any such issues. This tread about macOS version 10.15.2. If the QEMU window is not visible (hidden, minimized or another application is ...
nnlkcncff's user avatar
0 votes
0 answers
225 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 %...
kkgarg's user avatar
  • 111
1 vote
1 answer
151 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/...
wangjiaying's user avatar
2 votes
3 answers
441 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-...
ThorSummoner's user avatar
  • 4,332
3 votes
1 answer
1k views

Where does one find the total number of context switches performed since bootup?

I figured out that the number of context switches performed by a process can be found in /proc/$$/status. I have been trying to look for the total number of context switches performed since bootup. I ...
loonatick's user avatar
  • 151

1
2 3 4 5
8