Selasa, 10 Agustus 2010

one liner

This moring, the receptionist asked me to help her to fix her computer. Since the computer connect to Sunray server, then i go to find problem on Sun ray server.


i found something nasty. Nothing wrong with the application, it just run out of memory. what i have to do is just simple. kill all application with her username and i am sure the desktop can show up again.


the user name is asti. 


root@solaris-sunray # ps -ef|grep asti|awk '{print $2}'
26696
26745
26721
27146
26641
26759
26571
26719
26661
26749
26747
26743
26723
26753
26738
26637
26430
26712
26757
26726
26695
26710
26755
26698
26388 


how to kill that PID with one liner. simple


for i in `ps -ef|grep asti|awk '{print $2}'`; do kill -9  $i; done


and now she is happy can browse facebook again....

have happy fasting

2 komentar:

  1. bro Ryan, apa gak mending "dua putaran"? Maksudnya, putaran pertama pake sinyal TERM, baru sisanya yang bandel pake SIGKILL?

    BalasHapus
  2. Terima Kasih telah mampir, apakah begini maksudnya ?
    for i in `ps -ef|grep asti|awk '{print $2}'`; do kill -15 $i; done
    for i in `ps -ef|grep asti|awk '{print $2}'`; do kill -9 $i; done

    BalasHapus