Package: snort
Version: 2.8.4.1-3
Severity: normal
Tags: patch
User: davewal...@ubuntu.com
Usertags: origin-ubuntu karmic ubuntu-patch


Introduce checking to determind if database is configured on installation 
and not attempt to start if it isn't, removing the failed to install/upgrade
issue.

For more information see: https://launchpad.net/bugs/222091

-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 
'karmic-backports'), (500, 'karmic')
Architecture: i386 (i686)

Kernel: Linux 2.6.31-8-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -u snort-2.8.4.1/debian/snort-pgsql.postinst snort-2.8.4.1/debian/snort-pgsql.postinst
--- snort-2.8.4.1/debian/snort-pgsql.postinst
+++ snort-2.8.4.1/debian/snort-pgsql.postinst
@@ -68,8 +68,18 @@
 DEBIAN_SNORT_STATS_RCPT="$STATS_RCPT"
 DEBIAN_SNORT_STATS_THRESHOLD="$STATS_THRESHOLD"
 EOF
+        if [ -e /etc/snort/db-pending-config ] ; then
+	  STARTUP="manual"
+	  echo
+	  echo "/etc/snort/db-pending-config file found"
+	  echo "Snort will not start as its database is not yet configured."
+	  echo "Please configure the database as described in"
+	  echo "/usr/share/doc/snort-pgsql/README-database.Debian"
+	  echo "and then remove /etc/snort/db-pending-config"
+	fi
 
-	if [ -f /etc/snort/snort.conf ]; then
+        if [ "$STARTUP" != "manual" ]; then
+	  if [ -f /etc/snort/snort.conf ]; then
 		# insert database config stuff in the configuration file,
 		# or configure it for syslog-logging.
 		db_get snort-pgsql/configure_db
@@ -133,8 +143,8 @@
 			chown root:snort /etc/snort/snort.conf
 			chmod 640 /etc/snort/snort.conf
 		fi
+	  fi
 	fi
-
 	db_stop
 
 	# Check for left-over files from woody packages.
diff -u snort-2.8.4.1/debian/snort-mysql.postinst snort-2.8.4.1/debian/snort-mysql.postinst
--- snort-2.8.4.1/debian/snort-mysql.postinst
+++ snort-2.8.4.1/debian/snort-mysql.postinst
@@ -69,7 +69,18 @@
 DEBIAN_SNORT_STATS_THRESHOLD="$STATS_THRESHOLD"
 EOF
 
-	if [ -f /etc/snort/snort.conf ]; then
+	if [ -e /etc/snort/db-pending-config ] ; then
+	  STARTUP="manual"
+	  echo
+	  echo "/etc/snort/db-pending-config file found"
+	  echo "Snort will not start as its database is not yet configured."
+	  echo "Please configure the database as described in"
+	  echo "/usr/share/doc/snort-mysql/README-database.Debian"
+	  echo "and then remove /etc/snort/db-pending-config"
+	fi
+
+	if [ "$STARTUP" != "manual" ]; then
+	  if [ -f /etc/snort/snort.conf ]; then
 		# insert database config stuff in the configuration file,
 		# or configure it for syslog-logging.
 		db_get snort-mysql/configure_db
@@ -133,8 +144,8 @@
 			chown root:snort /etc/snort/snort.conf
 			chmod 640 /etc/snort/snort.conf
 		fi
+	  fi
 	fi
-
 	db_stop
 
 	# Check for left-over files from woody packages.

Reply via email to