process-management

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

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 0.1 terminator –role=’terminator-right’ 2>/dev/null & (I am using the –role option, …

Total answers: 3

Is there a performance penalty for backgrounding a process?

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 be exactly equal? Asked By: Maestro || Source With …

Total answers: 2

Find filepath that spawned process

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 START TIME COMMAND Where command shows something like: path/to/interpreter ./file_name.cmd So i suppose some user …

Total answers: 1

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

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 yarn dev &> /my/path/logs/log1.log & echo "started process1 in background" echo "Process ID: $!" echo …

Total answers: 1

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

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 "task_struct" in <linux/sched.h>. However i …

Total answers: 1

Automatically restart a process after it exits

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 there any command to do so for Linux systems? Note that I …

Total answers: 1

Process states in OS theory vs in Linux

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 state diagram? Specifically, I am unsure where D/S/T/I fit in …

Total answers: 1

How does Linux accomplish pre-emptive scheduling?

How does Linux accomplish pre-emptive scheduling? I am reading up on Linux processes from The Linux Documentation Project: https://www.tldp.org/LDP/tlk/kernel/processes.html Processes are always making system calls and so may often need to wait. Even so, if a process executes until it waits then it still might use a disproportionate amount of CPU time and so Linux …

Total answers: 1

File descriptor from `signalfd(2)` is never ready to read

File descriptor from `signalfd(2)` is never ready to read I have a fairly big application under care. As part of its job it spawns some child processes and needs to monitor their state (running, crashed). Child process deaths were detected by setting signal handler for SIGCHLD using signal(2). Some time ago I migrated it to …

Total answers: 2

Terminate process upon specific output

Terminate process upon specific output How can I terminate a process upon specific output from that process? For example, running a Java program with java -jar xyz.jar, I want to terminate the process once the line “Started server on port 8000” appears on stdout. Asked By: Ivan G. || Source java -jar xyz.jar | grep …

Total answers: 3

What does a program do when it's sent SIGKILL signal?

What does a program do when it's sent SIGKILL signal? When I used killall -9 name to kill a program, the state become zombie. Some minutes later, it stopped really. So, what’s happening during those minutes? Asked By: haikun he || Source The program actually never receives the SIGKILL signal, as SIGKILL is completely handled …

Total answers: 1

Get list of processes that were forked off my currently running process?

Get list of processes that were forked off my currently running process? I am writing a wrapper application to bash scripts and want the application to keep a track of which tools/processes have been launched from user scripts. I would like to know what is the best way to determine the list of child processes …

Total answers: 4

Restarting Gnome Shell 3.28.1 on Fedora 28

Restarting Gnome Shell 3.28.1 on Fedora 28 Running newer versions of Gnome (on Wayland), you can’t restart the shell with Alt+F2, entering r & then Enter – which used to restart the shell without logging the user out of the session. More recently, on Fedora systems you used to be able to restart by sending …

Total answers: 2

Linux: how to know which processes are pinned to which core?

Linux: how to know which processes are pinned to which core? Is there a way to know which cores currently have a process pinned to them? Even processes run by other users should be listed in the output. Or, is it possible to try pinning a process to a core but fail in case the …

Total answers: 4

What happens to a unix session when the session leader exits?

What happens to a unix session when the session leader exits? I’m trying to properly emulate POSIX signals handling and job control for my pet operating system, but it’s not clear to me what should happen to a session after the session leader exits. I cannot find documentation related to what happens to the session …

Total answers: 1

Is there any way to kill or end a process in "disk sleep"

Is there any way to kill or end a process in "disk sleep" I am running Linux Mint 18.2 with KDE Plasma. Recently I noticed that most of the times I copy large files to removable drives the process hangs just before finish. I opened KSysGuard and saw that the process of file.so is in …

Total answers: 1

How do I kill an IRQ process in Linux?

How do I kill an IRQ process in Linux? I can not kill irq/${nnn}-nvidia by kill -9 or pkill -f -9. Does anyone how to kill or stop those process? (I am using Ubuntu 16.04, if that is relevant.) Asked By: TMit || Source You can’t. It’s not a process, it’s a kernel thread. You …

Total answers: 3

Why can't we kill uninterruptible D state process?

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 reboot. I was wondering if there are any other ways but …

Total answers: 1

Find and kill the process that is using a serial port

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 I run a kermit script (so that …

Total answers: 5