From 8fd038b2624d7b5f14f0831ed4b5ab1dd13e5674 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Wed, 11 Jul 2018 18:00:12 +0000 Subject: [PATCH] - logging cosmetics --- shorewall-config.patch | 19 ++- shorewall-logging.patch | 343 ++++++++++++++++++++++++++++++++++++++++ shorewall.logrotate | 5 + shorewall.spec | 26 +-- 4 files changed, 375 insertions(+), 18 deletions(-) create mode 100644 shorewall-logging.patch create mode 100644 shorewall.logrotate diff --git a/shorewall-config.patch b/shorewall-config.patch index e2f5d79..1202f68 100644 --- a/shorewall-config.patch +++ b/shorewall-config.patch @@ -1,21 +1,24 @@ diff -ur shorewall-5.2.0.4.orig/shorewall-5.2.0.4/configfiles/shorewall.conf shorewall-5.2.0.4/shorewall-5.2.0.4/configfiles/shorewall.conf --- shorewall-5.2.0.4.orig/shorewall-5.2.0.4/configfiles/shorewall.conf 2018-05-18 17:18:09.000000000 +0000 -+++ shorewall-5.2.0.4/shorewall-5.2.0.4/configfiles/shorewall.conf 2018-06-14 21:47:03.135155987 +0000 -@@ -49,7 +49,7 @@ ++++ shorewall-5.2.0.4/shorewall-5.2.0.4/configfiles/shorewall.conf 2018-07-11 17:41:38.155301202 +0000 +@@ -101,7 +101,7 @@ - LOGALLNEW= + RESTOREFILE=restore --LOGFILE=/var/log/messages -+LOGFILE=/var/log/kernel +-SHOREWALL_SHELL=/bin/sh ++SHOREWALL_SHELL=/bin/bash - LOGFORMAT="%s %s " + SUBSYSLOCK=/var/lock/subsys/shorewall -@@ -101,7 +101,7 @@ +diff -ur shorewall-5.2.0.4.orig/shorewall6-5.2.0.4/configfiles/shorewall6.conf shorewall-5.2.0.4/shorewall6-5.2.0.4/configfiles/shorewall6.conf +--- shorewall-5.2.0.4.orig/shorewall6-5.2.0.4/configfiles/shorewall6.conf 2018-05-18 17:18:09.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall6-5.2.0.4/configfiles/shorewall6.conf 2018-07-11 17:42:08.487299394 +0000 +@@ -98,7 +98,7 @@ RESTOREFILE=restore -SHOREWALL_SHELL=/bin/sh +SHOREWALL_SHELL=/bin/bash - SUBSYSLOCK=/var/lock/subsys/shorewall + SUBSYSLOCK=/var/lock/subsys/shorewall6 diff --git a/shorewall-logging.patch b/shorewall-logging.patch new file mode 100644 index 0000000..ef81397 --- /dev/null +++ b/shorewall-logging.patch @@ -0,0 +1,343 @@ +diff -ur shorewall-5.2.0.4.orig/shorewall-5.2.0.4/configfiles/shorewall.conf shorewall-5.2.0.4/shorewall-5.2.0.4/configfiles/shorewall.conf +--- shorewall-5.2.0.4.orig/shorewall-5.2.0.4/configfiles/shorewall.conf 2018-07-11 17:42:26.621298313 +0000 ++++ shorewall-5.2.0.4/shorewall-5.2.0.4/configfiles/shorewall.conf 2018-07-11 17:44:09.647292172 +0000 +@@ -49,9 +49,9 @@ + + LOGALLNEW= + +-LOGFILE=/var/log/messages ++LOGFILE=/var/log/shorewall + +-LOGFORMAT="%s %s " ++LOGFORMAT="Shorewall: %s %s " + + LOGTAGONLY=No + +@@ -67,7 +67,7 @@ + + SMURF_LOG_LEVEL="$LOG_LEVEL" + +-STARTUP_LOG=/var/log/shorewall-init.log ++STARTUP_LOG=/var/log/shorewall-init + + TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL" + +diff -ur shorewall-5.2.0.4.orig/shorewall-5.2.0.4/install.sh shorewall-5.2.0.4/shorewall-5.2.0.4/install.sh +--- shorewall-5.2.0.4.orig/shorewall-5.2.0.4/install.sh 2018-05-18 18:46:49.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall-5.2.0.4/install.sh 2018-07-11 17:47:50.239279024 +0000 +@@ -1215,8 +1215,8 @@ + fi + + if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then +- run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}${CONFDIR}/logrotate.d/${PRODUCT} +- echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/${PRODUCT}" ++ run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}${CONFDIR}/logrotate.d/${PRODUCT}-init ++ echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/${PRODUCT}-init" + fi + + # +@@ -1254,7 +1254,7 @@ + echo "${PRODUCT} will start automatically at boot" + if [ $HOST = debian ]; then + echo "Set startup=1 in ${CONFDIR}/default/${PRODUCT} to enable" +- touch /var/log/${PRODUCT}-init.log ++ touch /var/log/${PRODUCT}-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf to enable" +@@ -1273,7 +1273,7 @@ + elif mywhich update-rc.d ; then + echo "${PRODUCT} will start automatically at boot" + echo "Set startup=1 in ${CONFDIR}/default/${PRODUCT} to enable" +- touch /var/log/${PRODUCT}-init.log ++ touch /var/log/${PRODUCT}-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf + update-rc.d ${PRODUCT} enable + elif mywhich rc-update ; then +@@ -1281,7 +1281,7 @@ + echo "${PRODUCT} will start automatically at boot" + if [ $HOST = debian ]; then + echo "Set startup=1 in ${CONFDIR}/default/${PRODUCT} to enable" +- touch /var/log/${PRODUCT}-init.log ++ touch /var/log/${PRODUCT}-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf to enable" +diff -ur shorewall-5.2.0.4.orig/shorewall-5.2.0.4/logrotate shorewall-5.2.0.4/shorewall-5.2.0.4/logrotate +--- shorewall-5.2.0.4.orig/shorewall-5.2.0.4/logrotate 2018-05-18 17:18:09.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall-5.2.0.4/logrotate 2018-07-11 17:43:00.277296307 +0000 +@@ -1,4 +1,4 @@ +-/var/log/shorewall-init.log { ++/var/log/shorewall-init { + missingok + notifempty + create 0600 root root +diff -ur shorewall-5.2.0.4.orig/shorewall-5.2.0.4/uninstall.sh shorewall-5.2.0.4/shorewall-5.2.0.4/uninstall.sh +--- shorewall-5.2.0.4.orig/shorewall-5.2.0.4/uninstall.sh 2018-05-18 18:46:49.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall-5.2.0.4/uninstall.sh 2018-07-11 17:47:41.736279531 +0000 +@@ -216,7 +216,7 @@ + esac + done + +-remove_file ${CONFDIR}/logrotate.d/$PRODUCT ++remove_file ${CONFDIR}/logrotate.d/$PRODUCT-init + + [ -n "$SYSTEMD" ] && remove_file ${SYSTEMD}/${PRODUCT}.service + +diff -ur shorewall-5.2.0.4.orig/shorewall6-5.2.0.4/configfiles/shorewall6.conf shorewall-5.2.0.4/shorewall6-5.2.0.4/configfiles/shorewall6.conf +--- shorewall-5.2.0.4.orig/shorewall6-5.2.0.4/configfiles/shorewall6.conf 2018-07-11 17:42:26.621298313 +0000 ++++ shorewall-5.2.0.4/shorewall6-5.2.0.4/configfiles/shorewall6.conf 2018-07-11 17:43:46.477293554 +0000 +@@ -48,9 +48,9 @@ + + LOGALLNEW= + +-LOGFILE=/var/log/messages ++LOGFILE=/var/log/shorewall + +-LOGFORMAT="%s %s " ++LOGFORMAT="Shorewall: %s %s " + + LOGLIMIT="s:1/sec:10" + +@@ -66,7 +66,7 @@ + + SMURF_LOG_LEVEL="$LOG_LEVEL" + +-STARTUP_LOG=/var/log/shorewall6-init.log ++STARTUP_LOG=/var/log/shorewall6-init + + TCP_FLAGS_LOG_LEVEL="$LOG_LEVEL" + +diff -ur shorewall-5.2.0.4.orig/shorewall6-5.2.0.4/install.sh shorewall-5.2.0.4/shorewall6-5.2.0.4/install.sh +--- shorewall-5.2.0.4.orig/shorewall6-5.2.0.4/install.sh 2018-05-18 18:46:49.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall6-5.2.0.4/install.sh 2018-07-11 17:47:07.879281549 +0000 +@@ -1215,8 +1215,8 @@ + fi + + if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then +- run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}${CONFDIR}/logrotate.d/${PRODUCT} +- echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/${PRODUCT}" ++ run_install $OWNERSHIP -m 0644 logrotate ${DESTDIR}${CONFDIR}/logrotate.d/${PRODUCT}-init ++ echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/${PRODUCT}-init" + fi + + # +@@ -1254,7 +1254,7 @@ + echo "${PRODUCT} will start automatically at boot" + if [ $HOST = debian ]; then + echo "Set startup=1 in ${CONFDIR}/default/${PRODUCT} to enable" +- touch /var/log/${PRODUCT}-init.log ++ touch /var/log/${PRODUCT}-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf to enable" +@@ -1273,7 +1273,7 @@ + elif mywhich update-rc.d ; then + echo "${PRODUCT} will start automatically at boot" + echo "Set startup=1 in ${CONFDIR}/default/${PRODUCT} to enable" +- touch /var/log/${PRODUCT}-init.log ++ touch /var/log/${PRODUCT}-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf + update-rc.d ${PRODUCT} enable + elif mywhich rc-update ; then +@@ -1281,7 +1281,7 @@ + echo "${PRODUCT} will start automatically at boot" + if [ $HOST = debian ]; then + echo "Set startup=1 in ${CONFDIR}/default/${PRODUCT} to enable" +- touch /var/log/${PRODUCT}-init.log ++ touch /var/log/${PRODUCT}-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/${PRODUCT}/${PRODUCT}.conf to enable" +diff -ur shorewall-5.2.0.4.orig/shorewall6-5.2.0.4/logrotate shorewall-5.2.0.4/shorewall6-5.2.0.4/logrotate +--- shorewall-5.2.0.4.orig/shorewall6-5.2.0.4/logrotate 2018-05-18 17:18:09.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall6-5.2.0.4/logrotate 2018-07-11 17:43:27.447294688 +0000 +@@ -1,4 +1,4 @@ +-/var/log/shorewall6-init.log { ++/var/log/shorewall6-init { + missingok + notifempty + create 0600 root root +diff -ur shorewall-5.2.0.4.orig/shorewall6-5.2.0.4/uninstall.sh shorewall-5.2.0.4/shorewall6-5.2.0.4/uninstall.sh +--- shorewall-5.2.0.4.orig/shorewall6-5.2.0.4/uninstall.sh 2018-05-18 18:46:49.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall6-5.2.0.4/uninstall.sh 2018-07-11 17:47:15.348281104 +0000 +@@ -216,7 +216,7 @@ + esac + done + +-remove_file ${CONFDIR}/logrotate.d/$PRODUCT ++remove_file ${CONFDIR}/logrotate.d/$PRODUCT-init + + [ -n "$SYSTEMD" ] && remove_file ${SYSTEMD}/${PRODUCT}.service + +diff -ur shorewall-5.2.0.4.orig/shorewall6-lite-5.2.0.4/install.sh shorewall-5.2.0.4/shorewall6-lite-5.2.0.4/install.sh +--- shorewall-5.2.0.4.orig/shorewall6-lite-5.2.0.4/install.sh 2018-05-18 18:46:50.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall6-lite-5.2.0.4/install.sh 2018-07-11 17:47:32.928280056 +0000 +@@ -459,8 +459,8 @@ + fi + + if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then +- install_file logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT 0644 +- echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT" ++ install_file logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT-init 0644 ++ echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT-init" + fi + + # +@@ -510,7 +510,7 @@ + echo "$PRODUCT will start automatically at boot" + if [ $HOST = debian ]; then + echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable" +- touch /var/log/$PRODUCT-init.log ++ touch /var/log/$PRODUCT-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" +@@ -529,7 +529,7 @@ + elif mywhich update-rc.d ; then + echo "$PRODUCT will start automatically at boot" + echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable" +- touch /var/log/$PRODUCT-init.log ++ touch /var/log/$PRODUCT-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf + update-rc.d $PRODUCT enable + elif mywhich rc-update ; then +@@ -537,7 +537,7 @@ + echo "$PRODUCT will start automatically at boot" + if [ $HOST = debian ]; then + echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable" +- touch /var/log/$PRODUCT-init.log ++ touch /var/log/$PRODUCT-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" +diff -ur shorewall-5.2.0.4.orig/shorewall6-lite-5.2.0.4/logrotate shorewall-5.2.0.4/shorewall6-lite-5.2.0.4/logrotate +--- shorewall-5.2.0.4.orig/shorewall6-lite-5.2.0.4/logrotate 2018-05-18 17:18:09.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall6-lite-5.2.0.4/logrotate 2018-07-11 17:43:19.397295168 +0000 +@@ -1,4 +1,4 @@ +-/var/log/shorewall6-lite-init.log { ++/var/log/shorewall6-lite-init { + missingok + notifempty + create 0600 root root +diff -ur shorewall-5.2.0.4.orig/shorewall6-lite-5.2.0.4/uninstall.sh shorewall-5.2.0.4/shorewall6-lite-5.2.0.4/uninstall.sh +--- shorewall-5.2.0.4.orig/shorewall6-lite-5.2.0.4/uninstall.sh 2018-05-18 18:46:50.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall6-lite-5.2.0.4/uninstall.sh 2018-07-11 17:47:20.438280800 +0000 +@@ -190,7 +190,7 @@ + remove_directory ${VARDIR} + remove_directory ${SHAREDIR}/$PRODUCT + remove_directory ${LIBEXECDIR}/$PRODUCT +-remove_file ${CONFDIR}/logrotate.d/$PRODUCT ++remove_file ${CONFDIR}/logrotate.d/$PRODUCT-init + + if [ -n "$SYSCONFDIR" ]; then + [ -n "$SYSCONFFILE" ] && remove_file ${SYSCONFDIR}/${PRODUCT} +diff -ur shorewall-5.2.0.4.orig/shorewall-init-5.2.0.4/install.sh shorewall-5.2.0.4/shorewall-init-5.2.0.4/install.sh +--- shorewall-5.2.0.4.orig/shorewall-init-5.2.0.4/install.sh 2018-05-18 18:46:49.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall-init-5.2.0.4/install.sh 2018-07-11 17:50:51.169268240 +0000 +@@ -328,8 +328,8 @@ + # Install logrotate file + # + if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then +- install_file logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT 0644 +- echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT" ++ install_file logrotate ${DESTDIR}${CONFDIR}/logrotate.d/shorewall-ifupdown 0644 ++ echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/shorewall-ifupdown" + fi + + # +diff -ur shorewall-5.2.0.4.orig/shorewall-init-5.2.0.4/logrotate shorewall-5.2.0.4/shorewall-init-5.2.0.4/logrotate +--- shorewall-5.2.0.4.orig/shorewall-init-5.2.0.4/logrotate 2018-05-18 17:18:09.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall-init-5.2.0.4/logrotate 2018-07-11 17:51:06.968267298 +0000 +@@ -1,4 +1,4 @@ +-/var/log/shorewall-ifupdown.log { ++/var/log/shorewall-ifupdown { + missingok + notifempty + create 0600 root root +diff -ur shorewall-5.2.0.4.orig/shorewall-init-5.2.0.4/sysconfig shorewall-5.2.0.4/shorewall-init-5.2.0.4/sysconfig +--- shorewall-5.2.0.4.orig/shorewall-init-5.2.0.4/sysconfig 2018-05-18 17:18:09.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall-init-5.2.0.4/sysconfig 2018-07-11 17:51:19.147266572 +0000 +@@ -19,7 +19,7 @@ + # + # Where Up/Down events get logged + # +-LOGFILE=/var/log/shorewall-ifupdown.log ++LOGFILE=/var/log/shorewall-ifupdown + + # Startup options - set verbosity to 0 (minimal reporting) + OPTIONS="-V0" +diff -ur shorewall-5.2.0.4.orig/shorewall-init-5.2.0.4/uninstall.sh shorewall-5.2.0.4/shorewall-init-5.2.0.4/uninstall.sh +--- shorewall-5.2.0.4.orig/shorewall-init-5.2.0.4/uninstall.sh 2018-05-18 18:46:49.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall-init-5.2.0.4/uninstall.sh 2018-07-11 17:50:39.479268937 +0000 +@@ -202,7 +202,7 @@ + + remove_directory ${SHAREDIR}/$PRODUCT + remove_directory ${LIBEXECDIR}/$PRODUCT +-remove_file ${CONFDIR}/logrotate.d/$PRODUCT ++remove_file ${CONFDIR}/logrotate.d/shorewall-ifupdown + + # + # Report Success +diff -ur shorewall-5.2.0.4.orig/shorewall-lite-5.2.0.4/install.sh shorewall-5.2.0.4/shorewall-lite-5.2.0.4/install.sh +--- shorewall-5.2.0.4.orig/shorewall-lite-5.2.0.4/install.sh 2018-05-18 18:46:50.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall-lite-5.2.0.4/install.sh 2018-07-11 17:48:09.765277860 +0000 +@@ -459,8 +459,8 @@ + fi + + if [ -d ${DESTDIR}${CONFDIR}/logrotate.d ]; then +- install_file logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT 0644 +- echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT" ++ install_file logrotate ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT-init 0644 ++ echo "Logrotate file installed as ${DESTDIR}${CONFDIR}/logrotate.d/$PRODUCT-init" + fi + + # +@@ -510,7 +510,7 @@ + echo "$PRODUCT will start automatically at boot" + if [ $HOST = debian ]; then + echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable" +- touch /var/log/$PRODUCT-init.log ++ touch /var/log/$PRODUCT-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" +@@ -529,7 +529,7 @@ + elif mywhich update-rc.d ; then + echo "$PRODUCT will start automatically at boot" + echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable" +- touch /var/log/$PRODUCT-init.log ++ touch /var/log/$PRODUCT-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf + update-rc.d $PRODUCT enable + elif mywhich rc-update ; then +@@ -537,7 +537,7 @@ + echo "$PRODUCT will start automatically at boot" + if [ $HOST = debian ]; then + echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable" +- touch /var/log/$PRODUCT-init.log ++ touch /var/log/$PRODUCT-init + perl -p -w -i -e 's/^STARTUP_ENABLED=No/STARTUP_ENABLED=Yes/;s/^IP_FORWARDING=On/IP_FORWARDING=Keep/;s/^SUBSYSLOCK=.*/SUBSYSLOCK=/;' ${CONFDIR}/$PRODUCT/$PRODUCT.conf + else + echo "Set STARTUP_ENABLED=Yes in ${CONFDIR}/$PRODUCT/$PRODUCT.conf to enable" +diff -ur shorewall-5.2.0.4.orig/shorewall-lite-5.2.0.4/logrotate shorewall-5.2.0.4/shorewall-lite-5.2.0.4/logrotate +--- shorewall-5.2.0.4.orig/shorewall-lite-5.2.0.4/logrotate 2018-05-18 17:18:09.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall-lite-5.2.0.4/logrotate 2018-07-11 17:43:04.257296070 +0000 +@@ -1,4 +1,4 @@ +-/var/log/shorewall-lite-init.log { ++/var/log/shorewall-lite-init { + missingok + notifempty + create 0600 root root +diff -ur shorewall-5.2.0.4.orig/shorewall-lite-5.2.0.4/uninstall.sh shorewall-5.2.0.4/shorewall-lite-5.2.0.4/uninstall.sh +--- shorewall-5.2.0.4.orig/shorewall-lite-5.2.0.4/uninstall.sh 2018-05-18 18:46:50.000000000 +0000 ++++ shorewall-5.2.0.4/shorewall-lite-5.2.0.4/uninstall.sh 2018-07-11 17:47:56.086278676 +0000 +@@ -190,7 +190,7 @@ + remove_directory ${VARDIR} + remove_directory ${SHAREDIR}/$PRODUCT + remove_directory ${LIBEXECDIR}/$PRODUCT +-remove_file ${CONFDIR}/logrotate.d/$PRODUCT ++remove_file ${CONFDIR}/logrotate.d/$PRODUCT-init + + if [ -n "$SYSCONFDIR" ]; then + [ -n "$SYSCONFFILE" ] && remove_file ${SYSCONFDIR}/${PRODUCT} diff --git a/shorewall.logrotate b/shorewall.logrotate new file mode 100644 index 0000000..8beea64 --- /dev/null +++ b/shorewall.logrotate @@ -0,0 +1,5 @@ +/var/log/shorewall { + missingok + notifempty + create 0600 root root +} diff --git a/shorewall.spec b/shorewall.spec index 1578016..70c3538 100644 --- a/shorewall.spec +++ b/shorewall.spec @@ -7,7 +7,7 @@ Summary: Shoreline Firewall - an iptables-based firewall for Linux systems Summary(pl.UTF-8): Shoreline Firewall - zapora sieciowa oparta na iptables Name: shorewall Version: 5.2.0.4 -Release: 2 +Release: 3 License: GPL Group: Networking/Utilities Source0: http://www.shorewall.net/pub/shorewall/5.2/shorewall-5.2.0/%{name}-%{version}.tar.bz2 @@ -23,11 +23,13 @@ Source4: http://www.shorewall.net/pub/shorewall/5.2/shorewall-5.2.0/%{name}-init Source5: http://www.shorewall.net/pub/shorewall/5.2/shorewall-5.2.0/%{name}-core-%{version}.tar.bz2 # Source5-md5: be73e2f76b2438e7813f62873a50c203 Source10: %{name}.init +Source11: %{name}.logrotate Patch0: %{name}-config.patch -Patch1: tld.patch -Patch2: man.patch -Patch3: init.patch -Patch4: shell-fix.patch +Patch1: %{name}-logging.patch +Patch2: tld.patch +Patch3: man.patch +Patch4: init.patch +Patch5: shell-fix.patch URL: http://www.shorewall.net/ BuildRequires: perl BuildRequires: perl(Digest::SHA) @@ -107,6 +109,7 @@ rule compiler installed. %package core Summary: Core libraries for Shorewall Group: Applications/System +Requires: logrotate %description core This package contains the core libraries for Shorewall. @@ -143,6 +146,7 @@ done %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 # Remove hash-bang from files which are not directly executed as shell # scripts. This silences some rpmlint errors. @@ -166,6 +170,7 @@ done install -d $RPM_BUILD_ROOT/etc/rc.d/init.d install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/shorewall +install -p %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/shorewall %clean rm -rf $RPM_BUILD_ROOT @@ -186,7 +191,7 @@ fi %attr(755,root,root) %{_sbindir}/shorewall %dir %{_sysconfdir}/shorewall %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shorewall/* -%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/shorewall +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/shorewall-init %{_datadir}/shorewall/action.* %{_datadir}/shorewall/actions.std %{_datadir}/shorewall/configfiles/ @@ -218,7 +223,7 @@ fi %attr(755,root,root) %{_sbindir}/shorewall-lite %dir %{_sysconfdir}/shorewall-lite %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shorewall-lite/shorewall-lite.conf -%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/shorewall-lite +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/shorewall-lite-init %{_datadir}/shorewall-lite %{_libexecdir}/shorewall-lite %{_mandir}/man5/shorewall-lite* @@ -232,7 +237,7 @@ fi %attr(755,root,root) %{_sbindir}/shorewall6 %dir %{_sysconfdir}/shorewall6 %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shorewall6/* -%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/shorewall6 +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/shorewall6-init %{_mandir}/man5/shorewall6* %exclude %{_mandir}/man5/shorewall6-lite* %{_mandir}/man8/shorewall6* @@ -247,7 +252,7 @@ fi %attr(755,root,root) %{_sbindir}/shorewall6-lite %dir %{_sysconfdir}/shorewall6-lite %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/shorewall6-lite/shorewall6-lite.conf -%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/shorewall6-lite +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/shorewall6-lite-init %{_mandir}/man5/shorewall6-lite* %{_mandir}/man8/shorewall6-lite* %{_datadir}/shorewall6-lite @@ -259,6 +264,7 @@ fi %files core %defattr(644,root,root,755) %doc shorewall-core-%{version}/{COPYING,changelog.txt,releasenotes.txt} +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/shorewall %dir %{_datadir}/shorewall/ %{_datadir}/shorewall/coreversion %{_datadir}/shorewall/functions @@ -275,7 +281,7 @@ fi %attr(755,root,root) %{_sbindir}/shorewall-init %attr(755,root,root) %{_sysconfdir}/NetworkManager/dispatcher.d/01-shorewall %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/shorewall-init -/etc/logrotate.d/shorewall-init +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/shorewall-ifupdown %{_mandir}/man8/shorewall-init.8.* %{_datadir}/shorewall-init %dir %{_libexecdir}/shorewall-init -- 2.44.0