A process is an instance of a computer program that is being executed.

learn more… | top users | synonyms (1)

0
votes
1answer
12 views

Pick up a lost process from a GUI

Is there any way to reinstate a program that has been closed to the system tray but has lost its links to the GUI? The pid is visible in the terminal. I was wondering if there is any way to achieve ...
0
votes
0answers
9 views

PTRACE_TRACEME without parent

I'm trying for fun to exploit a code which uses ptrace to prevent debugging. This executable is suid, therefore there's no use in cracking it. It have also the stack segment executable. This ...
2
votes
1answer
23 views

Process name post killing

I am getting OOM error and killed process error in logs. In the logs, I can see the process ID which has been killed by kernel but not able to find out which process is actually been killed. Can we ...
3
votes
1answer
25 views

how to reliably determine processes using files after `umount -l` on linux

The Question After umount -l was performed on some mounted filesystem, and this filesystem remains still mounted (albeit hidden) because of some process maintaining (at least) one open file handle to ...
1
vote
1answer
1k views

How can I kill child processes with start-stop-daemon?

I'm writing a simple web server using nc and bash. It looks like this: #!/bin/bash rm -f /var/run/streamman/out mkfifo /var/run/streamman/out trap "rm -f /var/run/streamman/out" EXIT while true do ...
3
votes
1answer
11 views

Start new process group in .xinitrc

I have a statusbar (lemonbar) to which I pipe the output of a couple of scripts (time, battery, volume, etc.). These scripts, and the statusbar itself, are all started in a single bash script ...
0
votes
1answer
16 views

How to execute scripts in a parent-child behavior in bash?

Suppose I have two scripts named parent.sh and child.sh. The parent.sh script contains bash child.sh line and the child.sh script contains echo "This is the child script". Now, if the user executes ...
10
votes
3answers
779 views

How does a shell execute a program?

If I compile a program using gcc, and try to execute it from the bash shell, what is the exact sequence of steps followed by bash to execute it ? I know fork(), execve(), loader, dynamic linker (and ...
1
vote
1answer
19 views

Cinnamon: Which software project “owns” the “Display” configuration dialog?

Cinnamon 2.8.8 64-bit, Linux Mint 17.3 'Rosa' Menu > Preferences > Display The dialog allows to enable and disable (multiple) monitors, and position them relative to each other with drag and drop. ...
0
votes
1answer
28 views

Return owner of process given PID

I'm trying to grab the owner of a process from a list, I have the command pidof nmap to get the then ps -u <PID> | grep USER that I'm currently playing around with, but when I run it, it ends ...
8
votes
2answers
1k views

How to find tty from which a particular cmd “scp” is executed

How can I find out who executed a particular command and which terminal was used to run it? Original: How can I know particular cmd is executed by whom and to know about my terminal
1
vote
2answers
28 views

Getting the original command invocation from /proc/self

I'm trying to run some startup code in all procesess via the dynamic linker. The code should do stuff based on the zeroth argument of the process. I'm getting the arguments from /proc/self/cmdline ...
2
votes
2answers
24 views

ptrace suid binaries after privilege is dropped

I understand that we probably cannot do ptrace on suid binaries. However, I'm wondering why we cannot do ptrace after the binary drops its previlege to uid instead of euid. For example, in the binary ...
3
votes
2answers
8k views

How do you make a cross-process locking in Linux (C/C++)?

I need to make sure one process executes only in one instance at a time. On Windows you could use named mutex. But I have no idea what to use on Linux. I think I've seen an approach were app creates ...
2
votes
2answers
25 views

Status of a threads vs. status of a process

Do all threads of a specific process share the same status (D, R, S, ...) or may there be differences among these threads? If so, where in /proc do I find information about the status of a certain ...
20
votes
9answers
42k views

Kill many instances of a running process with one command

This is one of the questions that has troubled me often. Suppose I have thousand or more instances of any process(for e.g. say the process vi) running. How do I kill them all in one single shot/one ...
14
votes
2answers
790 views

Colored output?

When I execute a command from a terminal that prints coloured output (such as ls or gcc), the coloured output is printed. From my understanding, the process is actually outputting ANSI escape codes, ...
4
votes
3answers
2k views

Discrepancy between reported used memory and sum of application memory usage

I'm running a desktop system that quite regularly suffers from lack of memory, this prompted me to investigate what causes the issue in the first place. Problem is, there's no single process that ...
1
vote
1answer
41 views

How to show a list of processes from a group?

I want a simple command to list all the processes and its information from a given PGID.
0
votes
1answer
23 views

How to manipulate a file descriptor in another process? [duplicate]

Is there any way to manipulate (read, write, etc..) a file descriptor for any app which can be found in the path /proc/{pid}/fd? Especially for sockets. $ ll /proc/4229/fd total 0 lrwx------. 1 ...
7
votes
3answers
89k views

How can I see what processes are running?

I use Ubuntu Server 10.10 and I would like to see what processes are running. I know that PostgreSQL is running on my machine but I can not see it with the top or ps commands, so I assume that they ...
3
votes
2answers
260 views

How do I kill all processes except PID 1?

I want to kill all processes on a system except for PID 1. I am currently using pgrep -l . | awk "{if (\$1 != 1) print \$1}" | xargs -n 1 kill -s INT. awk is used to exclude the process with PID 1 ...
3
votes
2answers
229 views

Why can the waitpid system call only be used with child processes?

The man page wait(2) states that the waitpid system call returns the ECHILD error if the specified process is not a child of the calling process. Why is this? Would waiting on a non-child process ...
0
votes
2answers
4k views

`ps | grep | kill` aborts my script prematurely [duplicate]

I have a Linux computer that I remotely SSH into using plink on a Windows XP machine. I have a Plink program set to execute commands in a script using automated login: plink -ssh [domain name] -l ...
1
vote
2answers
34 views

Test whether a process left any orphans behind

I don't need to wait for them, I just need a yes or no. I'm executing a program that I know is going to fork (and the children are likely to fork too). If run correctly, it should take care of all ...
2
votes
1answer
788 views

Check for process already running in webfaction?

I use Django framework on webfaction and have 5 different cron jobs. One of them lasts much longer than others and sometimes gets stuck (30-120 seconds or more). I have already set that cron job to ...
2
votes
0answers
39 views

How to get the executed command of a process which has completed successfully using the PID?

I have small script, abc.ksh that takes 3 parameter e.g abc.ksh ${a} ${b} ${c} I will read from a config file with 'n' no of entires and I will execute abc.ksh 'n' times in parallel using a for loop. ...
4
votes
3answers
8k views

Why is apache2 showing up a defunct in the process list?

When I run top I see one line that doesn't look too good: 2475 www-data 20 0 0 0 0 Z 1 0.0 0:00.19 apache2 <defunct> Why is this process <defunct> and what should I ...
6
votes
1answer
373 views

Unkillable apache2 processes

After upgrading from debian lenny to squeeze (apache2 2.2.16-6+squeeze4 and php 5.3.10-1~dotdeb.1), my apache processes started to exit with segmentation fault. It happens every 5-30 minutes (for 1 ...
0
votes
0answers
36 views

How do we programatically tell if our bash script was succesful in starting or stopping mono-service -l:${LOCK_FILE} ./${PROGRAM_NAME}.exe?

I am running Ubuntu Linux 16.10 on an Ubuntu ThinkStation desktop. I used a bash script just now to restart and stop mono-service on our second Ubuntu Linux 16.04 desktop computer in the following ...
1
vote
1answer
101 views

Systemcrash suexec forkbomb.sh ulimits

I got this script named fork.sh: #!/bin/sh forkbomb() { forkbomb | forkbomb & } ; forkbomb If I call it through suexec my whole system will consume 99% cpu. To prevent a normal bash forkbomb I ...
21
votes
2answers
79k views

How to find out if httpd is running or not via command line?

I'm working on a small control panel for my server. I need a command that will say if httpd is running or stopped. Will probably be using the same code for other services as well.
0
votes
1answer
25 views

nonsudo kill processes matching string

I am trying to write a command that will kill all processes matching a string. I have permissions to execute kill -9 but when I try to do pkill -f string I get operation not permitted. Here is what ...
9
votes
3answers
257 views

Set-uid executable and resulting process user

In Ubuntu 14.04, the passwd executable is -rwsr-xr-x 1 root root 47032 gen 27 01:50 /usr/bin/passwd and the ping executable is -rwsr-xr-x 1 root root 44168 mag 7 2014 /bin/ping so (for both) ...
8
votes
4answers
3k views

New parent process when the parent process dies

In UNIX, when a parent process disappears, I thought that all child processes reset init as their parent. Is this not correct all the time? Are there any exceptions?
0
votes
1answer
36 views

Process login vs user login

In a Ubuntu 14.04 system, who has the following output: user1 :0 2016-05-02 14:49 (:0) user1 pts/4 2016-05-02 15:10 (:0) So apparently just the pts/4 is used. But, for example, ...
2
votes
2answers
56 views

When opening a terminal does not require a login?

Speaking about Linux and in particular Ubuntu (from 14.04) systems: Case 1 - As pointed out in this answer, processes that allocate a pseudo-terminal don't need to make a login: for example, cups. ...
3
votes
1answer
19 views

Changing the current working directory of a certain process

Can I change the current working directory of a certain process? For example, I am running a process that has the pid 1000. Right now, its current working directory is ~. I want to change its current ...
8
votes
5answers
17k views

monitoring file changes + process access to files

I would like to see what's happening in my app server folders, which files are changed by process x or which *.war files has been changed (replaced/created) in last x minutes. I am software developer ...
0
votes
1answer
30 views

Multithreading (increasing the number of threads for the process)

I wonder if there is any way of adding thread to specific process just to prove that number of thread which are assigned to process can be changed by user. If so, how could I do that ? [root@195689 ...
3
votes
1answer
66 views

Which process sent data out of my computer?

Using vnstat, I observed a lot of uploaded data from my computer and I don't know which process sent data out of my computer. Is there a tool to get stats on how much data a process consumed during a ...
1
vote
1answer
30 views

Command substitution. Spawned process name is identical to the parent one

This script $ cat csub.sh #!/bin/bash while true; do sleep 5 AVAR=$(date; sleep 2) done when started, makes a process appear in the ps output: ps -eLf|egrep '[c]sub.sh|PID' UID PID ...
29
votes
3answers
36k views

Which process has PID 0?

I'm looking for the process started in Linux which has process ID 0. I know init has PID 1 , which is the first process in Linux, is there any process with PID 0?
1
vote
1answer
255 views

Why should I not use 'kill -9' / SIGKILL

Posting this question because I was surprised to not find it directly answered; apologies if this is a duplicate - I did look! I have heard that kill -9 or kill -SIGKILL is bad, but I don't ...
3
votes
2answers
504 views

Redirecting/grep'ing an existing shell's STDOUT

I run a lot of long running processes (simulations) that print progress to STDOUT. I occasionally forget to redirect to STDOUT to a file I can grep, and it's usually too far along to restart. ...
141
votes
11answers
121k views

How can I close a terminal without killing the command running in it?

Sometimes I want to start a process and forget about it. If I start it from the command line, like this: redshift I can't close the terminal, or it will kill the process. Can I run a command in ...
1
vote
2answers
25 views

What is the meaning of Tasks and Running in htop screen?

On my computer it shows Tasks 314; 24 running What do these numbers mean? Is 1 Task = 1 process? Why isn't the number of running tasks = number of CPUs then? (I have more than 24 CPUs) edit. ...
2
votes
1answer
43 views

How to hide a specific process?

The command hidepid is used to prevent users from seeing all processes that do not belong to them, but it doesn't offer the possibility of selecting a specific process. Is it possible to hide only one ...
3
votes
1answer
55 views

How to identify & kill runaway processes that runs, exits, then runs again?

Question How can I identify a program caught in an endless loop; where it runs, dies, then runs again? How can I kill it and prevent it from starting again - is reinstalling the package the only way? ...
5
votes
2answers
4k views

Why pidof and pgrep are behaving differently?

I have a init script in /etc/init.d/myservice for initialize a service like this: ... start() { ... daemon /usr/sbin/myservice ... } stop() { ... pgrep myservice pidof myservice ps -ef ...