From 4365b83b15138ff5a26ccdb33845a5596c686ad7 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 10 Apr 2010 11:46:50 -0700 Subject: [PATCH] Rationalize init logs Signed-off-by: Tom Eastep --- Shorewall-lite/install.sh | 55 ++++++++++++++++++++------------------ Shorewall-lite/logrotate | 2 +- Shorewall/install.sh | 1 + Shorewall6-lite/install.sh | 55 ++++++++++++++++++++------------------ Shorewall6-lite/logrotate | 2 +- Shorewall6/install.sh | 3 ++- 6 files changed, 63 insertions(+), 55 deletions(-) diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index 56735df43..716cc2487 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -336,34 +336,37 @@ if [ -z "$PREFIX" ]; then ln -s ${DEST}/${INIT} /usr/share/shorewall-lite/init fi -if [ -z "$PREFIX" -a -n "$first_install" ]; then - if [ -n "$DEBIAN" ]; then - run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall-lite - ln -s ../init.d/shorewall-lite /etc/rcS.d/S40shorewall-lite - echo "Shorewall Lite will start automatically at boot" - touch /var/log/shorewall-init.log - else - if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then - if insserv /etc/init.d/shorewall-lite ; then - echo "Shorewall Lite will start automatically at boot" - else +if [ -z "$PREFIX" ]; then + touch /var/log/shorewall-lite-init.log + + if [ -n "$first_install" ]; then + if [ -n "$DEBIAN" ]; then + run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall-lite + ln -s ../init.d/shorewall-lite /etc/rcS.d/S40shorewall-lite + echo "Shorewall Lite will start automatically at boot" + else + if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then + if insserv /etc/init.d/shorewall-lite ; then + echo "Shorewall Lite will start automatically at boot" + else + cant_autostart + fi + elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ]; then + if chkconfig --add shorewall-lite ; then + echo "Shorewall Lite will start automatically in run levels as follows:" + chkconfig --list shorewall-lite + else + cant_autostart + fi + elif [ -x /sbin/rc-update ]; then + if rc-update add shorewall-lite default; then + echo "Shorewall Lite will start automatically at boot" + else + cant_autostart + fi + elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically cant_autostart fi - elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ]; then - if chkconfig --add shorewall-lite ; then - echo "Shorewall Lite will start automatically in run levels as follows:" - chkconfig --list shorewall-lite - else - cant_autostart - fi - elif [ -x /sbin/rc-update ]; then - if rc-update add shorewall-lite default; then - echo "Shorewall Lite will start automatically at boot" - else - cant_autostart - fi - elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically - cant_autostart fi fi fi diff --git a/Shorewall-lite/logrotate b/Shorewall-lite/logrotate index 45db65089..3705f60fb 100644 --- a/Shorewall-lite/logrotate +++ b/Shorewall-lite/logrotate @@ -1,4 +1,4 @@ -/var/log/shorewall-init.log { +/var/log/shorewall-lite-init.log { missingok notifempty create 0600 root root diff --git a/Shorewall/install.sh b/Shorewall/install.sh index 23643f23e..4ee970f2f 100755 --- a/Shorewall/install.sh +++ b/Shorewall/install.sh @@ -264,6 +264,7 @@ fi run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/shorewall/configfiles:/usr/share/shorewall|;' ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf +perl -p -w -i -e 's|^STARTUP_LOG=.*|STARTUP_LOG=/var/log/shorewall-lite-init.log' ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf if [ ! -f ${PREFIX}/etc/shorewall/shorewall.conf ]; then run_install $OWNERSHIP -m 0644 configfiles/shorewall.conf ${PREFIX}/etc/shorewall/shorewall.conf diff --git a/Shorewall6-lite/install.sh b/Shorewall6-lite/install.sh index 5ffad4ec3..52d81ee95 100755 --- a/Shorewall6-lite/install.sh +++ b/Shorewall6-lite/install.sh @@ -334,34 +334,37 @@ if [ -z "$PREFIX" ]; then ln -s ${DEST}/${INIT} /usr/share/shorewall6-lite/init fi -if [ -z "$PREFIX" -a -n "$first_install" ]; then - if [ -n "$DEBIAN" ]; then - run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall6-lite - ln -s ../init.d/shorewall6-lite /etc/rcS.d/S40shorewall6-lite - echo "Shorewall6 Lite will start automatically at boot" - touch /var/log/shorewall-init.log - else - if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then - if insserv /etc/init.d/shorewall6-lite ; then - echo "Shorewall6 Lite will start automatically at boot" - else +if [ -z "$PREFIX" ]; then + touch /var/log/shorewall6-lite-init.log + + if [ -n "$first_install" ]; then + if [ -n "$DEBIAN" ]; then + run_install $OWNERSHIP -m 0644 default.debian /etc/default/shorewall6-lite + ln -s ../init.d/shorewall6-lite /etc/rcS.d/S40shorewall6-lite + echo "Shorewall6 Lite will start automatically at boot" + else + if [ -x /sbin/insserv -o -x /usr/sbin/insserv ]; then + if insserv /etc/init.d/shorewall6-lite ; then + echo "Shorewall6 Lite will start automatically at boot" + else + cant_autostart + fi + elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ]; then + if chkconfig --add shorewall6-lite ; then + echo "Shorewall6 Lite will start automatically in run levels as follows:" + chkconfig --list shorewall6-lite + else + cant_autostart + fi + elif [ -x /sbin/rc-update ]; then + if rc-update add shorewall6-lite default; then + echo "Shorewall6 Lite will start automatically at boot" + else + cant_autostart + fi + elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically cant_autostart fi - elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ]; then - if chkconfig --add shorewall6-lite ; then - echo "Shorewall6 Lite will start automatically in run levels as follows:" - chkconfig --list shorewall6-lite - else - cant_autostart - fi - elif [ -x /sbin/rc-update ]; then - if rc-update add shorewall6-lite default; then - echo "Shorewall6 Lite will start automatically at boot" - else - cant_autostart - fi - elif [ "$INIT" != rc.firewall ]; then #Slackware starts this automatically - cant_autostart fi fi fi diff --git a/Shorewall6-lite/logrotate b/Shorewall6-lite/logrotate index ee5e24669..3d2aa7d35 100644 --- a/Shorewall6-lite/logrotate +++ b/Shorewall6-lite/logrotate @@ -1,4 +1,4 @@ -/var/log/shorewall6-init.log { +/var/log/shorewall6-lite-init.log { missingok notifempty create 0600 root root diff --git a/Shorewall6/install.sh b/Shorewall6/install.sh index 07ed6f51f..1d003b083 100755 --- a/Shorewall6/install.sh +++ b/Shorewall6/install.sh @@ -256,7 +256,8 @@ fi # run_install $OWNERSHIP -m 0644 shorewall6.conf ${PREFIX}/usr/share/shorewall6/configfiles/shorewall6.conf -qt mywhich perl && perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/shorewall6/configfiles:/usr/share/shorewall6|;' ${PREFIX}/usr/share/shorewall6/configfiles/shorewall6.conf +perl -p -w -i -e 's|^CONFIG_PATH=.*|CONFIG_PATH=/usr/share/shorewall6/configfiles:/usr/share/shorewall6|;' ${PREFIX}/usr/share/shorewall6/configfiles/shorewall6.conf +perl -p -w -i -e 's|^STARTUP_LOG=.*|STARTUP_LOG=/var/log/shorewall6-lite-init.log' ${PREFIX}/usr/share/shorewall/configfiles/shorewall.conf if [ ! -f ${PREFIX}/etc/shorewall6/shorewall6.conf ]; then run_install $OWNERSHIP -m 0644 shorewall6.conf ${PREFIX}/etc/shorewall6/shorewall6.conf