Halloween paLinux: maitiro ekuuraya maitiro eZombie

chitambi che halloween

Zuva revakafa riri kuuya ndosaka tichida kuita iyi diki dzidziso kubva kuLxA kuti titaure nezve iyo zombie maitiro uye kuti tingavauraya sei. Chinhu chekutanga kutaura ndechekuti maitiro e zombie ndeapi, uye ndezvekuti sekuziva kwako, iyo Linux kernel ine subsystem yekugadzirisa maitiro uye inoshanda neyeye scheduler kugadzira, kusiyanisa zvakakosha, kutumira kana kubvisa iyo CPU kugadzirisa kuyerera uye kuuraya maitiro. Zvakanaka, ichi chikamu chekernel, senge mamwe masisitimu eUnix-akafanana, anosiyanisa pakati penzvimbo dzakasiyana siyana dzehurongwa ...

Saka tinogona kuzviwana maitiro inogona kunge iri mukurara (S) mamiriro, ndiko kuti, kurara. Zvakare maitiro mune inomhanya mamiriro (R) ayo ari iwo aripo kumusoro kana kumhanya, maitiro akamirira (D) anomiswa akamirira kuvepo, gestpt (T) kana kumiswa, uye zvakare zombie (Z) kana mushakabvu. Zombie kana yakafa maitiro ndiyo yatove yakamiswa zvakabudirira, asi iine mamwe masisitimu zviwanikwa akabiwa sezvo Linux ichiri kuichengetedza mutafura yekuita. Iwe unotoziva kuti kana maitiro apera, haifanire kugara mune ino mamiriro, asi anopedzisa uye iyo kernel inosunungura zviwanikwa kuitira kuti mamwe maitiro azvishandise, zvakanyanya inosunungura iyo yakagara RAM ...

Zvakanaka, sezvo zvisinganakidze kuva nerudzi urwu rwemaitiro e zombie, kunyangwe asiri akajairika, tinogona kutsvaga nekuabvisa sezvakaratidzwa pano. Chinhu chekutanga kutsvaga kana paine zviitiko zve zombie mune yedu distro uye kune izvo isu tinogona kuzvibatsira zvishandiso senge pamusoro kana senge ps. Semuenzaniso, imwe yesarudzo mbiri idzi:

ps -el | grep 'Z'

ps aux | grep defunct

Uye kana tangoonekwa, tinogona muuraye zvakananga ne:

kill -HUP `ps -A -ostat,ppid,pid,cmd | grep -e ‘^[Zz]’ | awk ‘{print $2}’`

Kunyangwe imwe imwe nzira ndeyekutsvaga maitiro evabereki, kubvira ku kuuraya maitiro e zombie Iwe unofanirwa kuuraya maitiro emubereki anoitsigira, sezvaungave iwe wakaburitsa:

ps -eo pid,ppid | grep <PID>

kill -9 <PPID>

Iwe uchafanirwa kutsiva neID yeiyo nzira ye zombie yawakawana uye kuiuraya nekuuraya, shandisa iyo ID yeiyo mubato maitiro kutsiva mumuenzaniso, pachena.


Izvo zviri muchinyorwa zvinoomerera pamisimboti yedu ye tsika dzekunyora. Kuti utaure chikanganiso tinya pano.

Mhinduro, siya zvako

Siya yako yekutaura

Your kero e havazobvumirwi ichibudiswa.

*

*

  1. Inotarisira data: AB Internet Networks 2008 SL
  2. Chinangwa cheiyo data: Kudzora SPAM, manejimendi manejimendi.
  3. Legitimation: Kubvuma kwako
  4. Kutaurirana kwedata
  5. Dhata yekuchengetedza: Dhatabhesi inobatwa neOccentus Networks (EU)
  6. Kodzero: Panguva ipi neipi iwe unogona kudzora, kupora uye kudzima ruzivo rwako

  1.   akaita mabhora akadaro

    Saiti yakanaka!
    Vanogara vachitibvisa mumatambudziko.

    Iko inoti:
    Kunyangwe imwe nzira iri yekutsvaga maitiro evabereki, sezvo kuuraya zombie maitiro unofanirwa kuuraya maitiro emubereki anoitsigira, sezvaungave wakafunga:

    1 | ps -eo pid, ppid | grep
    2|
    3 | kuuraya -9

    Iwe uchafanirwa kutsiva iyo ID ye zombie maitiro awakawana uye kuiuraya nekuuraya, shandisa iyo ID yemubereki maitiro achitsiva mumuenzaniso, zviri pachena.

    unogona kuwedzera script:

    $ katsi killppid.sh
    #! / bin / bash
    uraya -9 $ (ps -eo pid, ppid | awk '$ 1 ==' $ {1} '{print $ 2}')

    Ehe, harisi basa rinoitwa nemunhuwo zvake mushandisi nguva dzese.
    Zvingangove zvinobatsira kune maneja, asi zvine njodzi kuimhanyisa semudzi, nekuti chero maitiro pane system anogona kuurayiwa.

    Mumunhu kuuraya ine chinyorwa ichi:

    MAZANO Goko rako (command line muturikiri) rinogona kunge riine murayiro wekuuraya wakavakirwa mukati. Unogona
    inoda kumhanya murairo unotsanangurwa pano se / bin / kuuraya kugadzirisa kusawirirana.

    Bash ane iwo murairo, ichi ndicho chikamu chemurume bash nezvazvo:

    uraya [-s sigspec | -n signum | -sigspec] [pid | jobspec]...
    kuuraya -l | -L [sigspec | exit_status]
    Tumira chiratidzo chakatumidzwa ne sigspec kana signum kune maitiro anonzi pid kana basa
    spec. sigspec ingangove iri kesi-isinganzwe siginecha zita senge SIGKILL (ine kana
    pasina SIG prefix) kana nhamba yechiratidzo; signum inhamba yechiratidzo. Kana
    sigspec haipo, ipapo SIGTERM inofungidzirwa. Nharo ye -l inonyora iyo
    mazita echiratidzo. Kana chero nharo dzichipihwa kana -l yapihwa, mazita e
    masaini anoenderana nenharo akanyorwa, uye mamiriro ekudzoka ndeye 0.
    Iyo exit_status nharo ku -l inhamba inotsanangura ingave nhamba yechiratidzo kana
    chimiro chekubuda chechirongwa chinopedzwa nechiratidzo. Iyo -L sarudzo yakaenzana
    ndakweretesa ku -l. kuuraya kunodzosera chokwadi kana chiratidzo chimwe chete chakatumirwa zvinobudirira, kana
    nhema kana kukanganisa kukaitika kana sarudzo isiriyo yasangana.

    Pakutanga vanotsanangura kuti bash inodzivirira sei maitiro, kudzivirira mamwe matambudziko, asi hazvina kujeka kwandiri kuti ndingaite sei script yakachengeteka kuti iite semidzi.
    Chinhu chega chandinogona kufunga nezvacho ndechekudzivirira seizvi:

    $ katsi killppid.sh
    #! / bin / bash
    kana [$ USER == "mudzi"]
    ipapo echo Usamhanye $ 0 semudzi !!! zvine ngozi!
    mbudo
    fi

    uraya -9 $ (ps -eo pid, ppid | awk '$ 1 ==' $ {1} '{print $ 2}')

    $

    Shandisa bash's kuuraya, kwete / bin / kuuraya

    Unoona sei kuti handina kunyatso ziva bash.
    Unoziva here kunyora script yakachengeteka inomhanya semushandisi wemaitiro emwana, kunyangwe ichimhanya semudzi?
    chimwe chinhu chakaenzana nechaizoitwa nemaoko seizvi:

    $ su;
    $ kuuraya -9 $ (ps -eo pid, ppid | awk '$ 1 ==' $ {1} '{print $ 2}')