Menonaktifkan atau penghentian rencana UNIX atau Linux
Dalam tutorial ini kita akan belajar bagaimana Anda dapat menonaktifkan atau menghentikan program sistem UNIX atau Linux.
Linux dan UNIX lainnya semua sistem datang netralisasi perintah. Mengirim perintah sinyal netralisasi tertentu (seperti proses netralisasi) proses tertentu atau kelompok proses.
Jika sinyal tidak terdaftar, sinyal TERAM dikirim.
Netralisasi proses dengan penggunaan Kill perintah di Linux / UNIX
Netralisasi Ordonansi bekerja di bawah Linux, BSD dan UNIX-seperti sistem operasi.
Langkah Pertama: Menemukan PID dari proses (proses ID)
Gunakan ps atau pidof perintah untuk menemukan proses ID (PID). Sintaks:
ps aux | grep processname pidof processname
processname = שם התהליך.
ps aux | grep httpd
הפלט אמור להיראות בערך ככה:
root 8886 0.0 0.7 32276 15660 ? Ss 00:11 0:00 /usr/sbin/httpd -k start -DSSL apache 17312 1.4 0.8 35436 18240 ? S 00:43 0:03 /usr/sbin/httpd -k start -DSSL apache 17751 1.1 0.8 35548 18536 ? S 00:45 0:01 /usr/sbin/httpd -k start -DSSL apache 17755 1.2 0.8 35200 17908 ? S 00:45 0:01 /usr/sbin/httpd -k start -DSSL apache 17831 1.0 0.8 34556 17544 ? S 00:46 0:00 /usr/sbin/httpd -k start -DSSL apache 17927 1.2 0.7 33804 16492 ? S 00:46 0:00 /usr/sbin/httpd -k start -DSSL apache 17929 2.0 0.7 33620 16408 ? S 00:46 0:00 /usr/sbin/httpd -k start -DSSL apache 17935 2.1 0.8 34588 17324 ? S 00:46 0:00 /usr/sbin/httpd -k start -DSSL apache 17990 2.3 0.8 34516 17256 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18000 1.3 0.8 33928 16608 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18055 2.1 0.7 33580 16224 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18056 0.0 0.6 32276 14152 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18057 8.6 0.7 33572 16336 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18061 2.7 0.8 33932 16560 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18062 0.0 0.7 32784 14660 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18063 0.0 0.6 32276 14184 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18064 1.7 0.7 33480 16112 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18079 0.0 0.7 32784 14528 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18082 0.0 0.6 32276 14136 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL apache 18083 0.0 0.7 33572 16204 ? S 00:47 0:00 /usr/sbin/httpd -k start -DSSL root 18086 0.0 0.0 3940 720 pts/1 R+ 00:47 0:00 grep httpd
או השתמשו בפקודת pidof שאמורה למצוא את מזהה התהליך(ID) של תוכנית רצה:
pidof httpd
הפלט צריך להיראות ככה:
18414 18408 18257 18256 18205 18100 18083 18079 18063 17935 17312 8886
שלב שני: נטרול התהליך ע"י שימוש בPID-(מזהה התהליך)
הפקודה הזו מציגה את ה-PID של התהליך ( httpd (8886. עכשיו ננטרל את התהליך על ידי שימוש ב-PID הזה:
kill 8886
אך ניתן גם דרך:
kill -9 8886
איפה ש,
-9 סימון מיוחד לנטרול תהליך, אשר ינטרל אותו.
דוגמאות לפקודות killall
אל תשתמשו בפקודות killall במערכת UNIX (פקודה לLinux בלבד).
אתם יכולים להשתמש בפקודות killall . פקודת killall מנטרלת תהליכים לפי השם(לא נדרש מזהה התהליך – PID):
killall -9 httpd
נטרול התהליך mysqld:
killall -9 mysqld
בהצלחה!
Related posts:









































