Sponsored Content
Full Discussion: getting pid of process
Operating Systems Solaris getting pid of process Post 302111530 by pressy on Wednesday 21st of March 2007 02:00:54 PM
Old 03-21-2007
hmm, nice found.... didn't know that...

i am always working with pools to get more flexibility between the processor sets... like setting an own scheduler class for the sets or creating a "cpu-load balancing" between several sets....

btw:
short form of you 2 lines could be:
# psrset -b processor_set_id `pgrep myprocessname `

regards pressy
 

10 More Discussions You Might Find Interesting

1. Programming

Child Process PID

Hi, Can anybody solve this query? A parent process forks 2 child processes. How does the child process know it's PID without the parent process sending it. Apart from the "ps-ef" option, what other options are there if any? (2 Replies)
Discussion started by: skannan
2 Replies

2. Shell Programming and Scripting

Process PID

Hi Friends :p I have a little problem please help me out. I have a Unix based OS Sun Server having oracle 8i as database on it. The server has one client with windows OS. The client uses developer 2000 (GUI) to run query and run processes. I want to know how can I know the PID of a process run... (3 Replies)
Discussion started by: vanand420
3 Replies

3. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

4. Shell Programming and Scripting

Get an PID of particular process

Hi I have written a shell script to find and kill the particular process. Here in shell script i have written the code like cnt = $(ps -ef | grep Shree) echo $cnt I am getting the output root 2326 2317 0 14:39:46 pts/1 0:28 Shree -f fdc.fbconf FDCapp.fbapp Here I want to... (2 Replies)
Discussion started by: Shreedhar Naik
2 Replies

5. Shell Programming and Scripting

getting pid from a process

Hi all, i was able to redirect pid of process to a file in the following way ps aux|awk '$11 == "/Applications/ProjectX/DServer" >> /Applications/ProjectX/DServer.pid it works fine but if one folder name caontains space its not working like below ps aux|awk '$11 == "/Applications/Project\... (1 Reply)
Discussion started by: kirankumars
1 Replies

6. Programming

[C] Process pid by name

Hi I use linux OS. I've already written a function that allow me to get the process name by pid. (searching in /proc). Now I'd like to perform the inverse task.I mean get the process pid by its name. I could write a function that search in every folder in /proc for the process name, but i... (2 Replies)
Discussion started by: Dedalus
2 Replies

7. AIX

AIX: PID 0 Process

Hi All, I searched other threads and could not find any relevant post about this. I searched for process 0 in SUN OS and could find the sched/swapper process listed. root 0 0 0 Apr 25 ? 0:06 sched but i couldnt not find the swapper process (PID 0) in AIX. Is that... (4 Replies)
Discussion started by: quintet
4 Replies

8. HP-UX

PID Process Resources

Hi all. I need to get detailed information about a PID. I have an app called Reflection X and it shows many things like Total CPU percent, User CPU (Nice) percent, FS Reads, etc. My question is how can I get all that information on console? Is there an archive with the detailed... (9 Replies)
Discussion started by: the0m3n
9 Replies

9. AIX

Swapper Process #PID more than 1

Hi I would like to know more about swapper process.. I knew that swapper is the first process with PID#0, used to perform process swap operations. It used to swap entire processes But sometimes I find swapper process with PID#264 So my doubt is how many swapper process can exist in a system?... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

10. AIX

How to get process name from PID?

HI, i used ps -ef | grep 3539052 | grep -v grep and i got a output like ths root 3539052 3407918 0 May 07 - 709:31 /usr/sbin/syslogd but what i need is instead of full path /usr/sbin/syslogd i want only the process name that is 'syslogd' here. (3 Replies)
Discussion started by: sumanthupar
3 Replies
psrset(1M)                                                System Administration Commands                                                psrset(1M)

NAME
psrset - creation and management of processor sets SYNOPSIS
psrset -a [-F] processor_set_id processor_id... psrset -b processor_set_id pid [/lwpid]... psrset -c [-F] [processor_id...] psrset -d processor_set_id... psrset -e processor_set_id command [argument(s)] psrset -f processor_set_id psrset [-i] [processor_set_id...] psrset -n processor_set_id psrset -p [processor_id...] psrset [-q] [pid [/lwpid]...] psrset -Q [processor_set_id...] psrset -r [-F] processor_id... psrset -u pid [/lwpid]... psrset -U [processor_set_id...] DESCRIPTION
The psrset utility controls the management of processor sets. Processor sets allow the binding of processes or LWPs to groups of proces- sors, rather than just a single processor. Processors assigned to processor sets can run only LWPs that have been bound to that processor set. This command cannot be used to modify processor disposition when pools are enabled. Use pooladm(1M) and poolcfg(1M) to modify processor set configuration through the resource pools facility. OPTIONS
The following options are supported: -a Assign the specified processors to the specified processor set. With the additional -F option, all LWPs bound to the specified processors will be unbound prior to changing processor sets. This option is restricted to use by the super-user. -b Bind all or a subset of the LWPs of the specified processes to the specified processor set. LWPs bound to a processor set are restricted to run only on the processors in that set. Processes can only be bound to non-empty processor sets, that is, processor sets that have had processors assigned to them. Bindings are inherited, so new LWPs and processes created by a bound LWP have the same binding. Binding an interactive shell to a processor, for example, binds all commands executed by the shell. This option is restricted to use by the super-user. -c Create a new processor set and displays the new processor set ID. With the additional -F option, all LWPs bound to the specified processors will be unbound prior to assigning them to the processor set being created. If a list of processors is given, it also attempts to assign those processors to the processor set. If this succeeds, the proces- sors are idle until LWPs are bound to the processor set. This option is restricted to use by the super-user. Only a limited number of processor sets can be active (created and not destroyed) at a given time. This limit is always be greater than the number of processors in the system. If the -c option is used when the maximum number of processor sets is already active, the command fails. The following format is used for the first line of output of the -c option when the LC_MESSAGES locale category specifies the "C" locale. In other locales, the strings created, processor, and set can be replaced with more appropriate strings corresponding to the locale. "created processor set %d " processor set ID -d Remove the specified processor set, releasing all processors and processes associated with it. This option is restricted to use by the super-user. -e Execute a command (with optional arguments) in the specified processor set. The command process and any child processes are executed only by processors in the processor set. This option is restricted to use by the super-user. -f Disables interrupts for all processors within the specified processor set. See psradm(1M). If some processors in the set cannot have their interrupts disabled, the other processors still have their interrupts disabled, and the command reports an error and return non-zero exit status. This option is restricted to use by the super-user. -F Forces the specified processor set operation by unbinding all threads bound to the specified processor. Only the -a or the -r option can be used in combination with this option. Administrators are encouraged to use the -Q option for pbind(1M) to find out which threads will be affected by such operation. -i Display a list of processors assigned to each named processor set. If no argument is given, a list of all processor sets and the processors assigned to them is displayed. This is also the default operation if the psrset command is not given an option. -n Enable interrupts for all processors within the specified processor set. See psradm(1M). This option is restricted to use by the super-user. -p Display the processor set assignments for the specified list of processors. If no argument is given, the processor set assignments for all processors in the system is given. -q Display the processor set bindings of the specified processes or of all processes. If a process is composed of multiple LWPs which have different bindings and the LWPs are not explicitly specified, the bindings of only one of the bound LWPs is displayed. The bindings of a subset of LWPs can be displayed by appending "/lwpids" to the process IDs. Multiple LWPs may be selected using "-" and "," delimiters. See EXAMPLES. -Q Display the LWPs bound to the specified list of processor sets, or all LWPs with processor set bindings. -r Remove a list of processors from their current processor sets. Processors that are removed return to the general pool of proces- sors. Processors with LWPs bound to them using pbind(1M) can be assigned to or removed from processor sets using the -F option. This option is restricted to use by the super-user. -u Remove the processor set bindings of a subset or all the LWPs of the specified processes, allowing them to be executed on any on- line processor if they are not bound to individual processors through pbind. The super-user can unbind any process or LWP from any active processor set. Other users can unbind processes and LWPs from proces- sor sets that do not have the PSET_NOESCAPE attribute set. In addition, the user must have permission to control the affected pro- cesses; the real or effective user ID of the user must match the real or saved user ID of the target processes. -U Removes the bindings of all LWPs bound to the specified list of processor sets, or to any processor set if no argument is speci- fied. OPERANDS
The following operands are supported: pid Specify pid as a process ID. lwpid The set of LWPIDs of the specified process to be controlled or queried. The syntax for selecting LWP IDs is as fol- lows: 2,3,4-8 LWP IDs 2, 3, and 4 through 8 -4 LWPs whose IDs are 4 or below 4- LWPs whose IDs are 4 or above processor_id Specify processor_id as an individual processor number (for example, 3), multiple processor numbers separated by spaces (for example, 1 2 3), or a range of processor numbers (for example, 1-4). It is also possible to combine ranges and (individual or multiple) processor_ids (for example, 1-3 5 7-8 9). processor_set_id Specify processor_set_id as a processor set ID. EXIT STATUS
The following exit values are returned: 0 Successful completion. non-0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Stability Level |Stable | +-----------------------------+-----------------------------+ SEE ALSO
pbind(1M), pooladm(1M), poolcfg(1M), psradm(1M), psrinfo(1M), processor_bind(2), processor_info(2), pset_bind(2), pset_create(2), pset_info(2), sysconf(3C), libpool(3LIB), attributes(5) DIAGNOSTICS
The following output indicates that the specified process did not exist or has exited: psrset: cannot query pid 31: No such process The following output indicates that the user does not have permission to bind the process: psrset: cannot bind pid 31: Not owner The following output indicates that the user does not have permission to assign the processor: psrset: cannot assign processor 4: Not owner The following output indicates that the specified processor is not on-line, or the specified processor does not exist. psrset: cannot assign processor 8: Invalid argument The following output indicates that an LWP in the specified process is bound to a processor and cannot be bound to a processor set that does not include that processor: psrset: cannot bind pid 67: Device busy The following output indicates that the specified processor could not be added to the processor set. This can be due to bound LWPs on that processor, or because that processor cannot be combined in the same processor set with other processors in that set, or because the proces- sor is the last one in its current processor set: psrset: cannot assign processor 7: Device busy The following output indicates that the specified processor set does not exist: psrset: cannot execute in processor set 8: Invalid argument The following output indicates that the maximum number of processor sets allowed in the system is already active: psrset: cannot create processor set: Not enough space The following output indicates that the pools facility is active. psrset: cannot assign processor 7: Operation not supported psrset: cannot bind pid 31: Operation not supported psrset: cannot bind pid 31: Operation not supported psrset: could not create processor set: Operation not supported psrset: could not remove processor set 1: Operation not supported psrset: cannot exec in processor set 1: Operation not supported psrset: cannot remove processor 7: Operation not supported psrset: cannot unbind pid 31: Operation not supported SunOS 5.10 17 Aug 2004 psrset(1M)
All times are GMT -4. The time now is 11:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy