Programming :: How Do You List Processes - Get A Process's Std - In|out|err - Stream
Jun 3, 2011How do you list processes, get a process's std(in|out|err) stream, or wait until a process is finished in C?
View 3 RepliesHow do you list processes, get a process's std(in|out|err) stream, or wait until a process is finished in C?
View 3 RepliesI have p1,p2,p3,p4 some processes created by me in C. p1, p2, p3 are started individually from several consoles. And I want process p4 to terminates processes p1, p2, p3 if they are running. Which is the easiest way to accomplish that? put all processes in the same process group and send from p4 a kill signal to the group. But I couldn't do that because I cannot call successfully setpgid(getpid(), 15000) from p1-p4. It's there some way to put them in the same group? the processes don't have a child-parent relationship, they are launched manually from consoles.
View 1 Replies View RelatedI am trying to get a list of running processes using audio (using gstreamer), just like in gnome-volume-control, under applications, but have so far been unsuccessful in finding anything in either the gtk or gstreamer library, anyone out there who can point me in the right direction?
View 1 Replies View RelatedHow to get list of threads of a process using C code in Linux?
View 6 Replies View RelatedI wonder if there's a way to capture the same information I can get from nethogs to a file. All I need it per process (rather than per interface) what is the sent/received traffic.
View 1 Replies View RelatedI have to monitor the %MEM that processes are using, so I use the ps and sort command like this ....
ps -aux | sort -nk4
So this will sort by column 4 so I can see the all the processes that are using the highest %MEM. What I really want is to be able to just display the process name and the %MEM next to it. how to do this?
Optimum number of processes for procesor In Linux based os are there a optimum number of process for a processor that gives 'maximum performance' for system(or process range depend on cpu speed,cache etc...)? By 'maximum performance' I mean better performance?
View 5 Replies View RelatedWhat I need is, given a process id, list all his children without any clutter (table header, other columns than the pid) What I have is :
ps h --ppid $PID Which gives me:
26277 pts/13 S+ 0:10 cmd1
26280 pts/13 S+ 0:10 cmd2
Using h allow me to hide the table header. Is there a way to tell ps to not print the pts/13 S+ 0:10 cmd part in order to get a list of children process ids separated by carriage return?
how can I check which process is using certain port? Like in a table with processes and used ports...
View 3 Replies View RelatedI would like to give a non-root user (nicollet) the ability to detect and send a signal to processes started by Apache2 (those processes are FastCGI scripts and the signal tells them to empty their cache). The processes are owned by the web user (www-data), and I'm running on Debian unstable.
I can't find any way to have the nicollet user see those processes.
The processes are running and can see by both root and www-data:
root@linux-01:~# ps -Af | grep baryton
www-data 17649 17648 0 10:27 ? 00:00:00 baryton
www-data 28145 1 0 Nov01 ? 00:00:12 baryton --bot
root 18701 18700 0 10:46 pts/0 00:00:00 grep baryton
root@linux-01:~#
[Code]....
The most surprising is that the grep process is indeed run by www-data (because it's started from a setuid executable) and is visible, but the baryton process isn't.
What's going on here? Why can ps run by www-data show those processes, but ps run by a setuid executable running as www-data cannot, when it's started by nicollet?
I'm looking for a command that will give me a list of users (unique, dont name my user account 60 times) that are running processes on a system.
View 5 Replies View RelatedHow to tell the kill command to ignore processes if that process is not alive?
For example: 3453 is an alive process but 44534 is not.
kill -9 3453 44534
I would like to set process in background in such a way that it will be running.For example, I started vim editor and pressed CTRL+Z command to put the process in background. But this process is in stopped status, which I can check with 'jobs' command.Is there any way that stopped job can be put into running background process?
View 1 Replies View RelatedHow to kill the processes accessing Internet in background using terminal commands.Command to stop (disconnect) the processes accessing Internet.Command to kill the process accessing Internet.
View 1 Replies View Relatedhow to list the currently running processes via code a shell script. FYI i now about the top method in the terminal but i need a way to have it via a shell script.
View 4 Replies View RelatedI am facing an issue where the process starts hanging. When I closely look at the logs I come to know that some of the child processes that are forked by the parent process are not finished.
1) Is it possible that the child processes that are not finished occupy the socket memory of the parent process and ultimately a point is reached where no socket memory is available to fork new child processes.
2) What is the standard limit of socket memory in linux?
3) What is the fate of such child processes (as I have mentioned above)?
4) How to debug such cases so that the exact problematic area is identified?
well i have just started with shell scripting...how to find all child processes of a parent process given to script as argument.
View 10 Replies View RelatedWhen sending data over the socket, the sending socket includes 0x00 after each sent byte. I wonder how this can be avoided -- I just want to transfer the data in the tx_buffer as it is.
# ./serv &
[1] 6895
# ./EUG 127.0.0.1
EUG: Data to be transmitted: 0x35 0x32 0x30 0xff 0x03 0x31
EUG: Data - #Bytes transmitted: 6
./serv: Here is the message: '5'
[Code]...
How would I list 4 users ID numbered 10, 11, 12 and 13 from my users list and output them to a file busers where their names are numbered by ascending order? How would I accomplish that on a one line command?
View 4 Replies View RelatedI am trying to get this script to work. The purpose is to download a list of modules from the slax.org the list consist of a list of module numbers. What I am trying to do is Download the file or the file name corresponding to the number in the list.the list is comma delimited. this is what I have done so far and I am a stand still.
#!/bin/sh
# Wget script to retrieve modules from slax.org modules
#
# ----Begin of user defined values -----
# Path to wget
[code].....
I have a shell script to identify whether the process is running or not. If the process is not running, then I execute another script file to run my application. Below is my script and saved this script as monitorprocess.sh Code: #!/bin/bash
result=$(ps -ef | grep -v grep | grep "applicationname.sh" | awk '{print $2}')
echo $result
if [ "$result" == "" ];
[code]...
Is there any difference in cpu usage for process in init.rc(runs automatic when boot is happened) and manually running process. Will these both have same priority by default...?
View 1 Replies View RelatedI tried googling but didn't get any answer for this.I have a process called "abc" and it is running with PID "123".I have a putty session opened with PID "999".I am giving kill -TERM 123 from putty session.My process "abc" before dying it should catch the PID of the terminal which provided TERM signal to it.Is there any way to find this out
View 2 Replies View RelatedI've used to check process list in windows to make sure that there's no process running which I don't know, or seems suspicious to me, so I was trying to do the same in Ubuntu 10.4 but actually I don't know what process should be running, and what process shouldn't be and I don't understand the process status if it's running or what as the processes have sleeping status. I don't download softwares from websites only Ubuntu software center "which is safe right?" but I search a lot and visit lot of websites, so I'm completely worried to get infected as I use my credit card, PayPal etc.. by the way I'm using "Google Chrome"
Is there's any software or something like in windows(Antiviruses) to read the content of the website before it loads?
I am trying to set up samba using AD to authenticate users. I did a clean install with the latest version of debian (need at least version 3 of samba for this to work). When I first installed winbind and ran "ps -ef | grep winbind", I could see about 4 instances of winbindd running. I set up kerberos and ran kinit and that ran fine, then tried changing my smb.conf file and restarting samba and winbind. Everything seems to appear normal when I restart the daemons, but when I run "ps -ef | grep winbind", I see nothing running.
View 1 Replies View RelatedI need to stream a webpage to my application and i tried something like this but i get segmentation faults. Is there any example in c and/or gtk that i can peek on.
View 2 Replies View RelatedWhen I run ps fax|grep grep it shows one process like:
How is that possible?
In short our required is that we are creating a share library which can be loaded by a process and that share library analysis the process which load it. Since share library is in address space of the process so I need to find out how many threads created by the process and what is status of their stack trace etc.
So I am looking for a way to get list of threads in running process.
I'm trying to get this rather troublesome (and poorly made, I might add) game to work correctly, and right now it has frozen to a black screen with a frozen cursor. I can't figure out how to shutdown X, but while this game is frozen as it is, I might as well figure out what the process status SL+ means. If anyone has a link to a list of process status codes and their meanings
View 1 Replies View RelatedI'm new to gStreamer and need to determine the bitrate of a stream. Has anyone here worked with this before and does anyone know how to do it?
View 1 Replies View Related