Sponsored Content
Full Discussion: prstat in shell
Top Forums Shell Programming and Scripting prstat in shell Post 302106083 by madmat on Tuesday 6th of February 2007 12:35:26 PM
Old 02-06-2007
Exactly, I just want to launch prstat and use the output inside a shell.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with prstat

Hello, The last line of prstat shows load average. I am unable to figure out what actually it is. I have read the man pages and also googled, all for no use. Can somebody help me, as to what should be the avg. load of the system for best performance and how is this load of prstat calculated. (6 Replies)
Discussion started by: vibhor_agarwali
6 Replies

2. Shell Programming and Scripting

stop Prstat using shell script

How to stop the Prstat using shell script ? because after i run the below script the thing seems to be always in loop and cannot get out till i ctrl + c, is there anything that i can add in the script to make it terminate ? <code> #!/bin/sh prstat -Tc -u testing > testing.txt </code> ... (19 Replies)
Discussion started by: filthymonk
19 Replies

3. Solaris

prstat log

Hi All, But the prstat logs of my system shows:- NPROC USERNAME SWAP RSS MEMORY TIME CPU 77 oracle 17G 10G 65% 4:24:47 0.8% Total: 486 processes, 3850 lwps, load averages: 3.77, 4.45, 4.94 What does the MEMORY denotes? Is it the %memory used from RAM? Or is the %memory used by... (10 Replies)
Discussion started by: dipashre
10 Replies

4. Solaris

prstat O/P

Good Evening everyone, I am confused about prstat O/P as it shows memory values which are different from actual value.Below is the O/P of prstat command and swap commands. NPROC USERNAME SIZE RSS MEMORY TIME CPU 48 root 2113M 1590M 1.2% 45:09.39 32% 31 daemon ... (7 Replies)
Discussion started by: vvpotugunta
7 Replies

5. Solaris

prstat output

Can someone please explain me the "TIME" field of the output of "prstat -p<pid>" command ? The man page says it is "The cumulative execution time for the process". Does it mean how many hrs:min:sec the process is running ? If so then I'm not getting the desired output. Can someone pls help me in... (5 Replies)
Discussion started by: senabhi
5 Replies

6. Shell Programming and Scripting

prstat

hi all, am writing a ksh script on solaris 9 to get the number of threads taken by a process. am using the prstat -p command to do this. output i get is : :"/export/home/user" > prstat -p 25528 | cut -f2 -d/ NLWP 203 Total: 1 processes, 203 lwps, load averages: 2.58, 3.24, 3.62... (2 Replies)
Discussion started by: cesarNZ
2 Replies

7. Solaris

prstat

hi all, was trying to figure out how busy my app was by looking at the performance of the app server. did a 'prstat -s rss' command to find the app servers using most memory. Found a command 'prstat -m' which is meant to show more details on each pid but the output of this command... (1 Reply)
Discussion started by: cesarNZ
1 Replies

8. Shell Programming and Scripting

prstat output

hi all, have a ksh script where i am doing a prstat -m -u osuser 1 1 >> $FILE_NAME but for some reason it only writes 15 lines wheres when i run the same command manually from command prompt it prints out 60 lines. why is it not writing the full 60 lines to the file ?? ta. (1 Reply)
Discussion started by: cesarNZ
1 Replies

9. Solaris

prstat on Solaris 8

On Solaris 8, when I try to run prstat 30 5 as a background process, the command exits 1-2 seconds after it's initiated instead of the 30 seconds I specified. It runs fine in interactive mode. Is there a workaround to this I could use? (Upgrading the package is not an option) A link to... (1 Reply)
Discussion started by: Devyn
1 Replies

10. Solaris

Understanding prstat

Hello We have a SPARC box running Solaris 10. We have 32 GB of physical memory, 32 GB of swap. Now i want to monitor memory usage for performance tuning. The box is running Sybase database. When I type prstat i get the following PID USERNAME SIZE RSS STATE PRI NICE TIME CPU... (4 Replies)
Discussion started by: abohmeed
4 Replies
dbus-launch(1)						      General Commands Manual						    dbus-launch(1)

NAME
dbus-launch - Utility to start a message bus from a shell script SYNOPSIS
dbus-launch [--version] [--sh-syntax] [--csh-syntax] [--auto-syntax] [--exit-with-session] [--autolaunch=MACHINEID] [--config-file=FILE- NAME] [PROGRAM] [ARGS...] DESCRIPTION
The dbus-launch command is used to start a session bus instance of dbus-daemon from a shell script. It would normally be called from a user's login scripts. Unlike the daemon itself, dbus-launch exits, so backticks or the $() construct can be used to read information from dbus-launch. With no arguments, dbus-launch will launch a session bus instance and print the address and PID of that instance to standard output. You may specify a program to be run; in this case, dbus-launch will launch a session bus instance, set the appropriate environment vari- ables so the specified program can find the bus, and then execute the specified program, with the specified arguments. See below for exam- ples. If you launch a program, dbus-launch will not print the information about the new bus to standard output. When dbus-launch prints bus information to standard output, by default it is in a simple key-value pairs format. However, you may request several alternate syntaxes using the --sh-syntax, --csh-syntax, --binary-syntax, or --auto-syntax options. Several of these cause dbus-launch to emit shell code to set up the environment. With the --auto-syntax option, dbus-launch looks at the value of the SHELL environment variable to determine which shell syntax should be used. If SHELL ends in "csh", then csh-compatible code is emitted; otherwise Bourne shell code is emitted. Instead of passing --auto-syn- tax, you may explicitly specify a particular one by using --sh-syntax for Bourne syntax, or --csh-syntax for csh syntax. In scripts, it's more robust to avoid --auto-syntax and you hopefully know which shell your script is written in. See http://www.freedesktop.org/software/dbus/ for more information about D-Bus. See also the man page for dbus-daemon. EXAMPLES
Distributions running dbus-launch as part of a standard X session should run dbus-launch --exit-with-session after the X server has started and become available, as a wrapper around the "main" X client (typically a session manager or window manager), as in these examples: dbus-launch --exit-with-session gnome-session dbus-launch --exit-with-session openbox dbus-launch --exit-with-session ~/.xsession If your distribution does not do this, you can achieve similar results by running your session or window manager in the same way in a script run by your X session, such as ~/.xsession, ~/.xinitrc or ~/.Xclients. To start a D-Bus session within a text-mode session, you can run dbus-launch in the background. For instance, in a sh-compatible shell: ## test for an existing bus daemon, just to be safe if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then ## if not found, launch a new one eval `dbus-launch --sh-syntax` echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS" fi Note that in this case, dbus-launch will exit, and dbus-daemon will not be terminated automatically on logout. AUTOMATIC LAUNCHING
If DBUS_SESSION_BUS_ADDRESS is not set for a process that tries to use D-Bus, by default the process will attempt to invoke dbus-launch with the --autolaunch option to start up a new session bus or find the existing bus address on the X display or in a file in ~/.dbus/ses- sion-bus/ Whenever an autolaunch occurs, the application that had to start a new bus will be in its own little world; it can effectively end up starting a whole new session if it tries to use a lot of bus services. This can be suboptimal or even totally broken, depending on the app and what it tries to do. There are two common reasons for autolaunch. One is ssh to a remote machine. The ideal fix for that would be forwarding of DBUS_SES- SION_BUS_ADDRESS in the same way that DISPLAY is forwarded. In the meantime, you can edit the session.conf config file to have your ses- sion bus listen on TCP, and manually set DBUS_SESSION_BUS_ADDRESS, if you like. The second common reason for autolaunch is an su to another user, and display of X applications running as the second user on the display belonging to the first user. Perhaps the ideal fix in this case would be to allow the second user to connect to the session bus of the first user, just as they can connect to the first user's display. However, a mechanism for that has not been coded. You can always avoid autolaunch by manually setting DBUS_SESSION_BUS_ADDRESS. Autolaunch happens because the default address if none is set is "autolaunch:", so if any other address is set there will be no autolaunch. You can however include autolaunch in an explicit session bus address as a fallback, for example DBUS_SESSION_BUS_ADDRESS="something:,autolaunch:" - in that case if the first address doesn't work, pro- cesses will autolaunch. (The bus address variable contains a comma-separated list of addresses to try.) The --autolaunch option is considered an internal implementation detail of libdbus, and in fact there are plans to change it. There's no real reason to use it outside of the libdbus implementation anyhow. OPTIONS
The following options are supported: --auto-syntax Choose --csh-syntax or --sh-syntax based on the SHELL environment variable. --binary-syntax Write to stdout a nul-terminated bus address, then the bus PID as a binary integer of size sizeof(pid_t), then the bus X window ID as a binary integer of size sizeof(long). Integers are in the machine's byte order, not network byte order or any other canonical byte order. --close-stderr Close the standard error output stream before starting the D-Bus daemon. This is useful if you want to capture dbus-launch error messages but you don't want dbus-daemon to keep the stream open to your application. --config-file=FILENAME Pass --config-file=FILENAME to the bus daemon, instead of passing it the --session argument. See the man page for dbus-daemon --csh-syntax Emit csh compatible code to set up environment variables. --exit-with-session If this option is provided, a persistent "babysitter" process will be created that watches stdin for HUP and tries to connect to the X server. If this process gets a HUP on stdin or loses its X connection, it kills the message bus daemon. --autolaunch=MACHINEID This option implies that dbus-launch should scan for a previously-started session and reuse the values found there. If no session is found, it will start a new session. The --exit-with-session option is implied if --autolaunch is given. This option is for the exclusive use of libdbus, you do not want to use it manually. It may change in the future. --sh-syntax Emit Bourne-shell compatible code to set up environment variables. --version Print the version of dbus-launch NOTES
If you run dbus-launch myapp (with any other options), dbus-daemon will not exit when myapp terminates: this is because myapp is assumed to be part of a larger session, rather than a session in its own right. AUTHOR
See http://www.freedesktop.org/software/dbus/doc/AUTHORS BUGS
Please send bug reports to the D-Bus mailing list or bug tracker, see http://www.freedesktop.org/software/dbus/ dbus-launch(1)
All times are GMT -4. The time now is 10:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy