Archive for February, 2008

Most popular web site - Processes with killallpkillis a bit aggressive, and if

Sunday, February 24th, 2008

Processes with killallpkillis a bit aggressive, and if you re notcareful, it can kill processes that you don tintend to harm. If you want to kill a collectionof processes, exercise some caution and usekillallinstead. killallisn t as flexible as pkillwhen it comes toselecting processes, but it has one very nice feature: interactive mode. killallselects processes basedon program name. When you run killall, use the –interactiveoption (or -ifor short) to tell killallto prompt you before it kills each process: $ pgrep -lf more10512 more mozilla/run-mozilla.sh10513 more /etc/passwd$ killall –interactive moreKill more(10512) ? (y/n) yKill more(10513) ? (y/n) nLike pkill, killallsends SIGTERM by default. If you want to send a different signal, use the –signalsignal-nameoption: $ killall -i –signal SIGKILL moreKill more(10512) ? (y/n) yKill more(10513) ? (y/n) nClosing Windows with xkillOnce in a while, a window appears on your desktop, and you just don t know where it came from. It mightbe a pop-up ad from a piece of spyware, an annoyingmessage from a program running in the background, or just a program that forgot to identify itself. If youdon t know the name of the program that created thewindow, you can t kill it with kill, pkill, or killall. You need xkill, which kills off a program when youclick the program s window. To see xkillin action: sound confusing if you re not familiar with the bashcommand substitution feature, so it may help tobreak the command down a bit. Assume that thepgrepcommand returns three process IDs: $ pgrep -U freddie,franklin552378798256bash substitutes the output from pgrepinto the pscommand like this: $ ps -l –pid 5523 7879 8256You can feed the output from pgrepinto anyprogramthat expects a list of process IDs, such as kill. To killall processes owned by user freddie, you cancom- bine pgrepand killlike this: $ kill $(pgrep -U freddie) Killing Processes with pkillAn easy way to kill off unwanted processes is pkill. pkillis nearly identical to pgrep(in fact, you canselect processes using the same criteria in Table 39-3, which you can find earlier in this technique) exceptthat pkillkills the matching processes instead ofdisplaying matching process IDs. To kill all processesowned by user freddie, use the following command: $ pkill -U freddiepkill(and its cousin, kill) work by sending a signalto the targeted process. By default, pkillsends theSIGTERM signal to suggestthat the target process ter- minate itself. If you find a program that s not willingto honor SIGTERM, you can be more forceful byusing the -SIGKILLoption: $ pkill -SIGKILL -U freddieYou can send any signal with pkill. For a completelist of signals (and their meanings), see man 7 signal.
From our experience, we can recommend PHP5 Web Hosting services, if you need affordable webhost to host and run your web application.

. . . that output is a (Ipower web hosting) bit

Sunday, February 24th, 2008

. . . that output is a bit terse. Use the -loption to display the program name as well as theprocess ID: $ pgrep -l mozilla5385 run-mozilla.sh5391 mozilla-bin5393 mozilla-bin5395 mozilla-bin5400 mozilla-binpgrepmatches program names based on regularexpressions (that is, wildcards), so it displaysprocesses whose names includemozilla. For a com- plete rundown on the regular expression syntaxunderstood by psgrep, see the manpage for regex(info regex). If you want an exact match (not a regu- lar expression match), use the -xoption. By default, pgrepmatches the patternthat you provide againstthe program name for each process. To match thepatternanywhere in the command line (not just inthe program name), include -fon the command line: $ pgrep -fl mozilla5385 /usr/ local/mozilla/run-mozilla.sh 5391 /usr/local/mozilla/mozilla-bin5393 /usr/local/mozilla/mozilla-bin5395 /usr/local/mozilla/mozilla-bin5400 /usr/local/mozilla/mozilla-bin9388 more run-mozilla.shNotice process 9388: The program running there is more, but because the command line argumentsinclude mozilla, pgrepdisplays it. pgrepcan also find processes based on the criteriashown in Table 39-3. TABLE39-3: PGREPOPTIONSTHATLOOKFORMATCHINGDATAOptionDescription-P pidSelects processes whose parent isprocess pid-g process-groupSelects processes belonging toprocess group process-groupOptionDescription-s session-IDSelects processes belonging to thelogin session session-ID-u userSelects processes whose effectiveuser IDs match user(usercan be auser name or a numeric user ID) -U userSelects processes whose real userIDs match user(usercan be a username or a numeric user ID) -G groupSelects processes whose effectivegroups match group(groupcan bea group name or a numeric group ID) -T terminalSelects processes associated withterminal (or pty) terminalIn addition to the matching options described inTable 39-3, you can negate the criteria with the -voption. For example, to find all the processes notowned by user root, use this command: $ pgrep -U root -vYou can also tell pgrepto display only the mostrecent process that matches your criteria. To do so, just include -non the command line like this: $ pgrep -n xmmsThat s handy if you want to find the most recentlyinvoked copy of a program. As explained earlier, pgrepdisplays a list of processIDs by default, but you may want to see more infor- mation. To help pgrepovercome its minimalism, youfeed the output from pgrep(the list of processes thatmatch your criteria) into another program that knowshow to use a process ID. For example, here s how tosee detailed information about all the processesowned by user freddieor by user franklin: $ ps -l –pid $(pgrep -U freddie,franklin) The bash shell first executes the command insidethe parentheses and then builds a new commandthat incorporates the output from pgrep. That might48_
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

Figure 39-4: pstreehighlight mode. If you want to (Crystaltech web hosting)

Sunday, February 24th, 2008

Figure 39-4: pstreehighlight mode. If you want to see the descendents of a specificprocess, include the process ID at the end of thecommand, like this: $ pstree 5296To see the processes for a particular user, includethe user name at the end of the command line: $ pstree freddieFinding processes with pgreppsand pstreeare useful tools when you want to seethe big picture, but it can be tough to find the processyou re looking for in a long list. That s where pgrepcomes in. pgreplets you search for specific processesbased on a number of process characteristics. To search for processes running a particular program, run pgrep pattern. For example, here s how to searchfor all processes running mozilla: $ pgrep mozilla5385 5391 5393 5395 5400 Figure 39-2: pstree -adisplays command linearguments. Figure 39-3: pstree -pdisplays process IDs. pstreehas a few more options that you might finduseful: -hhighlights your current process and all ances- tors (see Figure 39-4), making it easy to find your- self in a complex listing. -ushows the user name associated with eachprocess. (Actually, -udisplays the user nameonly when it changes from parent to child.)
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

parent-child relationships stand out in a ps listingWhen (Web host 4 life)

Saturday, February 23rd, 2008

parent-child relationships stand out in a ps listingWhen you re looking at a long pslisting, it s difficultto discern the parent-child relationships amongprocesses. pshas two command line options thatmake that relationship a little easier to see. The -Hoption indents child processes; each gen- eration is indented a bit more than the previous generation: $ ps -AHPID TTY TIME CMD1 ? 00:00:04 init4993 ? 00:00:00 atd4647 ? 00:00:00 crond5022 ? 00:00:00 dbus-daemon-14240 ? 00:00:00 dhclient5045 ? 00:00:00 gdm-binary5175 ? 00:00:00 gdm-binary5176 ? 00:07:43 X5197 ? 00:00:00 startkde5323 ? 00:00:00 kwrapper5256 ? 00:00:00 ssh-agent…. . …….. …………….. You can see from this example that the initprocess(process ID 1) is that ancestor of all the otherprocesses. Process 5175 is the parent of two children(5176 and 5197) and the grandparent of process 5323and process 5256. To see a slightly fancier display, use the –forestoption instead of -H: $ ps -AH –forestPID TTY TIME CMD1 ? 00:00:04 init4993 ? 00:00:00 atd4647 ? 00:00:00 crond5022 ? 00:00:00 dbus-daemon-14240 ? 00:00:00 dhclient5045 ? 00:00:00 gdm-binary5175 ? 00:00:00 \_ gdm-binary5176 ? 00:07:48 \_ X5197 ? 00:00:00 \_ startkde5256 ? 00:00:00 \_ ssh-agent5323 ? 00:00:00 \_ kwrapper…. . …….. …………….. Personally, we find the –forestoption a tadconfusing; we prefer the pstreecommandinstead. See the next section for details onpstree. Climbing the family tree with pstreepstreeis similar to the pscommand, but it has farfewer options. When you run pstree, you see a graphof processes running on your system, similar to thatshown in Figure 39-1. Figure 39-1: Output from the pstreecommand. You can see that pstreemakes the process tree easyto see. By default, pstreecompresses the processtree by removing duplicate branches from the dis- play. You can see all the processes running on yoursystem by including the -c, -a, or -poption: -csimply disables compression. -atells pstreeto display the command line argu- ments for each process, as shown in Figure 39-2. -pforces pstreeto add process IDs to the graph, as shown in Figure 39-3. You can use the -pand -aoptions in the samereport. The command $ pstree -paincludesin the output the command line arguments forthe process as well as the process ID.
Searching for affordable and reliable webhost to host and run your web applications? Go to our java web server services and you will be pleased.

you put a minus sign in front of (Professional web hosting)

Saturday, February 23rd, 2008

you put a minus sign in front of a sort specifier, youreverse the ordering. For example, the command$ ps –sort cmd,-pidsorts processes first by command name (in ascend- ing, or A Z, order) and then by process ID indescending (999999 1) order. pscomes preloaded with a few predefined outputformats that display the information you re mostlikely to need. The default output format shows theprocess ID, tty, CPU time, and user name. The -l(orlong) format displays a ton of information about thestate of the process (priority, state, process size, andso on). The uoption (note: u, not -u) displays user- oriented information (percentage of CPU time, per- centage of available memory, and such). If you experiment with ps, you ll probably findthat you frequently use a few output optionsin combination. Use the aliascommand (partof the bash shell) to create new commandsthat correspond to the options that you prefer. For example, to create a new commandnamed psuthat displays user-oriented processinformation, use the following command: $ alias psu= ps -opid,euser,ruser,%cpu,%mem,command Now, when you type the command psu, yousee only the columns that you re interested in. Of course, you can specify other options when yourun the psucommand: $ psu -C bashPID EUSER RUSER %CPU %MEM COMMAND9318 freddie freddie 0.0 0.3 bash9380 franklin franklin 0.0 0.2 bash9428 root root 0.0 0.2 bashSee Technique 10 to find out how to save bashaliases so they re available every time you log in. TABLE39-2: PSCOLUMNSPECIFIERSColumn NameDescription%cpuPercentage of CPU time used by process%memPercentage of memory used by processCommCommand nameArgsCommand line argumentsCommandCommand name plus command line argumentegroupEffective group nameegidEffective group ID (numeric) rgroupReal group namergidReal group ID (numeric) euserEffective user nameeuidEffective user ID (numeric) ruserReal user nameruidReal user ID (numeric) PidProcess IDStatProcess state (running, sleeping, waitingfor I/O, and so on) CputimeCumulative CPU timeTtyTerminal nameDon t worry about memorizing the list of columnspecifiers; use the command ps L(that s L, not -L) to display the complete list. Normally, psdisplays process information in processID order. You can choose your own ordering with –sort column. For example, to list processes inincreasing order by command name, use the follow- ing command: $ ps –sort cmdYou can use any of the column specifiers displayedby ps L. If you want to sort first by command nameand then by process ID, use this command: $ ps –sort cmd,pid48_
In case you need quality webspace to host and run your web applications, try our personal web hosting services.

pscommand was inherited from UNIX. (Web design course) That s an oversimplification

Friday, February 22nd, 2008

pscommand was inherited from UNIX. That s an oversimplification because many fla- vors of UNIX have existed (HP/UX, AIX, BSD, Digital UNIX, SCO UNIX, and so on). Linuxuses the standard GNU version of ps. As aresult, the pscommand supports a wide vari- ety of command line options. Save yourselfsome time and learn the portable (that is, long- format) command line options. For example, use ps –pid 1instead of the equivalent ps-p 1. The long-form options require a bit moretyping, but they re much easier to remember. If you want to see allthe processes running on yoursystem, add -Ato the end of the command line, likethis: $ ps -APID TTY TIME CMD1 ? 00:00:04 init2 ? 00:00:00 keventd3 ? 00:00:00 kapmd4 ? 00:00:00 ksoftirqd/06 ? 00:00:00 bdflush…. …….. …….. ……….. 5039 tty1 00:00:00 mingetty5040 tty2 00:00:00 mingetty… …….. …….. ……….. Notice that the TTYcolumn displays a ?for manyprocesses. Those processes are noninteractive,andthey re generally server-type processes like Apache, xinetd, or MySQL. To see only the interactiveprocesses (processes associated with a terminal orterminal window), use -ainstead of -A. You can also choose processes based on the processcharacteristics shown in Table 39-1. TABLE39-1: PSPROCESSSELECTIONOPTIONSOptionDescription-C commandDisplays processes running command-G groupDisplays processes that have the –group groupeffective group ID group(groupcan be a group name or a numericgroup ID) OptionDescription-U userDisplays processes that have the –userusereffective user ID user(usercan be name or a numeric user ID) -g groupDisplays processes that have the –Group groupreal group ID group(groupcan be agroup name or a numeric group ID) -u userDisplays processes that have the –User userreal user ID user(usercan be auser name or a numeric user ID) -p process-IDDisplays processes that have the –pid process-IDprocess ID process-ID-t tty-nameDisplays processes running at –tty tty-nameterminal tty-nameIf you list more than one process selector, psdis- plays all processes that meet anyof the constraints. For example, to see all processes with an effective orreal user ID of freddie, use the following command: $ ps –user freddie –User freddieIf you want to select multiple processes based onthe same characteristic (but different values), justlist each value, separating the values with commas. These two commands are equivalent: $ ps -C bash -C zsh$ ps -C bash,zshViewing ps output the way you want to see itYou can also change the columns listed by the pscommand. To specify an output format, use the fol- lowing option: -o column[,column]… pslets you choose an output format from 126 differ- ent columns! Some of the more useful columns areshown in Table 39-2.48_
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

My web server - that process. Knowing the identity of the user,

Friday, February 22nd, 2008

that process. Knowing the identity of the user, the process ID, and the terminal that is controllingthe process is valuable when you need to trackdown a process and its origins. Statistical informa- tion about the process (such as memory usage andCPU time) is also helpful when you need to catchtroublemaking programs that might be causing per- formance problems. procpsprovides several goodtools that can help you get that information in theform that helps you most. Using ps to filter process status informationMost Linux users have at least a passing familiaritywith the pscommand. psstands for process status, and it displays just that: the status of a process. If you just type pswithout any extra arguments oroptions, you see a quick synopsis of the programsrunning within your terminal window: PID TTY TIME CMD10181 pts/7 00:00:00 bash10521 pts/7 00:00:00 psThis information is organized in four columns: PID: The first column shows the process ID, which is a unique number assigned to eachprocess when it starts running. TTY: The second column displays your ttydevice name. In this example, pts/7means thatyou re logged into pseudo-terminalnumber 7. (When you open a new terminal window, you cre- ate a new pseudo-terminal.) TIME: The third column shows the amount ofCPU time used by each process. CMD: The last column shows the name of the pro- gram running within each process. Note that you don t have to live with the defaultcolumns. You can change the way the output looks. See Viewing ps output the way you want to see it later in this technique. Getting familiar with procpsis a good invest- ment of time. After you know the tools, you llturn to them again and again. The procpspackage contains several tools that youcan use to monitor and control processes: ps sysctl free pgrep pkill top w watchChances are, procpsis already installed on your sys- tem. If not, you can find the RPM package on theLinux distribution discs. On Fedora or Mandrake, open a terminal window, and with superuser privileges, mount the disc andinstall the package with the following command: # rpm -Uhv procps-version.rpmIf you re a SuSE user, open a terminal window, andwith superuser privileges, mount the disc and installthe RPM package with the command: # rpm -Uhv ps-version.rpmSee Technique 17 for more information aboutinstalling software with rpm. Keeping Track of Process Statuswith ps, pstree, and pgrepBefore you can control a troublesome process onyour system, it helps to have good, solid information48_
You want to have a cheap webhost for your apache application, then check apache web hosting services.

39ControllingTroublesomeProcesses at theCommand LineEvery now (Web site layout) and then a

Thursday, February 21st, 2008

39ControllingTroublesomeProcesses at theCommand LineEvery now and then a troublesome process gets loose on your sys- tem, hogging resources, slowing down the network, and refusing todie. Controlling the troublemakers is a snap, thanks to Linux. WithLinux, you have some great command line tools, all bundled up in one lit- tle RPM package called procps(pronounced proc ps ). ps, pstree, and pgrepare the stud finders in the toolbox that help youfind the troublemaking processes. With ps, pstree, and pgrep, you canidentify the process, the user, and the terminal being used. You can alsoget a good idea of what system resources the process is using to decide ifthe process should be terminated. kill, killall, and xkillare the hammers in the toolbox. How big ofahammer you need depends on the scope of the process or processesyou re trying to stop, and the precision you need to kill them off. Choosefrom the three commands to remove any unwanted processes thatyou ve identified. You can use the renicecommand to level the playing field by assigning thetroublemaking process a nicevalue. The processes with lower nice valueshave to surrender system resources to processes with higher priorities. In this technique, we introduce you to some handy command line toolsthat make process management a breeze. With these tools in your tool- box, you can build a better system fast, even if you don t have a graphi- cal environment to help you along the way. Processing Processes with procpsThe tools packaged in the procpsRPM package are a handy but diversebunch. They can retrieve information about processes or users, kill offunwanted processes, and watch the activities on your system. procpsisan all-purpose toolkit designed to provide power at the command line tomake process management quick and easy. TechniqueSave Time By Using the tools in procpsto control processes atthe command line Using ps, pstree, andpgrepto retrieve processdetails Killing off unwantedprocesses at the command line Setting program prioritiesat the command line withrenice48_
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

Part VIIMonitoring (Web hosting company) Your System47_

Thursday, February 21st, 2008

Part VIIMonitoring Your System47_
Looking for affordable and reliable webhost to host and run your business application? Then look no more and go to servlet web hosting services.

Web hosting ecommerce - buttons on the left panel control the four

Wednesday, February 20th, 2008

buttons on the left panel control the four config- uration menus: General:Use the General menu to set optionsthat affect the general look and feel of the ses- sion, from the session information included inthe display to the wallpaper. Startup:Use the Startup menu to create a nick- name (or an alternative nickname if Funkmasteris already logged in). Colors:Use the Colors menu to set your colorpreferences for your IRC session. Fonts:Use the Fonts menu to set the font typeand size for your IRC session. After you ve set your preferences, click OK to saveyour changes and close the Configure KSirc dialog. The next time you start a KSirc session, your prefer- ences are in place!
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.