Mendeteksi directory pid

dapet masalah hari ini aku melihat ada 2 program running yaitu radio streaming
root@waduh [/home/abok/public_html/media/radio]# ps x |grep sc_serv
 2346 ?        S      0:02 ./sc_serv
 4306 ?        S      0:02 ./sc_serv

nah aku mau ngedit salah satu configurasi dari salah satu radio itu tetapi ada kendala yang mana radio yang bener  jangan jangan aku salah kill pid ternyata bukan lagi. karena disitu ada 2 pid lalu ndetect nya pid itu jalan dari directory mana seumpama kita
mana mungkin mengingat2 teru menuh2in otak saja.

[root@ardantus root]# lsof –help
lsof: illegal option character: –
lsof: illegal option character: e
lsof: no process ID specified
lsof 4.63
 latest revision: ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/
 latest FAQ: ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/FAQ
 latest man page: ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/lsof_man
 usage: [-?abhlnNoOPRstUvV] [-c c] [+|-d s] [+D D] [+|-f]
 [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]] [-p s]
 [+|-r [t]] [-S [t]] [-T [t]] [-u s] [+|-w] [–] [names]
Defaults in parentheses; comma-separate set (s) items; dash-separate ranges.
  -?|-h list help          -a AND selections (OR)     -b avoid kernel blocks
  -c c  cmd c, /c/[bix]                               +d s  dir s files
  -d s  select by FD set   +D D  dir D tree *SLOW?*
  -i select IPv[46] files  -l list UID numbers        -n no host names
  -N select NFS files      -o list file offset        -O avoid overhead *RISKY*
  -P no port names         -R list paRent PID         -s list file size
  -t terse listing         -T disable TCP/TPI info    -U select Unix socket
  -v list version info     -V verbose search          +|-w  Warnings (+)
  — end option scan
  +f|-f  +filesystem or -file names
  -F [f] select fields; -F? for help
  +|-L [l] list (+) suppress (-) link counts < l (0 = all; default = 0)
                                        +|-M   portMap registration (-)
  -o o   o 0t offset digits (8)         -p s   select by PID set
  -S [t] t second stat timeout (15)     -T qs  TCP/TPI Q,St info (s)
  -g [s] select by process group ID set and print process group IDs
  -i i   select by IPv[46] address: [46][proto][@host|addr][:svc_list|port_list]
  +|-r [t] repeat every t seconds (15); + until no files, – forever
  -u s   exclude(^)|select login|UID set s
  names  select named files or files on named file systems
Anyone can list all files; /dev warnings disabled; kernel ID check disabled.
[root@ardantus root]#

sekarang kita dah tahu comand dari menu help nya lalu kita cari deh sekarang
tinggal kita cari pid yang mau kita lihat dan kill
root@waduh [/home/abok/public_html/media/radio]# ps x |grep sc_serv
 2346 ?        S      0:02 ./sc_serv
 4306 ?        S      0:02 ./sc_serv
 1335 pts/3    S      0:00 grep sc_serv
root@waduh [/home/abok/public_html/media/radio]#
root@waduh [/home/abok/public_html/media/radio]# lsof -a -d cwd -p 4306
COMMAND  PID USER   FD   TYPE DEVICE SIZE    NODE NAME
sc_serv 4306 root  cwd    DIR    3,3 4096 1933374 /home/abok/public_html/media/radio
root@waduh [/home/abok/public_html/media/radio]#
root@waduh [/home/abok/public_html/media/radio]# kill -9 4306
root@waduh [/home/abok/public_html/media/radio]#

nah jadi khan dapet khan akhirnya hehehhe thanks to all

Administrator

Saya adalah saya, dimana saya tinggal disitu saya berada. Saya suka menulis disela kesibukan saya, tapi saat sibuk saya tidak bisa menyempatkan waktu untuk menulis.

One thought to “Mendeteksi directory pid”

Leave a Reply

Your email address will not be published. Required fields are marked *