From: Heiko Z. <smi...@us...> - 2006-05-04 01:16:33
|
Update of /cvsroot/devil-linux/build/config/etc/init.d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23817/config/etc/init.d Modified Files: Tag: rel-1-2-patches jail Log Message: - syslog-ng now uses unix-dgram instead of unix-stream - chroot jails don't use syslog-ng anymore, jk_socketd forwards the messages Index: jail =================================================================== RCS file: /cvsroot/devil-linux/build/config/etc/init.d/jail,v retrieving revision 1.27.2.10 retrieving revision 1.27.2.11 diff -u -d -r1.27.2.10 -r1.27.2.11 --- jail 24 Nov 2005 16:00:28 -0000 1.27.2.10 +++ jail 4 May 2006 01:16:27 -0000 1.27.2.11 @@ -18,6 +18,10 @@ source /etc/init.d/functions +JAIL_SYSLOG_BASE=2048 +JAIL_SYSLOG_PEEK=4096 +JAIL_SYSLOG_INTERVAL=10 + # settings source /etc/sysconfig/config @@ -261,31 +265,23 @@ #echo "copying libraries" cp_libs $JAILDIR/ - echo -n "." - - #echo "adding syslog support" - - case $SYSLOG_DAEMON in - syslog-ng ) - if [ -z "$(grep "unix-stream(\"$JAILDIR/dev/log\"" /etc/syslog-ng/syslog-ng.conf)" ]; then - sed -e "s|^source src {|source src { unix-stream(\"$JAILDIR/dev/log\" max-connections(1000));|" < /etc/syslog-ng/syslog-ng.conf > /tmp/tmpfile - mv /tmp/tmpfile /etc/syslog-ng/syslog-ng.conf - /etc/init.d/syslog reload - fi - ;; - - syslogd ) - ln -f /var/run/log $JAILDIR/dev/log - ;; - - *) - $FAILURE - echo unkown SYSLOG Daemon - echo please check SYSLOG_DAEMON in /etc/sysconfig/config - $NORMAL - ;; - esac + print_status success + echo -n "Starting log forwarding daemon" + # make sure we remove all the old entries + if [ ! -z "$(grep "unix-stream(\"$JAILDIR/dev/log\"" /etc/syslog-ng/syslog-ng.conf)" ]; then + sed -e "s| unix-stream(\".*/dev/log\" max-connections(1000));||g" < /etc/syslog-ng/syslog-ng.conf > /tmp/tmpfile + mv /tmp/tmpfile /etc/syslog-ng/syslog-ng.conf + /etc/init.d/syslog reload + fi + if [ ! -z "$(grep "unix-stream(\"/dev/log\"" /etc/syslog-ng/syslog-ng.conf)" ]; then + sed -e "s|unix-stream(\"/dev/log\"|unix-dgram(\"/dev/log\"|g" < /etc/syslog-ng/syslog-ng.conf > /tmp/tmpfile + mv /tmp/tmpfile /etc/syslog-ng/syslog-ng.conf + /etc/init.d/syslog reload + fi + + /usr/sbin/jk_socketd --socket $JAILDIR/dev/log --base $JAIL_SYSLOG_BASE --peek $JAIL_SYSLOG_PEEK \ + --interval $JAIL_SYSLOG_INTERVAL --pidfile /var/run/jk_socketd_$PACKAGE print_status success @@ -295,25 +291,10 @@ fi ;; stop ) - case $SYSLOG_DAEMON in - syslog-ng ) - sed -e "s| unix-stream(\"$JAILDIR/dev/log\" max-connections(1000));||" < /etc/syslog-ng/syslog-ng.conf > /tmp/tmpfile - mv /tmp/tmpfile /etc/syslog-ng/syslog-ng.conf - /etc/init.d/syslog reload - ;; - - syslogd) - ;; - - *) - $FAILURE - echo unkown SYSLOG Daemon - echo please check SYSLOG_DAEMON in /etc/sysconfig/config - $NORMAL - ;; - esac - /etc/init.d/syslog reload + kill $(cat /var/run/jk_socketd_$PACKAGE) + rm /var/run/jk_socketd_$PACKAGE &> /dev/null + # parse jail file grep -v "^#" $JAIL_DEF | grep -v ^$ > /tmp/.jailtmp while read COMMAND PARAM; do |