Ungazibulala kanjani izinqubo kalula

Ngokuyisisekelo kukhona Izindlela ezi-4 de bulala ngempumelelo a inqubo en Linux: ibulale ngegama, ngokukhomba ingxenye yegama, nge-PID, ekhomba iwindi lenqubo ngesikhombisi segundane. Ake sibone ngamunye ngamunye ...

Kill: bulala inqubo usebenzisa i-PID yayo

Okuyinkimbinkimbi kakhulu kepha ngasikhathi sinye indlela enembile kunazo zonke yokubulala inqubo nge-PID yayo ("Isikhombi senqubo"). Noma yikuphi kwalokhu okuhlukile okungu-3 kungasebenza:

bulala -TERM pid bulala -SIGTERM pid bulala -15 pid

Ungasebenzisa igama lesiginali (i-TERM noma i-SIGTERM) ofuna ukuyithumela kunqubo noma inombolo yayo yokuhlonza (15). Ukubona uhlu olugcwele lwezimpawu ezingenzeka, ngiphakamisa ukuthi kubhekwe imanuwali yokubulala. Ukuze wenze lokhu, sebenzisa:

I-athikili ehlobene:
Cisha phansi bese uqala kabusha usebenzisa imiyalo

umuntu ubulala

Ake sibheke isibonelo sendlela yokubulala iFirefox:

Okokuqala, kufanele uthole i-PID yohlelo:

ps -ef | grep firefox

Lowo myalo uzobuyisa into enjengale:

Ngo-1986? Sl 7:22 / usr/lib/firefox-3.5.3/firefox

Sisebenzisa i-PID ebuyiswe ngumyalo ongenhla ukubulala inqubo:

bulala -9 1986

killall: bulala inqubo usebenzisa igama layo

Lo myalo ulula kakhulu

inqubo ye-killall process_name

Into eyodwa okufanele uyikhumbule lapho usebenzisa le ndlela ukuthi uma kunezimo ezingaphezu kwesisodwa zalolo hlelo olusebenzayo, zonke zizovalwa.

I-athikili ehlobene:
I-Cron ne-crontab, kuchaziwe

pkill: bulala inqubo usebenzisa ingxenye yegama layo

Kungenzeka ukubulala inqubo ngokuchaza igama eligcwele noma ingxenye yegama. Lokho kusho ukuthi asikho isidingo sokuthi ukhumbule inqubo ye-PID yokuthumela isignali.

i-pkill part_process_name

Ngokuphindaphindiwe, le ndlela izobulala zonke izinqubo eziqukethe igama elifakiwe. Lokho kusho ukuthi uma sinezinqubo ezi-2 ezivulekile ezabelana ngegama egameni, zombili zizovalwa.

 

xkill: bulala inqubo ngokukhetha iwindi negundane

Le yindlela elula nesebenziseka kalula. Uma kwenzeka inhlekelele, mane ucindezele u-Alt + F2 ukuletha ibhokisi lengxoxo elizokuvumela ukuthi wenze imiyalo. Ukusuka lapho, sebenzisa umyalo olandelayo:

xkill

Isikhombisi segundane sizoshintsha sibe ugebhezi oluncane. Osekusele nje ukuchofoza ewindini ofuna ukulivala bese u-voila. Inqubo yokulahla.

 

Okunye ukuphawula kokugcina

Ekuphetheni, bengifuna ukwabelana ngamathiphu athile angasiza. Ku-Linux, njengakwi-Windows, lapho inqubo ilenga, iwindi okukhulunywa ngalo lingavalwa ngokuchofoza inkinobho ethi Vala (eyenziwe njengo-X). Ngemuva kwemizuzwana embalwa, iwindi lizovela lisibuze ukuthi ngabe sifuna ngempela ukubulala inqubo ngoba ayiphenduli kahle. Sithi yebo futhi yilokho kuphela.

Lokhu kusho ukuthi izindlela ezichazwe lapha kufanele zisetshenziswe uma kungenzeki lutho uma uchofoza inkinobho ethi Vala lewindi okukhulunywa ngalo.

Uma kwenzeka inhlekelele enkulu, ungakhohlwa ukuthi ngaphambi kokucindezela kungenzeka ukuthi wenze i- ukuqala kabusha "okuphephile".

Ekugcineni, kungasiza kakhulu ukuthola ukuthi yiziphi izinqubo ezisebenzayo njengamanje. Ngalokhu, izindawo ezihlukile zedeskithophu (i-GNOME, i-KDE, njll.) Zinamathuluzi wokuqhafaza alungiselela lo msebenzi. Kodwa-ke, uma ungeke ukwazi ukufinyelela kuzo noma umane ufuna ukukwenza kusuka ku-terminal, ungenza okulandelayo:

top

Uma kwenzeka lokhu kungasebenzi noma ungenayo iphakheji ehambelana nayo, ungahlala usebenza:

ps -A

Lokhu kuzoklelisa zonke izinqubo ezisebenzayo, kanye namagama wazo kanye nama-PID.


Okuqukethwe yi-athikili kunamathela ezimisweni zethu ze izimiso zokuhlelela. Ukubika iphutha chofoza lapha.

Amazwana ayi-22, shiya okwakho

Shiya umbono wakho

Ikheli lakho le ngeke ishicilelwe. Ezidingekayo ibhalwe nge *

*

*

  1. Ubhekele imininingwane: Miguel Ángel Gatón
  2. Inhloso yedatha: Lawula Ugaxekile, ukuphathwa kwamazwana.
  3. Ukusemthethweni: Imvume yakho
  4. Ukuxhumana kwemininingwane: Imininingwane ngeke idluliselwe kubantu besithathu ngaphandle kwesibopho esisemthethweni.
  5. Isitoreji sedatha: Idatabase ebanjwe yi-Occentus Networks (EU)
  6. Amalungelo: Nganoma yisiphi isikhathi ungakhawulela, uthole futhi ususe imininingwane yakho.

  1.   UJerónimo Navarro kusho

    «I-Ps -ef | "grep firefox" ayifani ne- "pgrep firefox"?

    Kahle mathupha ngisebenzisa i- "pidof" ukuthola i-PID.

    Ukubingelela!

  2.   U-Iago Martinez Ocaña kusho

    engikusebenzisa kakhulu ngukuthi:
    ~ $ phezulu
    isibonisa uhlu lwezinqubo ezisebenzayo, khona-ke uma sishaya u- "k" noma sibhala "ukubulala" kuzosicela ukuthi i-pid yenqubo ibulale (siyifunda kusuka phezulu) bese singena, ukuphuma phezulu sicindezela u- "q".
    Ukungena okuhle kakhulu, kepha leli fomu libonakala lilula kimi. Uma ukuphela kungasebenzi sizama u-ctrl + alt + f [1-6] bese sikwenza ukusuka lapho.

  3.   I-Anatonia kusho

    Yeka ubuhlakani, ngiyabonga ngokungisiza, unginike isandla esikhulu ngalokhu okuthunyelwe!

  4.   U-Octavio Villanueva kusho

    Sawubona! Kungenzeka yini ukuthi umyalo we-xkill wenza kuphela uhlelo lwe-X lunyamalale futhi luhlale luvulekile? Ngoba kuhlala kwenzeka kimi ukuthi uma ngiya kumphathi wemisebenzi inqubo isaphila futhi kufanele ngiyibulale.
    Ngiyakuvuma, ngingumfana omusha kakhulu. Futhi imiyalo yokubulala ne-pkill izongisiza kakhulu. Siyabonga ngokuzifaka, ibhulogi enhle kakhulu.
    Ukubingelela!

  5.   heberth ardila kusho

    Ngincoma i-htop is ukuthi kungcono kakhulu kulokho ...

    isebenza nge-ncurses

    sudo apt-get ukufaka htop

  6.   lonn kusho

    i-pidof akuyona eyabo bonke ama-Unix, ngokwesibonelo uSolaris awunawo lowo myalo, futhi lokho kusiholela ekusebenziseni i-ps enamandla.

    Phendula ngokucaphuna

  7.   dub kusho

    I-htop isenzo esikhulu futhi iyasebenziseka

  8.   RudaMale kusho

    Endabeni yokusebenzisa i-PID, into eyiyo yi- $ kill PID ethumela isignali ye-SIGTERM ngokuzenzakalela, uma kwenzeka ukuthi inqubo ingaphenduli, $ kill -9 PID isetshenziswa ethumela isignali ye-SIGKILL, eyokugcina iqeda inqubo ngaphandle kokuyiyeka ukuvalwa okufanayo ngokufanele (kungahle kube nokulahleka kwedatha ngokwesibonelo). USIGTERM ubuza ngicela, USIGKILL umnika imbazo 🙂

  9.   Rodrigo kusho

    Ngiyabonga kakhulu, ngizoyihlola uma kwenzeka kimi futhi.

  10.   Rodrigo kusho

    umbuzo. Lapho imvelo yedeskithophu ilenga ku-Ubuntu (ngisebenzisa Ubunye), ingaqalwa phansi ngaphandle kokubulala zonke ezinye izinqubo? Angithuthukile kakhulu ku-linux futhi kwenzeka kimi kwesinye isikhathi ukuthi ngiyasebenza futhi ilenga, ukuphela kwento engiyenzayo ukuqala kabusha okuphephile, kepha ngilahlekelwa yikho konke ebengisebenza kukho.

    Angazi noma ukungabaza kwami ​​kuyaqondakala yini.

    Phendula ngokucaphuna

  11.   I-StallValds kusho

    Inqubo esifundeni se-zombie ayinakubulawa ngendlela yendabuko.

    Lapha ukuthola eminye imininingwane: esdebian.org/wiki/matar-proceso-zombie

  12.   ubuqili kusho

    Ngokuthuthukile kakhulu, uyibulala kanjani inqubo kuZOMBIE?
    ukukhiqiza ingxoxo encane 😀

  13.   UJorge Vips kusho

    Kuhle kakhulu, yilokho ebengikudinga ..

  14.   Pepe kusho

    Iqiniso ukuthi umyalo wokubulala ulusizo kakhulu. Ukukwazi ukubulala izinqubo ezicasulayo ngokumema ukubulala kuhle. Ekugcineni umyalo osebenzela okuthile.

  15.   Alex kusho

    Umbuzo wethiyori: Ukubulala inqubo kusho ukuthi iyeka ukusebenza. Ngakho-ke, umbuzo wami ungenye indlela, uma ngifuna ukuqala kabusha leyo nqubo engiyibulele, ngiyenza kanjani?

    1.    alex kusho

      ubeke kahle ./ (igama lenqubo) &
      ngalokhu uyisebenzisa futhi i-PID yakho izophuma nayo 😀

  16.   UJC Rivera kusho

    Kuhle, benginesikhathi ngifuna usizo olunje. Kwangisiza kakhulu. Ngiyabonga kakhulu ngokwabelana.
    Ukubingelela okuvela eSan Luis Potosí, eMexico.

  17.   alex kusho

    Ngingazibulala kanjani izinqubo ezimbili ngazi i-PID yazo ngomyalo ofanayo?

    1.    Juan kusho

      Ngicabanga ukuthi 'yayibulala [i-PID yokuqala] [i-PID yesibili]

  18.   UGauchita Watafak kusho

    I-athikili ethakazelisa kakhulu. Le webhusayithi yiwebhusayithi yami eyinhloko ye-linux.

    Imvamisa ngisebenzisa:
    ps izembe grep process_name (lokhu ukukuthola ohlelweni)
    bulala -9 inqubo_id

    Ngabelana ngesifundo samahhala se-bash online esihambahamba:
    https://aprendemia.com/cursos/curso-de-bash-scripting Sethemba ukuthi kuzoba wusizo.

  19.   andy kusho

    futhi uma bengifuna ukuthi kube yiphrofayili ku-linux kuphela evalayo njengoba kufanele ibe njalo?

    isibonelo nginamaphrofayili ama-2 e-firefox avulekile
    kepha ngifuna kuphela iphrofayili eyodwa ukuvala

    Iphrofayili 1
    Iphrofayili 2

    Ngifuna kuphela iphrofayili 2 ukuvala njengoba umyalo kufanele ube

    kusengaphambili ngiyabonga ngempendulo

  20.   kimi kusho

    Ngingazibulala kanjani izinqubo ezingaphambili zobuntu, ngomugqa owodwa womyalo