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
0answers
163 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, ...
2
votes
0answers
74 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
238 views

Process overwrite access restriction

I want to run a program so that it can only create new files and not overwrite existing ones. Does something like this exist? $ fsaccess --can read,write --not overwrite --command bash -c 'echo "...
2
votes
0answers
301 views

Need good ideas about improving any Linux service [closed]

I have a project assigned to me by OS teacher to choose any Linux service and improve it. Currently I am totally blank in this. I am not sure which service should I use which can easily be implemented ...
1
vote
1answer
905 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
3answers
15k 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 ...
1
vote
1answer
952 views

Is there a way to prevent sigkill to reach a process?

I know that a process cannot prevent SIGKILL. But is there an external way to temporarily prevent SIGKILL to reach a (specific) process? (something like dropping packets by firewalls).
1
vote
1answer
488 views

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 ...
1
vote
2answers
822 views

How can i get the process with the biggest pid?

How can I get the process with the biggest pid using ps?
1
vote
2answers
3k views

multiple background processes in a script

Suppose if i have a situation in which some files need to be copied and it takes long time so i would have to go for parallel processing of the file copy. for example it may look like this for i in ...
1
vote
2answers
146 views

Terminal command (called not from SU) that would restrict process from writing to all directories but one?

We have an app testApp. We have a folder called notRestricted in the directory where we run app from. We want to limit access of the app to file system so that app could write only to that folder (we ...
1
vote
2answers
206 views

Is there any danger in using kill -11 instead of kill -9?

I've realised recently that the kill utility can send any signal I want, so when I need to SIGKILL a process (when it's hanging or something), I send a SIGSEGV instead for a bit of a laugh (kill -11 ...
1
vote
2answers
462 views

how disable use swap partition by processes , only if its really need

My embedded system has 2 GB RAM and 100 MB swap partition. I recognize, after continues monitoring that average memory usage of RAM is ~50 %. For some reason system start use SWAP memory and use ...
1
vote
2answers
2k views

One-Liner needed: Stop httpd if running already & Start httpd if not running

As part of a provisioning script for CentOS 7 I am in need to have a one-liner that performs the following. Unfortunately, I have no clue how to achieve that. If httpd is running then stop it If ...
1
vote
1answer
937 views

Cross-platform (Linux, BSD, Solaris) way to check if pid exists

I am looking for a reliable cross-platform way to check if a process with a specific pid is running. Two possible solutions came up: kill -0 $PID — exit status is 0 if it the process exists and 1 if ...
1
vote
1answer
33 views

How to optimally stop a find which pipes to a bash script

I'm using the following to convert a video library from x264 to x265. But I can't stop it without doing a Ctrl-C on the bash script whilst it's working. find /mnt/local/int001/media/TV/ \ \( -name ...
1
vote
1answer
81 views

Why below code is not able to unblock SIGINT signal

I am trying my hand on Linux Signals. Where I have created a scenario mentioned below: Initially block all SIGINT signals using sigprocmask(). If sender send SIGUSR1 signal then unblock SIGINT for ...
1
vote
1answer
593 views

How can I kill all child processes of a certain process from the command line?

I run both regular Chrome and Chrome Canary (from now on, Canary). Sometimes I want to kill all subprocesses, Google Chrome Helper, of Canary. The problem is that they have the same name as the ...
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 ...
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....
1
vote
2answers
443 views

List superuser processes

I am trying to list the superusers processes currently running in my Kali distro. Using "pgrep -f sbin" I figured that would do the trick, however it only lists the PID numbers, not the actual name of ...
1
vote
1answer
178 views

Which process group does my program belong to when started from bash?

If I run a program from bash, then does my program belong to the same process group as the shell, or does it belong to a new process group? As I am making a shell in C, I need to handle the SIGINT ...
1
vote
2answers
2k 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 &...
1
vote
2answers
2k views

Host process for multiple processes?

I am maintaining an application that currently consists of 4 processes that are dependant on each other in various ways. At the moment these processes are started, stopped and monitored via a rather "...
1
vote
4answers
7k views

Stopping a script process with a Control + C or something

I am trying to make an AV bug raspberry pi for a class. I am using sox to record sound. Which is working fine. the issue is sox needs to be stopped by a control+C to stop and create the new file. ...
1
vote
6answers
322 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 ...
1
vote
1answer
63 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
vote
1answer
76 views

Task management tools with keyboard navigation that run in a terminal

I recently learned that I can use top with my keyboard to kill processes (k), show processes for a specific user only (u), etc. But I was wondering if there is a way of selecting processes from the ...
1
vote
3answers
102 views

What are the proper tools to setup a remote compilation and running (something like ideone)?

I'm trying to achieve similar functionality in a server for community programming and I've drafted this to wrap up another take on oneide's functions: From a Perl CGI I build a script like this (not ...
1
vote
1answer
348 views

Daemon vs worker and when to use what?

(Note that, below, I am frequently using term "daemon or worker" just to indicate that I dont know which word to use as I dont know the exact difference between them in the context explained below.) ...
1
vote
1answer
480 views

How to pause process with multiple child pid's (java)

I am attempting to "pause" a running java process. So I went ahead and ran the recommended: sudo kill -SIGSTOP <pid_of_java_proc> however, if I run strace on it: sudo strace -F -p <...
1
vote
2answers
116 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'...
1
vote
1answer
78 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 & ...
1
vote
1answer
76 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 ...
1
vote
1answer
175 views

Kill process instead of panic on hung_task

There are sysctl parameters for hung_task* that allow you to emit error messages or panic if a process is in the D state for some amount of time. Is there anyway way to have the kernel kill the ...
1
vote
1answer
6k views

kill processes in one line with kill, awk, ps, and grep

I have a few processes that spring up and I am able to print a line of the pgid's that I would like to enter into a kill command. here is what I have: sudo ps o pgid,args | grep mininet: | sudo awk '{...
1
vote
1answer
1k views

Managing the output streams of many subprocesses with deadlocks

I have a Python script that does more or less this current_tasks = TaskManager() MAXPROCS = 8 while len(outstanding_tasks) > 0: if len(current_tasks.running) < MAXPROCS: ...
1
vote
1answer
222 views

How to ensure a process has started reading a file before continuing?

I'm trying to write a command to test that data is written to a file. My first approach was: Start reading in the background. Write some data to the file. Wait for the reader to find a result. Repeat ...
1
vote
0answers
38 views

Scheduling CPU, between User space process/threads and kernel tasks/jobs [duplicate]

I was trying to understand the Linux process management and scheduling. I know that the scheduler schedules different processes based on priority/time slicing. But there are kernel tasks(I am not ...
1
vote
0answers
22 views

Why one application is shown several times in htop? [duplicate]

I run a simple Python script in a docker container (single process, no multiprocessing or multithreading). When looking at it with ps (one instance): root@srv ~# ps -ef | grep homemonitor root ...
1
vote
0answers
56 views

About `page_table_lock` in Linux process address space

I'm reading a tutorial about Linux page table, in the linked page Each process has its own page tables (threads share them). The pgd field of the memory descriptor points to the process's page ...
1
vote
0answers
81 views

pm2 script variable when script path is not within executing folder

I have a pm2 json file that contains a script element. However on the box in question, the target is not within the pm2 script folder. the documentation says that the path needs to be relative to pm2 ...
1
vote
0answers
199 views

htop: any way to see a sorted tree view from a sub level?

When using htop, I generally find that viewing process sorted by RES makes most sense when looking for performance and other issues in macOS. One problem I have is that Google Chrome (and other ...
1
vote
1answer
56 views

Synchronize current folder in multiple terminals

Today I came across an interesting idea - is it possible to synchronize multiple terminals somehow, so when I change directory in one of them, it gets changed automatically in the others? I think it ...
1
vote
1answer
373 views

How to only show processes from single program in htop. Filter not working for VS code

I'm trying to filter the view in htop to only show the processes associated with Visual Studio Code. I launch VS code on a default install on Ubuntu with code . so that is the filter i'm using. In the ...
1
vote
0answers
904 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+ ...
1
vote
1answer
733 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: ******** ...
1
vote
0answers
300 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 ...
1
vote
0answers
98 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 ...
1
vote
0answers
123 views

How to manage users' orphaned processes?

I have a service that executes users' scripts which in turn spawn more processes. Some of those processes stop on external conditions that might not take place. Since the the parent is gone (e.g. may ...