/usr/share/doc/HOWTO/ja-html/Virtual-Services-HOWTO-6.html is in doc-linux-ja-html 2006.05.25-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Virtual Services Howto: Syslog</TITLE>
<LINK HREF="Virtual-Services-HOWTO-7.html" REL=next>
<LINK HREF="Virtual-Services-HOWTO-5.html" REL=previous>
<LINK HREF="Virtual-Services-HOWTO.html#toc6" REL=contents>
</HEAD>
<BODY>
<A HREF="Virtual-Services-HOWTO-7.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="Virtual-Services-HOWTO-5.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="Virtual-Services-HOWTO.html#toc6">Ìܼ¡¤Ø</A>
<HR>
<H2><A NAME="s6">6. Syslog</A></H2>
<H2><A NAME="ss6.1">6.1 ÌäÂêÅÀ</A>
</H2>
<P><CODE>syslog</CODE>¤ÏUNIX¥·¥¹¥Æ¥à¤Ç¶¦Ä̤·¤Æ»È¤ï¤ì¤ë¥·¥¹¥Æ¥à¥í¥°¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¤¹¡£
(<EM>ÌõÃí¡§</EM>syslog=¥«¡¼¥Í¥ë(kernel)¤Î¥á¥Ã¥»¡¼¥¸¡¦¥ê¥ó¥°¡¦¥Ð¥Ã¥Õ¥¡¡¼
¤òÆɤó¤À¤ê¾Ãµî(clear)¤·¤¿¤ê¤¹¤ë)¡£
<CODE>syslog</CODE>¤Ï<CODE>FIFO(First In First Out)</CODE>¤È¸Æ¤Ð¤ì¤ë¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤ò³«¤¯
¥Ç¡¼¥â¥ó¤Ç¤¹¡£FIFO¤Ï¥Ñ¥¤¥×(pipe)¤Ë»÷¤¿¥¹¥Ú¥·¥ã¥ë¥Õ¥¡¥¤¥ë¤Ç¤¹¡£
syslog¥Ç¡¼¥â¥ó¤Ï¥ê¡¼¥É¥µ¥¤¥É¤«¤é¤Î¥Ç¡¼¥¿¤òÂÔ¤Á¡¢¥é¥¤¥È¥µ¥¤¥É¤Ë½ñ¤¹þ¤à¤¿¤á¤Î
C´Ø¿ô¤¬¤¢¤ê¤Þ¤¹¡£¤â¤·¤³¤ì¤é¤ÎC´Ø¿ô¤Ç¥×¥í¥°¥é¥à¤ò½ñ¤±¤Ð½ÐÎϤÏsyslog¤ËÆþ¤ê¤Þ¤¹¡£
<P><CODE> chroot </CODE>´Ä¶¤ò»È¤Ã¤Æ¤¤¤Æ¡¢<CODE>FIFO /dev/log</CODE>¤Ï²¾Á۴Ķ
¤Ë¤Ï¸ºß¤·¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£¤³¤ì¤ÏÁ´¤Æ¤Î²¾Á۴Ķ¤¬syslog¤Ø¤ÎµÏ¿¤¬
¤Ç¤¤Ê¤¤¤È¤¤¤¦¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤Þ¤¹¡£¥×¥í¥°¥é¥à¤Ï¿·¤·¤¯ºî¤Ã¤¿¤â¤Î¤ÎÂå¤ï
¤ê¤È¤·¤Æ<CODE>/dev/log </CODE>¤ò»È¤¨¤Ê¤¤¤Î¤Ç¡¢¥Õ¥¡¥¤¥ë¤òñ¤Ë¥³¥Ô¡¼¤¹¤ë¤³¤È¤â¤Ç
¤¤Þ¤»¤ó¡£
<P>syslog¤ÎÆÃÄê¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ïudp¥½¥±¥Ã¥È¤òFIFO¤ÎÂå¤ï¤ê¤Ë»È¤Ã¤Æ¤¤¤ë¤â¤Î¤â
¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤ì¤Ï°ìÈÌŪ¤Ê¤³¤È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
<P>
<P>
<H2><A NAME="ss6.2">6.2 ²ò·èÊýË¡</A>
</H2>
<P>
syslog¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ØÄꤹ¤ì¤Ð¡¢°Û¤Ê¤ëFIFO¤òõ¤·¤Þ¤¹¡£
Î㤨¤Ð°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
<PRE>
syslog -p /virtual/log
</PRE>
¤½¤·¤Æ/dev/log¤ò/virtual/log¤Ë¥ê¥ó¥¯¤ò¤Ï¤ê¤Þ¤¹(¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯)¡£
<PRE>
ln -sf /virtual/log /dev/log
</PRE>
¤Ä¤®¤Ë°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¤³¤Î¥Õ¥¡¥¤¥ë¤ËÁ´¤Æ¤Î<CODE>/dev/log</CODE>¤ò¥ê¥ó¥¯¤·¤Þ¤¹
(¤³¤ì¤Ï¥Ï¡¼¥É¥ê¥ó¥¯¤Ç¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ)¡£
<PRE>
ln /virtual/log /virtual/domain.com/dev/log
</PRE>
¾åµ¤Îvirtfs¥¹¥¯¥ê¥×¥È¤Ç¤Ï¤¹¤Ç¤Ë¤³¤ì¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£<CODE>/virtual</CODE>¤Ï°ì¤Ä
¤ÎϢ³¤·¤¿¥Ç¥£¥¹¥¯¤Ë¤¢¤ê¡¢<CODE>/dev/log</CODE>¤Ï¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¤Î¤ÇƱ¤¸inode
Èֹ椫¤ÄƱ¤¸¥Ç¡¼¥¿¤ò»Ø¤¹¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£<CODE>chroot</CODE>¤Ï¤³¤ì¤ò¥¹¥È¥Ã¥×
¤Ç¤¤Ê¤¤¤Î¤ÇÁ´¤Æ¤Î²¾ÁÛ<CODE>/dev/log</CODE>¤Ïµ¡Ç½¤·¤Þ¤¹¡£Á´´Ä¶¤«¤é¤Î¥á¥Ã¥»¡¼¥¸
¤Ï°ì¤Ä¤Î¾ì½ê¤ËµÏ¿¤µ¤ì¤Þ¤¹¡£¤·¤«¤·¤â¤·¥×¥í¥°¥é¥à¤ò½ñ¤¤¿¤¯¤Ê¤¯¡¢¤½¤ì¤¾¤ìlog
¥Õ¥¡¥¤¥ë¤òʬ¤±¤¿¤¤¤È¤¤¤¦¾ì¹ç¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÊÌ¡¹¤Ësyslog¤ò»È¤¦¤³¤È¤â¤Ç¤¤Þ
¤¹¡£
<PRE>
syslog -p /virtual/domain1.com/dev/log
syslog -p /virtual/domain2.com/dev/log
</PRE>
¤â¤Ã¤È¤â¤³¤¦¤¹¤ë¤³¤È¤Ï¥×¥í¥»¥¹ID¤ÎϲÈñ¤Ê¤Î¤Ç¤ª¾©¤á¤·¤Þ¤»¤ó¡£
¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Îsyslog.init¤Ï¡¢ÉÔŬÀÚ¤ÊÀßÄ꤬¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ïµ¯Æ°¤¹¤ëÅÙ¤Ë
Ëè²ó /dev/log ¤ËºÆ¥ê¥ó¥¯¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
°Ê²¼¡¢½¤Àµ¤·¤¿syslog.init¥Õ¥¡¥¤¥ë¤òµó¤²¤Æ¤ª¤¤Þ¤¹¡£
<HR>
<PRE>
#!/bin/sh
# Source function library.
. /etc/rc.d/init.d/functions
case "$1" in
start)
echo -n "Starting dev log: "
ln -sf /virtual/log /dev/log
echo done
echo -n "Starting system loggers: "
daemon syslogd -p /virtual/log
daemon klogd
echo
echo -n "Starting virtual dev log: "
for i in /virtual/*
do
if [ ! -d "$i" ]
then
continue
fi
if [ "$i" = "/virtual/lost+found" ]
then
continue
fi
ln -f /virtual/log $i/dev/log
echo -n "."
done
echo " done"
touch /var/lock/subsys/syslog
;;
stop)
echo -n "Shutting down system loggers: "
killproc syslogd
killproc klogd
echo
rm -f /var/lock/subsys/syslog
;;
*)
echo "Usage: syslog {start|stop}"
exit 1
esac
exit 0
</PRE>
<HR>
°ìÂæ¤Î¥Ç¥£¥¹¥¯¤ËÁ´¤Æ¤Î²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÃÖ¤«¤Ê¤¯¤Æ¤â¤è¤¤¤³¤È¤Ë
Ãí°Õ¤·¤Æ²¼¤µ¤¤¡£¤â¤Ã¤È¤â¥Ç¥£¥¹¥¯¾å¤Ë²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»ý¤Ä³Æ¥Ñ¡¼¥Æ¥£
¥·¥ç¥óÍѤÎsyslog¤ò¼Â¹Ô¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Ç¤·¤ç¤¦¡£
<P>
<HR>
<A HREF="Virtual-Services-HOWTO-7.html">¼¡¤Î¥Ú¡¼¥¸</A>
<A HREF="Virtual-Services-HOWTO-5.html">Á°¤Î¥Ú¡¼¥¸</A>
<A HREF="Virtual-Services-HOWTO.html#toc6">Ìܼ¡¤Ø</A>
</BODY>
</HTML>
|