¦b§Ú®³¨ì Linux ¨Ã¦b§Úªºµ§°O¹q¸£¤W¦w¸Ë¡B°õ¦æ«á¡A §Úµoı¥¦·|¨C´X¬í´N ·|¦s¨ú¤@¦¸µwºÐ¡A´Nºâ¨Ã¨S¦³¥ô¦óªº¨Ï¥ÎªÌñ¤J¨t²Î¤º! ³o´N¬OµwºÐ¥i¯à´N ±q¨S¦³¶i¤J¥¦ªº¯à·½¬Ù¹q¼Ò¦¡¡C¯à°÷´î¤ÖµwºÐªº°Ê§@ªº¸Ü´N¥i¥H«Ü©úÅã¦a¼W ¥[¹q¦Àªº¨Ï¥Î®É¶¡¡A¥H¤U¬O§Ú©Ò»`¶°ªº°t¤è¡C
§Ú¨Ï¥Î RedHat 4.1 ´ú¸Õ¤F©Ò¦³ªº¤èªk¡A¦³¨Ç«Øºc³]©wªº¦a¤è¥i¯à·|»P§A©Ò ¨Ï¥Îªº Linux ¨ÑÀ³ª©¥»¤£¦P¡C(¦pªG¯u¦p¦¹¡A½Ð±zÅý§Úª¾¹D¡C)
½ÐÀˬd§Aªº /etc/crontab
Àɮ׬ݬݬO§_¥¦·|¦b¨C¤ÀÄÁ°Ê§@¤@¦¸
¡C§A·|¬Ý¨ì atrun
±`·|¥X²{¦bùر¡C
¨Ï¥Î at
©R¥O¥i¥HÅý§A±N¥¼¨Ón°µªº©R¥O©ñ¦b©R¥O°±«Ý°Ï¤º¡A ®É¶¡¨ì
¤F´N·|°õ¦æ¥¦Ì¡C ¦³¨Ç Linux ¨t²Î¨Ï¥Î¦Ûqªº atd
ºëîú¨Ó°µ³oÓ¤u
§@¡A ¨ä¥Lªº (¨Ò¦p RedHat) Åý crond
ºëÆF¨C¤ÀÄÁ°õ¦æ atrun
¤@¦¸¡C
¤j³¡¥÷ªº¨t²Î¤W¬O§_»Ý¦p¦¹°µªº¡A ¦]¬° at
©R¥O«Ü¤Ö·|¨Ì¿à¤@©wªº®É
¶¡¤º³Q°õ¦æ¡A ¦]¦¹¦pªG§A¦b§Aªº /etc/crontab
Àɮפºµo²{¤U±
³o¦æ:
# Run any at jobs every minute
* * * * * root [ -x /usr/sbin/atrun ] && /usr/sbin/atrun
§A´N¥i¥H¦w¥þ¦a§â¥¦§ï¦¨:
# Run any at jobs every hour
00 * * * * root [ -x /usr/sbin/atrun ] && /usr/sbin/atrun
²Ó¸`½Ð¾\Ū man 5 crontab
¡C ¦³¨Ç¤H´Nºâ¦b¨S¦³°õ¦æ crond
ºë
ÆF¤UÁÙ¬O¥i¥H°Ê§@¡A¦]¦¹¦pªG§Aª¾¹D§A¦b°µ¤°»ò¡A§A¥i¥H¦Ò¼{§¹¥þ¦a§â¥¦µ¹
Ãö³¬±¼¡C
Linux ¦b¥ô¦ó®ÉÔ³£¦b³B²zµÛ«Ü¦hªº¤w¶}±ÒÀɮתº½w½Ä°Ï¡A¨Ó°µ¨t²Î«Ü½T»{ Àɮצ³¥ô¦ó§ïÅܮɯà°÷·U§Ö¦sÀÉ·U¦n¡A¤£µMµ¥¨ì¨t²Î·í¾÷®É¤w°µªº§ïÅÜ´N·| ¤£¨£¤F¡C
update
/ bdflush
ºëÆF´N¬O¥Î¨Ó·ÓÅU³o¥ó®Éªº¡C(³o¬O¦P¤@Óµ{
¦¡ªº¨âÓ¦W¦r¡A ¦]¦¹§A¥i¥H¨Ï¥Î¨âӨ䤤ªº¤@Ó¦W¦r¨Ó±Ò°Ê³oÓºëÆF¡C )
ì¨Óªº³]©w·|Åý³oÓºëÆF¨C 5 ¬íÄÁ©I¥s flush
¥H¤Î¨C 30 ¬íÄÁ©I¥s
sync
¤@¦¸¡C
¦b§Úªº Fujitsu ´I¤h³qºÏºÐ¤W·|³y¦¨¤£°±ªº¦s¨ú¡C(¦n¹³³oÓµwºÐ´Nºâ¸ò¥» ¤°»ò¤]¨S§ïÅܪºª¬ªp¤U·|±N¥¦ªº°O¾ÐÅé§Ö¨úµ¹²M°£±¼¡C¦ý³on¬Ý§AªºµwºÐªº °bÅé: ¦³¨ÇªB¤Í§i¶D§Ú»¡´Nºâ¨S¦³°µ¹³¤U±¨º¼Ëªº×§ï¥L̪ºµwºÐÁÙ¬O¥i¥H ¶i¤J¥»¨ªº¬Ù¹q¼Ò¦¡¤U¡C)
¦]¬° Linux ¨Ã¹³¥H«e¨º¼Ë±`·í¾÷¤F¡A §Ú´N±N¨âÓ¼Æȳ£§ï¦¨¬° 3600 ¬í (=1 ¤p®É )¡C³o¼Ë¤@ÂI¤]¤£·|³y¦¨¥ô¦ó°ÝÃD¡A¦Ó¥B쥻±`·|¦³ªººÏºÐ¦s¨ú°Ê §@´N°±¤î¤F¡C (¦ý¬O¦pªG§Úªº¨t²Î²{¦b·í¾÷¤F¡A·íµM¤@©w·|¦³³\¦h¯}·lªºÀÉ ®×¤F¡C)
RedHat 4.1: ¦b /etc/inittab
¤º¡A±N update ©I¥s§ï¦¨:
ud::once:/sbin/update -s 3600 -f 3600
Suse 4.4.1: update
is called in /sbin/init.d/boot
.
Slackware: update
is called in /etc/rc.d/rc.S
.
See man update
for details.
syslogd
ºëÆFt³d«Ü¦h¦b /var/log/
¥Ø¿ý¤º¥i§ä¨ìªº
Linux ¨t²Î¤é»xÀɮסCì©w syslogd
·|¦b¨C¦¸¦³¨t²Î°T®§³Q°O¿ý®É¦P
¨B¦s¨ì¤é»xÀɮפº¡C
§A¥i¥H¦b /etc/syslog.conf
¤º¨Ï¥Î±×¸¹ / ±µ¦bÀɮצWºÙ«e±N³o
Ó¥\¯àÃö³¬¡C¥H¤U¬O§Ú¦b§Úªº¨t²Î¤º§ä¨ìªº syslog.conf
¨Ò¤l:
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none -/var/log/messages
¦P¼Ëªº¡A¦pªG·í¨t²Î·í¾÷®É¡A°ÝÃD°T®§¬O¤£·|³Q¦s¨ìºÏºÐ¤ºªº¡CDilemma...
¦b¶}¾÷®É¡A ªì©l®Éªº³B²zµ{¦¡¥H¤ÎºëÆF̬O¸g¥Ñ init
©R¥O¨Ó¶}©l°õ
¦æªº¡C³oÓ©R¥O (¤S¬O¥¦ ) ¦b¨C¦¸¥¦©Ò«Ø¥ßªº³B²zµ{¦¡«e·|©I¥s sync
¡C
§A¥i¥H¦bì©lµ{¦¡½X¤¤±N³oÓ sync()
©I¥sµ¹²¾¨«¡AµM«á¦A«·s½sĶ
¥¦¡C
nÁקKµo¥ÍÀÉ®×½w½Ä¿ò¥¢ªº°ÝÃD¡A§AÀ³¸Ó¦b§Aªº¨t²Îªº
/etc/rc.d/init.d/halt
©R¥O¤â½Z¤º¦b¨ø¤UÀɮרt²Î«e¥[¤W¹ï
sync
ªº©I¥s¡C
Linux swap ºÏ°Ï¬O¥Î¨Ó¥HµêÀÀ°O¾ÐÅ骺¤è¦¡¨Ó¼W¥[¹êÅé°O¾ÐÅ骺ªÅ¶¡¡C ³o
¤]¬OµwºÐ·|¦s¨úªº¥i¯àì¦]¡C¦pªG§Aªºµ§°O¹q¸£¤w¸g¦³³\¦h°ÊºA°O¾ÐÅé RAM
¤F©Î¬O§A¨Ï¥Î«Ü²³æªºÀ³¥Îµ{¦¡ (·Q¨ì vi
)¡A ±z¥i¥H¦Ò¼{§â¥¦µ¹Ãö³¬
¡C
³o·íµMn¬Ý§A¥´ºâ°µ¤°»ò¡C4 ¨ì 8 MB ¨Ã¤£¨¬°÷¡A³o®É§A¸Ó¨Ï¥Î swap ºÏ°Ï ¡C¦³ 8 ¨ì 16 MB ®É¡A¤å¦rµe±¦¡ªºÀ³¥Îµ{¦¡¥i¥H«Ü¦n¦a¤u§@¡A¦pªG§A¯àÁ× §K¨Ï¥Î¤Ó¦hªº¦h¤u¥\¯à¡A §A¥i¥H¦w¥þ¦a§â swap ¥\¯àµ¹Ãö±¼¡C X-Windows Àô¹Ò»Ýn«Ü¦hªº°ÊºA°O¾ÐÅé¡A§A³Ì¦n¤£n¦b¨S¦³ swap ¤U¨Ï¥Î¥¦¡A°£«D§A¦³ 16MB ¥H¤W¡C
(ªþµù: §Ú¨º¥x¦³ 16 MB ªºµ§°O¹q¸£¦bÃö³¬ swap ºÏ°Ï¤U¥i¥H°õ¦æ¤@Ó
emacs
¤u§@¡B 4 Ó bash
shells ÁÙ¦³½sĶ¤@Ӯ֤߳£¨S¦³µo¥Í
°O¾ÐÅ餣°÷ªº±¡ªp¡C³o¹ï§Ú¨Ó»¡´N°÷¤F¡C)
¦pªG§A¤w¸g¦w¸Ë swap ºÏ°Ï¤F¡A§A¥i¥H¦b /etc/rc.d/rc.sysinit
¤ºªº swapon
©R¥O«e¥[Ó hash ²Å¸¹§Y¥i§â¥¦µ¹Ãö³¬¡C ¦pªG§A¤£·Q§â
¥¦¥Ã»·¦a²¾°£¡A¨º´NÅý¨t²Î¦b¶}¾÷®É°Ý§A¬O§_n¨Ï¥Î swap ºÏ°Ï¡C¦b
/etc/rc.d/rc.sysinit
(RedHat 4.1) ©Î
/sbin/init.d/boot
(Suse 4.4.1)ùØÀY:
echo "Should the system use swap?"
echo " 0: No."
echo " 1: Yes."
/bin/echo "Your choice: \c"
read SWAPCHOICE
case "$SWAPCHOICE" in
0)
# Do nothing.
echo "(Swap partitions disabled)"
;;
*)
# Start up swapping.
echo "Activating swap partitions"
swapon -a
esac
¨º»ò§A´N¥i¥H¦b¨Ï¥Î¥æ¬y¹q·½®É¶}±Ò swap ºÏ°Ï¡A¦Ó¨Ï¥Î¹q¦À¬O´N·|Ãö³¬¨¥ ³o¥\¯à¡C
§Ú¨Ï¥Î§Úªºµ§°O¹q¸£¨Óµo®i¡B´ú¸Õµ¹ºô¯¸¨Ï¥Îªº cgi ©R¥O¤â½Z¡A ³o¤]´N¬O ¬°¤°»ò§Ú¦b¥¦¤W±¬[¤FÓ°Ï°ìºô¯¸ªºì¦]¡C¦pªG§A³Ì·Q°µªº¥u¬O¦³®ÉÔ¥Î¨Ó ´ú¸Õ¤@Ó©R¥O¤â½Z©Î¬OÀˬd¬YÓºô¶¦Ó¤w¡A¨º»ò¼Ð·Çªº«Øºc¦ü¥G¬O¤Ó¦h¤F¡C
¦b httpd.conf
ùØ¡A¥un§â MinSpareServers
¥H¤Î
StartServers
ªºÈ§ï¦¨ 1
¡C ³o¹ï¥»¦aºÝªº´ú¸Õ¯¸¤w¸g«Ü°÷¤F¡C
¦pªG§A·QÃö³¬ºô¯¸¦øªA¾¹ªºÃ±¤J¡A§A¥²¶·«·s½sĶ httpd
ºëÆF¡A²Ó¸`
½Ð¾\Ū¤å¥ó¡C
Grant Taylor «·s½sĶ¤F apache ªºÃ±¤J«áµoı³o¼Ë¤l `` ¨Ã¤£·|Åý¥¦°±
¤î churning ºÏºÐ¡C ©Ò¥H§Ú¨Ï¥Î¥t¤@Ó¡A IMHO ¤ñ¸û¦nªº¸Ñ¨M¤èªk: §Ú§â
apache «Øºc¦¨±q inetd ¨Ó°õ¦æ¨ú¥N쥻¥Ñ¦Û¤v¨Ó¡C '' ²Ó¸`½Ð¾\Ū
man inetd
¡C
¬°µ§°O¹q¸£«Øºc XFree86 ¬O¥t¤@Ó¸ÜÃD¤F¡A ¦A¦¸¡A§Ú¥²¶·½Ð§A°Ñ¦Ò Linux µ§°O¹q¸£ºô¶¡A¦b¨º¨à§A¥i¥H§ä¨ì«Ü¦hªº¨ó§U
X ªº±±¨î¥x¦bªÅ¥Õ®É¥u·|§â¿Ã¹õÅܦ¨¶Â¦â¡A ¦ý¨Ã¤£¬O§â¥¦Ãö±¼¡C ´N¦p¦P¦b
³ÆµùÃö©ó±±¨î¥xÅܦ¨ªÅ¥Õ ¤¤´£¨ìªº¡A§A¥i¥H¨Ï¥Î xset
ªº dpms ¿ï¶µ¨Ó§ïÅÜ¥¦¡CµM¦Ó¡A³o¶µ
¥\¯à±o¬Ý§Aªºµ§°O¹q¸£ªºÃ¸¹Ï´¹¤ù¥H¤Î bios ¤F.
Grant Taylor ¨Ï¥Î¥H¤Uªº³]©w¥H¤Î apmd
©M¿Ã¹õ«OÅ@µ{¦¡ªº¨ó§U¨Ó¶Ç
°e¨Ï¥Lªºµ§°O¹q¸£¶i¤JºÎ¯vª¬ºA¡C
# Run xscreensaver with APM program
xscreensaver -timeout 5 \
-xrm xscreensaver.programs:apm_standby \
-xrm xscreensaver.colorPrograms:apm_standby &
³oÓ ``apm_standby
¬OÓ¥u¤¹³\¯S©w¤H¤h¨Ó°õ¦æ apm -S
ªº
suid perl ¤â½Z¡C''
¦nªº¡A emacs
¨Ã«D¤£¬OÓ½s¿è¾¹¡A ¦ý¬Oӥͬ¡¤è¦¡¡C ¥H¤U¬O¥Ñ
Florent Chabaud ´£¨Ñªº±K³Z: `` ¦pªG§A¨Ï¥Î emacs
¡A¤]³\§A¤wµo²{
¨ì³oÓ½s¿è¾¹·|°µ¦Û°Ê¦sÀɪº°Ê§@¡A ·íµM³o«Ü¦³¥Î¦Ó¥B¤] ¤£¸Ó §â
¥¦Ãö±¼¡A¦ý쥻¤º©wªº°Ñ¼Æ¥i¥H³Qקï¨Ó°w¹ïµ§°O¹q¸£ªº¨Ï¥Î¡C
§Ú¦b /usr/share/emacs/site-lisp/site-start.el
Àɮפº¥[¤J
¤F¤U¦C´X¦æ:
(setq auto-save-interval 2500)
(setq auto-save-timeout nil)
³o¼Ë¥i¥HÃö³¬¥H®É¶¡¬°°ò·Çªº¦Û°Ê¦sÀÉ¥\¯à¡A¥H§ï¥H¨C 2500 ¦¸Áä½Lªº°Ê§@ ®É¦Û°Ê¦sÀɤ@¦¸¡C·íµM¡A¦pªG§A¥¿¦n¦b¥´¤@«ó¤å¥ó®É¡A³Ì«áªº¨ºÓ°Ñ¼ÆÀ³¸Ó §â¥¦´î¤Ö¡A¦pªG¥¿¦b¼gµ{¦¡¨º»ò¥¦¤w¥iº¡¨¬»Ý¨D¤F¡C¦]¬°¨C¤@Ӱʧ@ (¤W¡B ¤U¡B¥ª¡BË°h¡B¶K¡Aµ¥µ¥......) ³£¦C¤Jpºâ¡A 2500 ¦¸«öÁä½L·|«Ü§Ö´N¨ì ¹Fªº¡C''
¦pªG§Aªº Linux ¨t²Î¤´Â·|±`¥h¦s¨úµwºÐ¡A §A¥i¥H¨Ï¥Î ps ax
©R¥O
¨Ó¬Ý¬Ý¤º³¡¨ì©³¬O«ç»ò¤F¡C³o·|Åã¥Ü¥X©Ò¦³¥¿¦b°õ¦æªºµ{¦¡»P¥¦Ìªº¦WºÙ¡A
¦³®ÉÔ¥¦Ì·|¨q¥X¨CÓ³B²z¤¤ªºµ{¦¡¤§©R¥O¦C°Ñ¼Æ¡C
²{¦b½Ð¾\Ū¨CÓ³B²z¤¤ªºµ{¦¡¤§ man
¶¨Ó¤F¸Ñ¥¦Ì¦b°µÔ£»ò¥H¤Î¦p¦ó
§ïÅÜ¥¦ªº¦æ¬°¡C¥Î³oÓ¤èªk¡A§A¦ü¥G¥i¥H§ä¨ì¤j³¡¥÷ªº³B²z¤¤µ{¦¡©Òt³dªº
¬O¤°»ò¡C§A¥i¯à·|µo²{ strace
¬O«Ü¦³À°§Uªº¡C
¦pªG§Aµo²{¦³þ¨Ç·s¤èªk¡A½Ð§Aµo¹q¤l¶l¥óµ¹§Ú¡C