rokwait:/sbin/shutdown -c "THE POWER IS BACK" # - # ( 5) ps:S:powerokwait:/sbin/init 5
/etc/inittab , man, :
rc.S ( ). - rc.K. , , , , (rc.M).
# /etc/rc/rc.S
# # , # rc.local PATH=/sbin:/usr/sbin:/bin:/usr/bin # #/sbin/swapon -a # swapon /dev/hdb2 # # , read-only READWRITE=no if echo -n >> "Testing filesystem status"; then rm -f "Testing filesystem status" READWRITE=yes fi # if [ ! $READWRITE = yes ]; then /sbin/fsck -A -a # # -, # if [ $? -gt 0 ] ; then echo echo echo "**************************************" echo "fsck returned error code - REBOOT NOW!" echo "**************************************" echo echo /bin/login fi # read-write echo "Remounting root device with read-write enabled." /sbin/mount -w -n -o remount / else # # read-write, # . # # cat << EOF *** Root partition has already been mounted read-write. Cannot check! For filesystem checking to work properly, your system must initially mount the root partition as read only. Please modify your kernel with 'rdev' so that it does this. If you're booting with LILO, type: rdev -R /vmlinuz 1 (^^^^^^^^ ... or whatever your kernel name is.) If you boot from a kernel on a floppy disk, put it in the drive and type: rdev -R /dev/fd0 1 This will fix the problem *AND* eliminate this annoying message. :^) EOF sleep 10 fi # , /bin/rm -f /etc/mtab* /etc/nologin /etc/utmp # . cat /dev/null >> /etc/utmp # , /etc/fstab # NFS, TCP/IP /sbin/mount -avt nonfs # if [ -x /sbin/clock ]; then /sbin/clock -s fi # /etc/issue /etc/motd # , # (/etc/issue) " " (/etc/motd) # # # . , # , . echo > /etc/issue echo Welcome to Linux `/bin/uname -a | /bin/cut -d\ -f3`. >> /etc/issue echo >> /etc/issue echo "`/bin/uname -a | /bin/cut -d\ -f1,3`. (Posix)." > /etc/motd # # , # . , # , # . # # . #/bin/sh /etc/rc.d/rc.serial # named # rc.S
#! /bin/sh
# # # echo "Going multiuser..." # update /sbin/update & # ( ) /bin/setterm -blank 15 # if [ -x /etc/rc.d/rc.inet1 ]; then /bin/hostname vvv # /bin/domainname rinet.ru # /bin/sh /etc/rc.d/rc.inet1 # /bin/sh /etc/rc.d/rc.inet2 else /sbin/hostname_notcp vvv # TCP/IP /bin/domainname rinet.ru echo echo "Since you don't have TCP/IP installed, syslogd will complain when it first" echo "starts. The warning can be ignored." echo /usr/sbin/syslogd /usr/sbin/klogd /usr/sbin/lpd /usr/sbin/crond fi # /bin/rm -f /usr/spool/locks/* /usr/spool/uucp/LCK..* /tmp/.X*lock 1> /dev/null 2> /dev/null # if [ -r /tmp/hunt -o -r /tmp/hunt.stats ]; then echo "Removing your stale hunt sockets from /tmp..." /bin/rm -f /tmp/hunt* fi # /sbin/ldconfig # , /etc/rc.d/rc.local # rc.M
, inittab , Linux- host-. .
, - (, ) - ! - - rc.local. , - , rc.local - .
, UNIX- . , .
, - . , UNIX- , . . .
, Linux -, , , (, , , ). , - - !
! Linux - , , , , . , (, MetalBase 5.0) - !
. Linux /bin/shutdown. , ?
, " "-Ctrl-Alt-Del. , .
, ( , ) , , root ( root, /root ),
shutdown -q now
, now ( ) . , ( Release 2 Release 3) shutdown , , , UNIX- , . - Release 4 , .
, shutdown , . , , . , , shutdown : " 8 ".
shutdown? /etc/shutdown.rc. , - ( root) " " "" ( !). , , . Reset .
, reboot, shutdown, , .
, , . , , (panic mode) . , , Reset. , , fsck ( ) . ( SAG ), update , , .
, sync, , . , , -, shutdown. , , clean filesystem ext2fs ( [1]) , fsck .
"" .
. sync- , , . , / .
. , , , .
( demon daemon- !) , . DOOM, "Disk And Execution MONitor". , , , , - . , ( , ). - , LPR LPD. LPR , .
, - , . , . ( , ), , . , .
, UNIX- . /etc/update - ( sync) .
, ps -ax ( , , ). syslogd crond. , , , , ...... , - .
, man . , . , - , - . , , . - , man man - man.
, , . UNIX- , , FTP- BBS, ( ).
, ( , , ). " ", " ..." . .
. (), . getty:
uugetty - ( );
uugetty_ps - , , - ( ) --;
mgetty - , .
login:
LOG IN ( - " "). , , , . , /etc/passwd .
getty /etc/nologin ( , ) ! shutdown . - . . , . !
, " " . , , MS-DOS CP/M, UNIX. " " , , , . Microsoft - MS-DOS . . ( Linux) ls. , -l, :
rw-rw-rw- 1 vovka root 4067 Nov 5 13:12 caterpillar.tar.z
? , , . (1) , . (vovka), , , (root). - , . , DOS , UNIX - ( . , , . , , .tar- , .z gzip. gunzip, tar. .tgz- tar -..).
, . ( , , /). , : , . (r) , - (w) (x). , , -. .
( , , root) . , , " ".
, ( - , UNIX) . , -, (shell). -? x . , UNIX-, ...
. ( JOE, ) , . :
ksh myscript
, . , (, !). chmod. :
chmod {a,u,g,o} {+|-} {r,w,x} < >
(a-, u- , g-, , o- ). , , .
, -, , , . , , , . , :
chmod u+rwx prettysript
chmod g+rx prettyscript chmod o+x prettyscript
---! -- , -- ? !
, . chmod , UNIX-, . , UNIX Digital, Intel , ( , , , 0 7). , . chmod .
, :
chmod 751 prettyscript
? ,
, " ". :
u7 g5 o1
1 1 1 1 0 1 0 0 1
r w x r w x r w x
, :
. , , " 640", , chmod 640 < >.
- , "". , - . - , . , ?
- . . (root), , , , BBS RoCat (Roman Catacombs- LinuxWare 1.0). . , ( - , mv -- DOS- , ln, ), BBS BBS.
, ! ? ? - ?
, . chown, , . chgrp. UNIX .
- . - , . - "others".
. , - , . . (account), -, , .
, , UNIX- , , , .
, . . (, ). , "" .
, , ( ), . , , .
/etc/group, . .
UNIX . -, , , ( -- /etc/passwd).
ASCII-, vi Emacs. UNIX, passwd , . :
vovka:Xv75fs1Z521:102:0:Vladimir Vodolazkiy:/home/vovka:/bin/tcsh
-vovka, . , . , /etc/passwd , , . , -, . . , /etc/passwd. - . , , , .
, Linux-.
. -, /etc/passwd. adduser, /etc/passwd. . -, , , , " " ( , !). , - . , , , . , /bin/sh- - !
groupadd. , . adduser GID (group ID). , adduser , .
? ( - ) ! , , !
. *. (, , , , ).
adduser, , : vovka::102... , (root) !
, . , , , "" , - . , , , .
" ", , , . , " !"
, . , , , , .
, , , , , ( ) .
, :
, . , , MYxND34MN. .
, . ( , , , ). , - . passwd ( ).
, , - ( , , , ).
, .
. . . , , - . , , ( ) a priori. , , - . , .
. , , , ( , !). , , , -, , , .
, . , , , . .
. 700, 711 755. ! , . .
- 644 600. 666, .
, , - -. CONFIG.SYS AUTOEXEC.BAT DOS, , . , 600. :
.login, .logout, .cshrc, .bashrc, .kshrc, .xinitrc, .exrc, .dbxinit,
.profile, .sunview, .mwmrc, .twmrc.
, , , . , -!