Questions tagged [process]
A process is an instance of a computer program that is being executed.
2,351
questions
0
votes
2answers
18 views
Process with dynamic id won't kill; has no parent
I am trying to kill process like this:
root@xxx:~# ps -ef | grep mosquitto
root 3083 1912 0 11:59 pts/0 00:00:00 grep --color=auto mosquitto
root@xxx:~# kill 3083
-bash: kill: (3083) - ...
1
vote
0answers
12 views
Load a core dump continue running
I can create a coredump as a snapshot of a process's image and continue running.
Can I then, on another run of the program load the coredump and continue at that same point in time? If so how?
...
1
vote
3answers
57 views
How to assign process to work on partial CPU's? [duplicate]
We want to run our applications ( process ) only on the first 6 CPUs. We have a RHEL machine.
We have physical DELL machine with total 12 cores (from lscpu)
Is it possible to assign the process to ...
1
vote
2answers
28 views
Restart a process if a message is detected on stdout
Is there a way of monitoring a process (like for example with supervisord), and then restarting the process if the stdout outputs a specific line of text?
In my case the line to check for would be:
...
0
votes
0answers
15 views
Rationale for restrictions on setpgid() call?
I was reading Chap 34 (Section 34.2) of the book Linux Programming interface, when I came across the following restriction while making use of setpgid() call.
The pid argument may not specify a ...
0
votes
1answer
13 views
Give user permission to change priority of an IRQ/root process
Is it possible, in Linux, to allow an user to change the priority of a process owned by root? More specifically an IRQ process?
For an embedded real-time application I want to raise the priority of ...
0
votes
1answer
18 views
Sort ps output by the command in Solaris
The purpose of this exercise is to dump the output of ps sorted by command.
While the system is running we wish to dump all the running process sorted by command in a file.
There is a sort option in ...
2
votes
1answer
22 views
Extracting $! from multiple process substitutions
Consider the following:
exec > >(tee -a mylog) 2> >(tee -a mylog >&2)
pspid=$!
Which tee process has the pid of $! above?
If we want the pid's of each tee processes above how do we ...
0
votes
0answers
16 views
Redirection inside background process
Consider the following code:
exec > >(tee mylog.stdout) 2> >(tee mylog.stderr >&2)
# ^^^
# why do we need this >&2 ? If removed,...
0
votes
0answers
27 views
The parameters a new process inherits
It appears that a new Linux process inherits its parent's
present working directory,
umask,
process group (getpgid) and
process session (getsid).
Also, the parent's PID becomes the new process's ...
0
votes
0answers
20 views
Closing stdout required for wait on sub process to finish?
I have a question from https://mywiki.wooledge.org/BashFAQ/106
Have a look at this code:
exec > >(tee myfile)
pspid=$!
# ... stuff ...
echo "A"
cat file
echo "B"
# end stuff
...
1
vote
2answers
38 views
Is releasing memory pages by a process possible in principle?
Disclaimer: I do have a diploma in CS but this topic was never explicitly explained to me. I am just stiching pieces of what I know into a whole. Please correct me if I get something wrong.
Suppose ...
0
votes
1answer
33 views
Why is my host displaying 2 cron processes?
I notice that I am getting 2 different cron processes in ps:
[user@host ~]$ ps aux | grep -i cron
500 746 0.0 0.0 6384 676 pts/1 S+ 13:40 0:00 grep -i cron
root 905 0.0 0.0 ...
0
votes
1answer
25 views
2 of the same processes with different PIDs running - not threaded
This is not a multi-threaded process. With ps and top I observed:
[user@host]$ ps aux | grep -i [r]redacted ...
0
votes
1answer
39 views
Process substitution under the hood
This question is from https://mywiki.wooledge.org/ProcessSubstitution
mkfifo /var/tmp/fifo1
mkfifo /var/tmp/fifo2
sort list1 >/var/tmp/fifo1 &
sort list2 >/var/tmp/fifo2 &
diff /var/tmp/...
0
votes
1answer
34 views
How to check for active ssh port forwarding connections on MacOS
On my local MACOS I setup a reverse ssh tunnel using the below command.
ssh -fnN -R 2222:localhost:22 remoteuser@remotelinuxhost
And then my MACOS is controlled by the remote linux host which fires ...
1
vote
2answers
29 views
High program load, when killed program process, Linux doesn't go back to 0.5 normal load. Why?
I ran a program that reached CPU load of 39.99, obviously more than my 4 core CPU can handle but why when I killed the program, (which is killed), the CPU load doesn't drop to 0.50 when I didn't turn ...
2
votes
1answer
50 views
PID of background function “$!” gives wrong value
I am trying to capture the PID of a function executed in the background, but I seem to get the wrong number.
See the following script:
$ cat test1.sh
#!/bin/bash
set -x
child() {
echo "...
16
votes
5answers
2k views
How can I control a shell script from outside while it is sleeping?
I am fairly new to shell scripting. I have a script similar to the following,
while [ true ]
do
sleep 5m
# PART X: code that executes every 5 mins
done
While this is running (1) how can I ...
1
vote
1answer
33 views
Mystery of Zoom auto-restarting, how do I stop it?
I'm running an ordinary Debian system on which I have installed Zoom.
After using Zoom, and quitting, the program keeps restarting. After
I kill it I use ps to check and it is gone, after about 15 ...
0
votes
0answers
33 views
SystemD error: opendmarc.service: Can't open PID file
Mail server: Ubuntu 18.04, Postfix, Dovecot, spf + dkim, opendmarc
Problem: Opendmarc starts and works as expected but still persistent message:
Can't open PID file /run/opendmarc/opendmarc.pid (yet?) ...
3
votes
1answer
38 views
Is it just me or is the man page for renice ambiguous?
I am considering renicing some processes so that they will remain responsive under heavy load on a server.
I read the short man page for renice, and I understand it less each time I re-read it. It ...
0
votes
1answer
24 views
Varnish duplicate process 170 once
I am using nginx + varnish.
I noticed that I have ~ 22GB / 32GB in use.
I looked in htop and noticed that there are about 170 duplicate varnish processes.
Tell me what could be the problem? Where to ...
-2
votes
0answers
19 views
Alibaba Cloud Monitor agent VS top command. Who should I trust?
Alibaba agent says the system CPU is hitting over 90%
But when I login to the system and check CPU with top command, it says it's around 60%.
This repeatedly happens but I don't know which one to ...
0
votes
0answers
19 views
Can we collect Statistic about how many times an Appliction is minimized or maximized in Linux?
Is there anyway which provides user, statistics such as, how many times an Application window was minimized, or maximized. Lets say how many time a browser was minimized or how many times it was ...
0
votes
2answers
38 views
How do I automatically close the process left behind by a misbehaving application after it exits?
There are applications that do not exit cleanly leaving behind their process. One example I've found is Foxit Reader. Of course, the ideal would be to report a bug and have the application fixed, but ...
0
votes
2answers
33 views
Kill process if it takes more than xGiB of RAM in a given amount of time
I am a software developer and I come into contact with a lot of unstable software.
Recently I made a small game, which for some reason memleaks until the system hangs and is unresponsive. Usually, ...
1
vote
2answers
70 views
Problem in understanding how the operating system and memory works in a Unix system [closed]
I am an undergraduate mathematics student and I am currently doing a course in operating system with a very little background in computer science.
Here are the basics that I know - An operating system ...
3
votes
2answers
59 views
Find what process making outgoing connection on port 80
We are stuck in identifying which process or service that we are running in our linux machine is making a connection to a remote IP. We are getting complaints of our network accessing the remote IP ...
0
votes
2answers
42 views
Why Bash Parent Process exits before its child when command is used in background in a Bash script?
Let's say I have for the following simple bash script:
test_bg.sh
#!/bin/bash
ping www.google.ro &> /dev/null &
If I execute it directly via ./test_bg.sh and do a ps -ef after, I see that ...
2
votes
1answer
142 views
Getting the executable name in Linux from /proc/ and detect if it's truncated
The executable name is linux can be read in various ways.
By reading /proc/[pid]/comm, which contains a string that's truncated after reaching 16 characters or TASK_COMM_LEN.
By reading /proc/[pid]/...
0
votes
3answers
66 views
Why is the command sleep an independent process but others seemingly not when used in a shell script?
I'm writing a bash script named test.sh as below on my Ubuntu:
#!/bin/bash
while true; do
echo 'abc' # pwd, df...
sleep 1
done
When I execute ./test.sh at one terminal, I open another ...
0
votes
0answers
8 views
how to check running process on cpanel terminal?
I run a python scrapper on cpanel terminal, but after log in again and check the terminal it was not showing the process running. how can i check if it is still active or i need to run again.
i just ...
-1
votes
1answer
29 views
Does a program run by bash runs in a new job?
In this video, it is said that:
In the normal arrangement, if you open a terminal, and inside you have a shell running, that shell represents the start of a new session. That session starts with one ...
2
votes
0answers
49 views
Why is pgrep/pkill so much slower than ps?
I would have thought that pgrep would be much faster than ps -ef yet the contrary is true - pgrep takes about 4x longer. But only on my laptop e.g.:
$ time { ps -ef |grep foobar; }
real 0m0.027s
...
0
votes
1answer
40 views
Is data retained in memory if there is a network disconnect? If so, how can I see that data?
I am trying to see if data is retained in memory if there is a network disconnect from a system shut down on Machine 3. All machines are running RHEL 7. My setup is as follows:
Machine 1 > ...
1
vote
1answer
41 views
Is it possible to modify an executable which is already running?
I have a Linux system which is running in an embedded system. For various reasons I can't get into (or I'll get fired), I don't have direct access to this system through normal means like a keyboard, ...
1
vote
1answer
28 views
How do I get all the stats about a specified pid? E.g. how long it ran? max/min/avg usage of cpu, memory, disk and network?
Here is a tiny C++ app
#include <iostream>
#include <unistd.h>
using namespace std;
int main()
{
cout<<"Hello World"<<endl;
std::cout << "pid = &...
0
votes
2answers
39 views
Virtual Address Space [closed]
I have started to learn about Virtual Address Space (VAS) and I have few questions:
How much of VAS is created for each process depending on the architecture (32-bit and 64-bit)?
Is VAS for each ...
1
vote
1answer
36 views
Linux cgroups: task vs pid?
What is the difference between a task and a pid? Inside of the /sys/fs/cgroup there a file called tasks which lists just pids,
$ ls /sys/fs/cgroup/*/tasks
/sys/fs/cgroup/blkio/tasks /sys/fs/...
0
votes
0answers
31 views
figure read speed access to a file from a process
Background info for the request::
I have a radius server (freeradius running on Linux) that for each request needs to parse a long text file containing the allowed mac-address.
From time to time, it ...
1
vote
2answers
60 views
Is it possible to check the process id of child in different pid namespace?
Is it possible to find the PID of the child process which is in a separate PID namespace?
I am able to get the child process PID with respect to the parent namespace but I need to find the PID of the ...
0
votes
1answer
40 views
How to spawn each child process in separate pid namespace
How to spawn each child in a separate PID namespace using unshare (without CLONE_NEWPID flag in child process clone syscall). I am able to successfully spawn first child in PID namespace but I am not ...
1
vote
2answers
38 views
How GUI applications receive keyboard input?
I started Firefox from by bash window by entering the command "firefox",
it started the Firefox browser in the user interface.
When I checked the Firefox process by entering "ps" ...
1
vote
2answers
85 views
How to kill a command run from a script after a period? [duplicate]
I would like to run a never-ending command (such as play a mp3 file in loop) for a period of length T.
I put the command in a shell script my.sh:
#! /bin/bash
vlc /path/to/my.mp3 # will play the file ...
0
votes
1answer
95 views
Launching a program via `xdg-open` from a subshell without blocking
I've noticed that calling xdg-open from a subshell will reliably block until the launched process is closed. I suspect there may be a reason for this, but I'm not sure as to why. For example, ...
0
votes
0answers
66 views
killall and kill doesnt work
I scanned using ClamAV and found these files:
[root@ip-172-31-23-37 ~]# sudo clamscan --infected --recursive --exclude-dir="^/sys" /
/tmp/.X25-unix/dota3.tar.gz: Multios.Coinminer.Miner-...
0
votes
0answers
48 views
How to find out which process access outgoing ssh?
My EC2 instance reported got suspicious activity and I got this email:
has been implicated in activity which resembles scanning remote hosts
on the internet for security vulnerabilities. Activity of ...
-1
votes
1answer
60 views
Is a process in TASK_INTERRUPTIBLE state waken up only by the delivery of a signal?
The Linux Programming Interface says
22.3 Interruptible and Uninterruptible Process Sleep States
We need to add a proviso to our earlier statement that SIGKILL and
SIGSTOP always act immediately ...
1
vote
1answer
36 views
TTY = ?, How input is read
When listed down the running processes,
I can see several processes like 'chrome', 'notepad', 'intellij', 'sublime editor' etc.. are having "tty = ?"
Then how are they able to read the ...