The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
1answer
48 views

How to detect a desktop application hanging

I want to write a script that will detect whether a particular desktop application is responding and kill it. Is this possible? I know I've seen the GNOME desktop put up a "Application is not ...
0
votes
0answers
34 views

Detach a process from Sh (not Bash) or “disown” for Sh (not Bash)

Consider a shell script executed by Sh, not Bash (and I can't change it, and can't use a shebang, it's ignored). The & operator works, but disown $! does not and makes Sh complains “disown: not ...
70
votes
2answers
5k views

How does Linux “kill” a process?

It often baffles me that, although I have been working professionally with computers for several decades and Linux for a decade, I actually treat most of the OS' functionality as a black box, not ...
5
votes
2answers
49 views

How can I see i/o stats for a briefly running process?

For long running processes like init, I can do things like $ cat /proc/[pid]/io What can I do if I want to see stats for a briefly running process such as a command line utility like ls? I don't ...
0
votes
2answers
41 views

Idiomatic way to kill -9 only if “graceful” way doesn't work?

Is there a common way or existing utility to do the following? kill a process Give it a few seconds to shut down gracefully kill -9 it if it hasn't stopped
5
votes
3answers
30k 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
1answer
44 views

Process management and pkill

I've been studying process management using shell scripts and I'm starting to realise how difficult it is to make sure that it's done right. For example, you can record the PID of a program to a ...
1
vote
3answers
42 views

How can i get the process with the biggest pid?

How can I get the process with the biggest pid using ps?
3
votes
1answer
93 views

What's the correct value to base the maximum number of CPU's to sched_setaffinity to?

I have some confusion as to what's the correct value to use for the number of CPU's I can use to make a CPU_SET for a sched_setaffinity call on my system. My /proc/cpuinfo file: processor : 0 ...
3
votes
1answer
52 views

SIGKILLing after a grace period

I've seen a lot of process managers that try to do this. It was my understanding that you should only use SIGTERM to kill a process. The process could take an unknown amount of time to clean up after ...
7
votes
1answer
152 views

Simulate an unkillable process in D state

For catastrophe testing scenarios on out server environment we're looking for an easy way to make a process stuck in D (uninterruptible sleep) state. Any easy ways? An example C sample code would be ...
0
votes
1answer
36 views

How can I make my command more susceptible to system slowdowns so as to use it as a visual QoS widget on my desktop?

I had some system slowdown event1 after mistakenly using a command so I thought I could use a desktop "widget" to visually show quality of service or at least show when QoS was degraded and get some ...
2
votes
1answer
57 views

how to know the use of my applications?

I want to know how long my programs have been used. For example if I use my web browser I want to know the start and the close time to obtain a total of use time. Basically I want to know when an ...
2
votes
1answer
52 views

kernel event listener

I wonder if there is something similar to an event listener in UNIX that a program can subscribe to? Specifically I want to know: Start and end times of a user session Start and end of the ...
4
votes
2answers
119 views

Process owner vs process user (Gnome's system monitor)

Gnome's system monitor has a "User" column in the Processes tab. There's also an "Owner" column, (that seems to be hidden by default). Most of the processes have the same values on both columns. ...
218
votes
9answers
97k views

When should I not kill -9 a process?

I am always very hesitant to run kill -9, but I see other admins do it almost routinely. I figure there is probably a sensible middle ground, so: When and why should kill -9 be used? When and why ...
0
votes
3answers
4k views

What is the difference between ps and top command?

What is the difference between ps and top command ? I see that both can display information about running processes . Which one should be used when ?
10
votes
2answers
754 views

What does a niceness value of (-) mean?

According to the man page, and wikipedia; nice ranges from -20 to 20. Yet when I run the following command, I find some processes have a non numerical value such as (-). See the sixth column from ...
5
votes
3answers
5k views

What is a command to find priority of process in Linux?

How can i view the priority of a specific process ?
4
votes
2answers
269 views

How can I synchronize processes started in different TMUX panes?

Consider this: tmux split-window -d program1 program2 # this program depends on some side effects produced by program1 In this case, program2 will start before program1 is ready. program1 will send ...
2
votes
2answers
774 views

`[java] <defunct>` with defunct children -> Any way to collect them?

Relating to question : What if 'kill -9' doesn't work? I have following situation : zombie process with threads, not collected by init : [root@Arch64]# ps auxH | grep java gwpl 569 ...
3
votes
1answer
73 views

Reporting cpu hogs

Once in a while some program (ok, usually it's firefox) will start eating up nearly 100% of a processor's cpu time, heating up the processor and driving down by laptop's battery life. Since it's not ...
1
vote
5answers
146 views

Replace instance of process in place?

I suspect this is not doable just because of the security implications, but here's what I'd like to do. Basically we run a bash shell-script on our CentOS server that calls Program-A (in our case ...
1
vote
3answers
122 views

How do I start a server via ssh and have it run after I log out?

I ssh into a virtual server and start up a web server. Everything runs as expected. But when I close my terminal on my laptop, the process dies on the virtual server. How do I fix this?
4
votes
1answer
128 views

What is the default or most commonly used multiprocessing model in Linux? Symmetric or Asymmetric?

What the multiprocessing model for Linux? Is there a default or most commonly used model? Is it similar or very different from say BSD or even the MS Windows kernel? If SMP is used normally, can ...
25
votes
4answers
2k views

python vs bc in evaluating 6^6^6

I am evaluating the expression 6^6^6 using python and bc separately. The content of the python file is print 6**6**6. When I execute time python test.py, I get the output as real 0m0.067s ...
3
votes
1answer
85 views

Better way to kill all processes with a handle to some file

This kills every process with a handle to file /foo/bar (in bash): lsof /foo/bar 2>&1 | grep "/foo/bar" | sed "s/ */\\t/g" | cut -f 2 | while read PID; do kill $PID; done This does not ...
6
votes
3answers
636 views

Simple queuing system?

Given a commodity PC, we would like to use it to execute some tasks in the background round the clock. Basically, we would like to have commands like: add-task *insert command here* list-tasks ...
15
votes
1answer
5k views

What is the maximum value of the PID of a process?

What is the maximum value of the PID of a process? Also, is it possible to change the PID of a running process?
3
votes
2answers
2k views

How to find how many cores a process is using?

I have a eight core machine. How can I find out how many cores are used by processes that I see in htop?
2
votes
2answers
761 views

Removing zombie process from the process table

Can somebody please explain when parent process receives the exit status of a dead child process via wait, who actually reallocates the memory of the child process and removes it from the process ...
13
votes
2answers
19k views

How can I kill a <defunct> process whose parent is init?

Transmission is intermittently hanging on my NAS. If I send SIGTERM, it doesn't disappear from the process list and a <defunct> label appears next to it. If I send a SIGKILL, it still doesn't ...
10
votes
2answers
5k views

How to Throttle per process I/O to a max limit?

I'm looking for a way to limit a processes disk io to a set speed limit. Ideally the program would work similar to this: $ limitio --pid 32423 --write-limit 1M Limiting process 32423 to 1 megabyte ...
0
votes
2answers
161 views

Calculating CPU time of process in RHEL 5.3

For a process management,I would need to remove a process that exceeds a certain amount of CPU time, for example 1 hour.In PS command ,it has TIME parameter shows the total CPU time of a process .So ...
4
votes
3answers
769 views

Why do top and ps show different PIDs for the same processes?

When I run top -H, I see that my multiple mysql threads all have the same PID. However, in ps -eLf I see each one has a different PID: ps -eLf UID PID PPID LWP C NLWP STIME TTY ...
2
votes
1answer
92 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 ...
5
votes
3answers
404 views

Using `kill -s 0 $pid` vs `[[ -e /proc/$pid ]]` to detect if PID is running

One of the idioms often used to check if process is running is to use kill -s 0 $pid. My question is, does it have any upsides over using [[ -e /proc/$pid ]] construct? The script I'm writing is ...
0
votes
0answers
34 views

What could keep a process in 'Runnable' state indefinitely?

I am developing for embedded Linux and I have found a critical bug when stability test is performed. After 1-3 days running at some points the system becomes inoperative. Kernel network stack keep ...
7
votes
2answers
4k views

How to check, which limit was exceeded? (Process terminated because of ulimit. )

Let's assume process runs in ulimited environment : ( ulimit ... -v ... -t ... -x 0 ... ./program ) Program is terminated. There might be many reasons : memory/time/file limit exceeded ; just ...
1
vote
2answers
58 views

What information about a process is retrievable after it is terminated? [duplicate]

After a process has been terminated, is it possible to retrieve any information about it, such as when it started and finished, &c. Is it possible to enable logging of this information?
3
votes
3answers
78 views

Disallow File IO for a process except for FIFOs

How do you start a process that cannot do any file IO (opening / closing files, creating / deleting files, reading / writing files, etc.), except to read and write to pre-created FIFOs? (chroot will ...
2
votes
2answers
199 views

How to make processes not die after its parent dies?

I've been messing with forkbombs and noticed that if I just fork() processes repeatedly, killing the initial process will bring down the whole tree. This is not the case for forkbombs written in BASH ...
1
vote
2answers
139 views

KDE becomes slow

I experience problems with KDE 4.11.1 on Arch Linux. It suddenly becomes laggy and unresponsive and just as suddenly returns to the normal state after some time. Normal CPU load (KSysGuard): ...
0
votes
2answers
126 views

UNIX- Identify which processes are running more that 6hours

I need to know which processes are running more than 6 hours in UNIX. How can I find those out?
8
votes
3answers
1k views

What's the difference between pkill and killall?

I know that pkill has more filtering rules than killall. My question is, what is the difference between: pkill [signal] name and killall [signal] name I've read that killall is more effective ...
11
votes
9answers
4k views

Ensure a process is always running

I started hosting sites a while back using Cherokee. For external sources (FastCGI, etc) it has an option to launch the process if it can't find one running on the designated socket or port. This is ...
16
votes
4answers
2k views

What happens if you edit a script during execution?

I have a general question, which might be a result of misunderstanding of how processes are handled in Linux. For my purposes I am going to define a 'script' as a snippet of bash code saved to a text ...
0
votes
1answer
705 views

Rsync from multiple folders to one

Is it safe to have multiple folders Rsync simultaneously into one? Each of the source folders contains a subset of the destination folder, and everybody just syncs into a master destination folder. I ...
3
votes
2answers
279 views

Why can't pgrep find scripts started via env?

For example: $ cat foo.sh #!/usr/bin/env bash while true; do sleep 1 ; done $ ./foo.sh & $ pgrep foo.sh $ Contrast with: $ cat bar.sh #!/bin/bash while true; do sleep 1 ; done $ ./bar.sh & ...
1
vote
2answers
469 views

Mysterious bash instances using a lot of CPU, how can I debug?

I seem to have multiple bash processes running that are taking up most of my CPU. This is the output of top -c: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 20116 ...