A process is an instance of a computer program that is being executed.
4
votes
2answers
30 views
Dynamic file content generation: Satisfying a 'file open' by a 'process execution'
I have a read-only file, F.
A program, P, that I'm not the author of, needs to read F.
I want the content of F to come from another 'generator' program, G, whenever P tries to read F (taking F to ...
0
votes
2answers
39 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 the Plink program set to execute commands in a script using automated login:
plink -ssh [domain name] -l ...
3
votes
3answers
34 views
Print process ID (PID) of a Matlab instance
To run my Matlab scripts, I've created a shell script to which I give two parameters - the path to the matlab file ($1) and to the log file ($2):
nohup time matlab -some_parameters -r "run $1;exit" ...
0
votes
1answer
54 views
How to kill the (last - 1) PID with bash
I know how to kill the last process with
kill $!
However I would like to kill the last - 1 process, ie not the last one, but the one before the last one.
I tried
kill $$(($! -1))
but it ...
2
votes
4answers
62 views
Open program as root, close root session but still program is running
When I run my backup script, first I switch to root, mount a truecrypt partition and then run the script.
I've noticed that after run truecrypt as root, I can exit the root session and truecrypt ...
0
votes
0answers
37 views
Tracing system call on Ubuntu 12.04
The main task I have to carry out, is to trace the system call of processes in ubuntu 12.04 LTS.
Problem is, I am unable to trace them continuously, i.e. as soon as they are added to the system, they ...
4
votes
3answers
61 views
Can I pipe any two processes to each other?
In this page from The Design and Implementation of the 4.4BSD Operating System, it is said that:
A major difference between pipes and sockets is that pipes require a
common parent process to set ...
-1
votes
1answer
37 views
System call tracing [closed]
I am working on system call tracing for host based IDS, i need to trace a process as soon as it entered in the system (a new entry in /proc). Is there any interrupt or signal or kernel datastructure ...
2
votes
4answers
92 views
pkill can't kill processes with parent process id 1
I want to kill the following processes using
pkill "run_tcp_sender.sh"
or
pkill -SIGKILL "run_tcp_sender.sh"
root 14320 1 0 2012 ? 00:00:00 bash run_tcp_sender.sh ...
1
vote
1answer
33 views
How to trace process scheduling of certain process?
For a project at my university I am researching ways to trace, log and manipulate the process scheduling of certain processes. I would like to launch an number of applications, everyone in a single ...
1
vote
2answers
27 views
Single process accessible temporary file
I want to create a file that is only accessible to the process that created it (and potentially its children), and that disappears when the process exits, ideally never persisting the file to disk. As ...
4
votes
1answer
41 views
Suspend and edit previous single line commands
Say I want to modify the latter of some concatenated command line options, is it possible without killing the first command?
Specifically I have compile and run scripts executed thusly:
> compile ...
5
votes
2answers
126 views
What does it mean each process has a current directory?
I'm reading "The Unix Programming Environment", but I don't comprehend the concept current directory of process.
Each process, has a current directory, and all filenames are
implicitly assumed ...
0
votes
0answers
29 views
dynamic pool of process C [migrated]
I'm writing program in UNIX on C. I have to write client-server(TCP) program on sockets. Client sends some information and server answer. No matter what client sends or receives because I successfully ...
4
votes
1answer
52 views
Kill user processess on logout
I have a Ubuntu server that handles remote X sessions from users. However, I don't want to allow users to run any kind of background processes - so here is my question:
How do I prevent users from ...
4
votes
5answers
98 views
Is a persistent zombie process sign of a bug?
(OS: Debian variant.)
Having a process with zombie-status. The PPid belonged to a gvim process.
The contents of /proc/[pid]/wchan is do_exit,
/comm is sh and /cmdline is empty, /status is shown ...
-1
votes
1answer
18 views
How to check the ports of Main and dependent Programs [closed]
we can see the ports using the Netstat -tulpn, e.g netstat -tulpn |grep program.
But what is there is program that has multiple modules dependent on main program. How we will know what ports are they ...
3
votes
3answers
32 views
How can you change the process name of Wing IDE from python to something more descriptive
In my process list under Ubuntu (using top/System Monitor) one of the largest memory hogs (200+Mb) was python. I searched a bit for one of my programs to be the cause until I realised this was my ...
2
votes
1answer
119 views
How to find Heap memory of a running process? [duplicate]
I would Like to know how to find the heap captured of a process which is running in the background?
Is there any command by which you can find the process heap memory and here the process is still ...
2
votes
1answer
62 views
How to demonstrate invalid PID assumptions?
It seems many programmers are happy with saving a PID to a file, and then later read and use the PID as if it was guaranteed to be the same process. It seems the general idea is that the odds are good ...
1
vote
1answer
48 views
List of killed processes HP-UX
Is there a file similar to the one in this answer http://unix.stackexchange.com/a/10078/5027 to determine the processes which were killed, in a certain time, for example, yesterday, in HP-UX?
1
vote
1answer
58 views
Do kernel counters for jiffies in state exist in Linux?
I am looking to get time/jiffie stats on the state of a daemon process. The states I'm referring to are mentioned in the Linux Kernel Proc Filesystem document. Running, Sleeping, uninterruptible ...
-1
votes
0answers
47 views
Client-Server with unnamed pipes and select [closed]
I try to write simple client-server program using fork(), pipe() and select(). Parent process is a server, which select pipe with data from client by FD_ISSET and write data to other clients. And ...
2
votes
3answers
111 views
How do I start a process with a nice value of -20 and not give it root privilege?
I would like to start a process with a nice value of -20. This requires me to use a command like - sudo nice -n -20 matlab. However, this starts matlab as root too. Is there a way to have matlab as ...
0
votes
0answers
29 views
Pass process ownership to another shell [duplicate]
I didn't hear of anything like this, but It might be possible.
I often end up starting a process on a server and midway realizing that I would like to suspend that process and continue it inside a ...
1
vote
1answer
32 views
Looking for /procfs documentation, describing values and units of measurement
Surprisingly, comprehensive documentation for /procfs is hard to find.
For my specific question, I am looking at: cat /proc/1/statm (let's use pid=1 because it seems to be always there). I just ran ...
1
vote
2answers
45 views
Tracking which files are used by program
I am looking for a way to track which files are used by program installer(InstallAnywhere). I cannot use lsof because as far as I know it works on active processes and I want a tool which will work ...
1
vote
2answers
61 views
How to decrease ps aux output to a few lines?
When my computer is slowing down, I usually run ps aux --sort -rss to find out which process consumes too much memory. There may be a lot of processes. How to see only a few ones?
0
votes
4answers
114 views
Show running processes with file name(s)?
I am using putty to connect my linux server which my sites are in. I can run
# ps aux | less
to show running processes. But I want to display which files running these processes ?
I have also ...
2
votes
2answers
69 views
End process from another SSH window
I forgot to use screen and I have a task that has been running for quite some time, and I do not want to lose the saved data. Basically Ctrlc will end the task and save the data if I am on the same ...
0
votes
1answer
54 views
Move terminal emulator process from xorg to tty? [duplicate]
Is it possible (and if so, how?) to move a process from a terminal emulator running in X to a different virtual terminal, so that I can restart the X server without killing the process running in the ...
1
vote
1answer
58 views
How to watch pgrep?
When running a pgrep command with watch it does not only show the actual pgrep output, but also the watch process as well.
Example:
watch pgrep -lf donothing
will show 3 processes, although
...
2
votes
2answers
99 views
Where is the virtual memory stored on hard drive?
If a process wants to access a memory address that is not in physical memory, the OS outsources a page frame from physical memory to the hard drive for later use. Where on the hard drive is this data ...
1
vote
3answers
125 views
Block network access of a process?
Is it possible to block the (outgoing) network access of a single process?
1
vote
4answers
164 views
kill a group of processes with negative PID
kill -TERM -PID
is supposed to kill PID and all its child processes.
but this doesn't work on openSUSE, it always tell me that no such process -PID no matter what PID i use.
So if the negative PID ...
1
vote
2answers
82 views
How to know if a background job is finished?
I invoke a script (do_something) in background via another script (do_manythings) as below.
nohup do_something &
How would I know in the parent script (do_manythings) that the job invoked ...
1
vote
2answers
68 views
Invoke a command/script disconnected from the controlling terminal?
I'm investigating the behaviour of a script that is normally run as an automated process (e.g. cron, Jenkins). The script can (eventually) invoke commands that behave differently (seeking user input) ...
1
vote
1answer
61 views
What rules govern the parent-child relationship of processes launched by shell across a pipe?
#!/bin/ksh
# start_service: start the service
my_server_executable 2>&1 | my_pipe_following_shell_script &
exit 0
After I run the above start_service script from command line, it is ...
3
votes
3answers
159 views
What after exec() in ls command. Is the parent process printing the output to the console or the child?
I have a simple doubt on execution of the command ls. As per my understanding from the research I have done on the internet, I understood the below points.
When we type ls command shell interprets ...
11
votes
4answers
282 views
Is there a top-like command that shows the network bandwidths and file accesses of running processes
For example, we'd like to see:
PROCESS IF TX RX FILE(regular) R/W
prog1 eth0 200kB/s 12kB/s -- --
wlan0 12kB/s 100kB/s -- ...
3
votes
0answers
78 views
Elegantly get list of descendant processes
I would like to get a list of all the processes that descend (e.g. children, grand-children, etc) from $pid. This is the simplest way I've come up with:
pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ ...
2
votes
1answer
215 views
Linux : See CPU usage by a process for the last second
vmstat 1
Above will print virtual memory statistics each seconds. It will also show the CPU utilization for last second.
I have a web server at hand which runs httpd and MySQL. I need to find how ...
4
votes
1answer
78 views
Elegantly get list of children processes
I would like to get a list of all the processes whose parent is $pid. This is the simplest way I've come up with:
pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ /g" |sed "s/\s\s*/ /g"
Is there any ...
2
votes
1answer
199 views
What does kill 0 do actually?
In the man page, it says:
kill [ -s signal | -p ] [ -a ] [ -- ] pid ...
pid... Specify the list of processes that kill should signal. Each pid can be one of five things:
0 All ...
1
vote
2answers
177 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 ...
3
votes
3answers
152 views
Running multiple nohup commands in background
Got two commands cmd1 and cmd2. Of the two, cmd2 takes longer to finish. Need to run cmd2 and then cmd1.
Tried to run them in following way:
bash$ (nohup ./cmd2>result2 &) && nohup ...
2
votes
3answers
138 views
Why does Firefox refuse to die despite killing it with pkill -9?
I am issuing the following command to kill Firefox on my Red Hat Linux box:
[subhrcho@slc04lyo ~]$ pkill -9 -f firefox
[subhrcho@slc04lyo ~]$
However, when I try to invoke Firefox through ...
0
votes
2answers
65 views
Which process updates /proc/scsi/scsi?
I wrote C that displays info about my hardware on ubuntu. Now I wonder how I can make it more flexible such as querying the hardware directly instead of the file the os updates. So I think I can look ...
16
votes
1answer
490 views
How does systemd survive a kill -9?
Between the recent "Why does 'kill -9 0' end my console session" and "How to get a kernel panic" questions, I got a bur under my saddle and tried kill -9 1 on a mostly up-to-date Arch linux laptop. I ...
2
votes
2answers
65 views
what happens when a window manager is put to background
I am trying to understand the situation why .xsession file expects the last process to be in foreground otherwise it is supposed to stop X11 session.
I have a small stand-alone script. when I run ...

