[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: snort error starting



El vie, 19-07-2002 a las 19:53, Phillip Hofmeister escribió:
> On Fri, 19 Jul 2002 at 09:33:14AM -0700, Jeff wrote:
> > # /etc/init.d/snort start
> > /etc/init.d/snort: var: command not found
> > 
> Looks like a bug in the init script.  If I had Snort/woody I would look at it.
> Someone can probably make the changes, make a patch and file a bug with the patch flag set...

I have 3 occurrences for "var" in mi /etc/init.d/snort :
adelita:~# grep "var" /etc/init.d/snort
		-l /var/log/snort \
	if ls /var/run/snort_*pid >/dev/null 2>&1 ; then
	  rm -f /var/run/snort_*.pid
Probably in the second or in the third, you got a missing slash, I mean,
you have "var" instead of "/var" . I am attaching this script as of
snort 1.8.2 (build 86) in Woody.

Regards

	Pope

-- 
Luis Gómez Miralles
InfoEmergencias - Technical Department
Phone (+34) 654 24 01 34
Fax (+34) 963 49 31 80
lgomez@infoemergencias.com

PGP Public Key available at http://www.infoemergencias.com/lgomez.asc
#!/bin/sh -e

test $DEBIAN_SCRIPT_DEBUG && set -v -x

test -f /usr/sbin/snort || exit 0

DAEMON=/usr/sbin/snort
CONFIG=/etc/snort/snort.debian.conf

test -f $CONFIG && . $CONFIG

test -z "$DEBIAN_SNORT_HOME_NET" && DEBIAN_SNORT_HOME_NET="192.168.0.0/16"

# to find the lib files
cd /etc/snort

case "$1" in
  start)
	test "$DEBIAN_SNORT_STARTUP" = "dialup" && exit 0
	test "$DEBIAN_SNORT_STARTUP" = "manual" && \
		echo $0 | grep -q 'S[0-9]' && exit 0
	echo -n "Starting Network Intrusion Detection System: snort"
	set +e
	/sbin/start-stop-daemon --start --quiet --exec $DAEMON -- \
		-D \
		-S "HOME_NET=[$DEBIAN_SNORT_HOME_NET]" \
		-h "$DEBIAN_SNORT_HOME_NET" \
		-c /etc/snort/snort.conf \
		-l /var/log/snort \
		-b \
		-d  \
		-u snort \
		-g snort \
		$DEBIAN_SNORT_OPTIONS >/dev/null
	case "$?" in
	  0) echo "." ;;
	  1) echo "...already running." ;;
	  2) echo "...failed." ;;
	esac
	set -e
	;;
  stop)
	echo -n "Stopping Network Intrusion Detection System: snort"
       	/sbin/start-stop-daemon --stop --quiet --oknodo --exec $DAEMON >/dev/null
	# If it isn't willing we shoot it!
	if ls /var/run/snort_*pid >/dev/null 2>&1 ; then
	  sleep 3
	  ps cax \
	  	| grep '/usr/sbin/snort' \
		| awk '{ print $1 }' \
	  	| xargs --no-run-if-empty kill -9 >/dev/null
	  rm -f /var/run/snort_*.pid
	fi
       	echo "."
	;;
  restart|force-restart|reload|force-reload)
	/etc/init.d/snort stop 
	# stop will take care that the thing is really dead
	/etc/init.d/snort start
       	;;
  *)
	echo "Usage: /etc/init.d/snort start|stop|restart"
	exit 1
       	;;
esac
exit 0

Reply to: