Toso eukolos <<ios>>?

Christos Ricudis ricudis at paiko.gr
Thu Feb 3 12:48:36 EET 2000


Hello Linux-greek-users!

  On 03 Feb 00, Linux-greek-users wrote to All with subject "Toso eukolos
<<ios>>?":

 L> Mou edeikse evas foitntns tov eksns aplo kwdika
 L> (pou sigoura 0a kserete osoi kataxete apo programmatismo)

 L> #include <stdio.h>

 L> main()
 L>  {
 L>   int n;
 L>  for(;;)
 L>  {
 L>   n=fork();
 L>  }
 L> }


Nai. Gia pio pollh plaka bale kai kammia malloc() mesa.

To problhma omws den lynetai ston kernel, alla sto userland, me th xrhsh ths
entolhs ulimit :

bash% help ulimit

Ena process mporei na allaksei to soft limit tou mexri to upper bound toy hard
limit (poy mporei na orisei o root). Epishs ena process mporei na katebasei to
hard limit tou alla de mporei na to anebasei (ektos an exei root priviledges).
Ta limits ginontai inherit sta child processes, opote ena

ulimit -Su 100
ulimit -Hu 100

sto /etc/profile, lynei (sxedon) to problhma.

Twra, ti ginetai an 8es na kaneis set diaforetika limits gia diaforetikous
users, groups, ktl ktl ktl. Kalh erwthsh. Kanena distribution den to
yposthrizei by default (opws kai ta quotas). To epixeirhma toy Kwsta toy
Gewrgiou - oti kati tetoio 8a ka8orize administration policy mesa sto
distribution - de stekei, giati ola ta distributions ka8orizoyn outws h allws
AKOMA hli8iwdestera policies :>

To kalo einai oti o kalos 8eoulhs mas lyph8hke, kai sto shadow password suite
toy jfh (toy opoiou to login nomizw oti xrhsimopoioyn oles oi linux
distributions), yparxei yposthriksh gia na 8eteis per-user kai per-group
ulimits, an kai ayto to kseroyn elaxistoi.

Aplws kaneis edit to arxeio /etc/limits kai bazeis th grammh :

kakos_user_pou_trexei_malakies U32

kai 8eteis to hard/soft limit tou user stis 32 processes :

kakos_user_poy_trexei_malakies$ bash
kakos_user_poy_trexei_malakies$ bash
kakos_user_poy_trexei_malakies$ bash
...
kakos_user_poy_trexei_malakies$ bash
bash: fork: Resource temporarily unavailable
kakos_user_poy_trexei_malakies$

Epishs xrhsimo einai na perioriseis to maximum data size (gia na mh sou kanei
malloc bombs) ktl ktl ktl. 

Gia to plhres format toy arxeiou, koitakste to documentation toy shadow
password suite (8a to breite kai sto linux.forthnet.gr:/pub/linux/shadow/

--
Christos Ricudis
Prof:    So the American government went to IBM to come up with a data
         encryption standard and they came up with ...
Student: EBCDIC!
--
====================================================================
Gia boithia (h na diagrafhte) e-mail sto majordomo at hellug.gr
Ta archives tis listas einai sto http://lists.hellug.gr/lgu.html
prin steilete kapoia erothsh psakte mipos exei hdh apanththei.
Gia opoiodipote problima stilte e-mail ston owner-linux-greek-users at hellug.gr
====================================================================



More information about the Linux-greek-users mailing list