Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kann snort nicht stoppen!
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
sm0ker
n00b
n00b


Joined: 20 Jan 2006
Posts: 28

PostPosted: Mon Jan 30, 2006 2:38 pm    Post subject: kann snort nicht stoppen! Reply with quote

hallo erstmal.
habe snort installiert und soweit rennt es auch ganz gut, also logging funzt usw.
mein problem ist nur, dass ich snort nicht mit dem rc-script stoppen kann. er
zeigt zwar ein gruenes OK! aber der prozess laueft immernoch. hab schon
heraus bekommen, dass er keine pid datei unter /var/run erstellt, nur kann ich
nicht nachvollziehen wieso nicht!
Code:

hero init.d # snort -V

   ,,_     -*> Snort! <*-
  o"  )~   Version 2.4.3 (Build 26)
   ''''    By Martin Roesch & The Snort Team: http://www.snort.org/team.html
           (C) Copyright 1998-2005 Sourcefire Inc., et al.
 NOTE: Snort's default output has changed in version 2.4.1!
       The default logging mode is now PCAP, use "-K ascii" to activate
       the old default logging mode.

hero init.d #
hero init.d # ./snort start
 * Starting snort ...                                                     [ ok ]
hero init.d #
hero init.d # ps xa
< cut >
24122 ?        Ss     0:01 /usr/bin/snort -D -u snort -i eth1 -l /var/log/snort
24131 pts/0    R+     0:00 ps xa
hero init.d #

#/etc/conf.d/snort

# Config file for /etc/init.d/snort

# This tell snort which interface to listen on (any for every interface)
IFACE=eth1

# Make sure this matches your IFACE
PIDFILE=/var/run/snort_$IFACE.pid

# You probably don't want to change this, but in case you do
LOGDIR="/var/log/snort"

# Probably not this either
CONF=/etc/snort/snort.conf

# This pulls in the options above
SNORT_OPTS="-D -u snort -i $IFACE -l $LOGDIR -c $CONF"

#/etc/init.d/snort

#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/files/snort.rc6,v 1.6 200$

depend() {
        need net
}

checkconfig() {
        if [ ! -e $CONF ] ; then
                eerror "You need a configuration file to run snort"
                eerror "There is an example config in /etc/snort/snort.conf.dis$
                return 1
        fi
}

start() {
        checkconfig || return 1
        ebegin "Starting snort"
        start-stop-daemon --start --quiet --exec /usr/bin/snort \
                -- ${SNORT_OPTS} >/dev/null 2>&1
        eend $?
}

stop() {
        ebegin "Stopping snort"
        start-stop-daemon --stop --quiet --pidfile ${PIDFILE}
        eend $?
}

woran koennte es liegen?
Back to top
View user's profile Send private message
Marlo
Veteran
Veteran


Joined: 26 Jul 2003
Posts: 1591

PostPosted: Wed Feb 01, 2006 5:46 pm    Post subject: Re: kann snort nicht stoppen! Reply with quote

sm0ker wrote:

mein problem ist nur, dass ich snort nicht mit dem rc-script stoppen kann. er
zeigt zwar ein gruenes OK! aber der prozess laueft immernoch.


Dann würde ich anstatt
Code:
/etc/init.d/snort stop

ein
Code:
/etc/init.d/snort zap

versuchen.

Gruß
Ma
_________________
------------------------------------------------------------------
http://radio.garden/
Back to top
View user's profile Send private message
stalinski
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jan 2005
Posts: 106
Location: Berlin,Germany

PostPosted: Wed Feb 01, 2006 8:07 pm    Post subject: Re: kann snort nicht stoppen! Reply with quote

Marlo wrote:
sm0ker wrote:

mein problem ist nur, dass ich snort nicht mit dem rc-script stoppen kann. er
zeigt zwar ein gruenes OK! aber der prozess laueft immernoch.


Dann würde ich anstatt
Code:
/etc/init.d/snort stop

ein
Code:
/etc/init.d/snort zap

versuchen.

Gruß
Ma

zap setzt doch nur den internen Status des rc Scriptes zurück, also zu gebrauchen, wenn ein Programm abgestürzt ist und als Status immernoch running da steht.
Zap setzt den Status dann auf stopped, allerdings ohne das Programm selber zu stoppen.
Back to top
View user's profile Send private message
sm0ker
n00b
n00b


Joined: 20 Jan 2006
Posts: 28

PostPosted: Thu Feb 02, 2006 2:08 pm    Post subject: Reply with quote

mit zap kann ich des von hand zurueck setzen, aber muss trotzdem ein 'killall -9 snort' machen! genau das will ich aber nicht. ausserdem moechte ich snort beim starten bzw. stoppen des systems ausfuehren lassen!! muesste das rc-script anpassen und so weiter... will ich aber auch nicht ;) wie gesagt, ich habe schon 'raus bekommen', dass kein pid datei unter /var/run algelegt/erstellt wird! nur warum nicht! denke auch damit laesst sich das alles loesen, da er beim ./snort stop ja die pid file 'sucht' und eben net findet!
Back to top
View user's profile Send private message
stalinski
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jan 2005
Posts: 106
Location: Berlin,Germany

PostPosted: Thu Feb 02, 2006 2:16 pm    Post subject: Reply with quote

unter welchem user läuft snort eigentlich?

Als user snort?

Möglicherweise darf der User das pid file nicht schreiben, und somit wird das gar nicht erst angelegt.

Leg doch mal ein Verzeichnis /var/run/snort/ an, chown das auf snort und gib dem Schreibrechte darauf.
Änder dann noch
PIDFILE=/var/run/snort/$IFACE.pid

dann sollte das eigentlich gehen.
Back to top
View user's profile Send private message
sm0ker
n00b
n00b


Joined: 20 Jan 2006
Posts: 28

PostPosted: Fri Feb 03, 2006 10:41 am    Post subject: Reply with quote

also snort rennt unter user snort. hab auch testweise mal als root rennen lassen -=> gleiches ergebnis, keine pid file
habe das getestet!

Code:

# Config file for /etc/init.d/snort

# This tell snort which interface to listen on (any for every interface)
IFACE=eth1

# Make sure this matches your IFACE
PIDFILE=/var/run/snort/snort_$IFACE.pid

# You probably don't want to change this, but in case you do
LOGDIR="/var/log/snort"

# Probably not this either
CONF=/etc/snort/snort.conf

# This pulls in the options above
SNORT_OPTS="-D -u snort -i $IFACE -l $LOGDIR -c $CONF"

hero init.d # ./snort start
 * Caching service dependencies ...                                                                                     [ ok ]
 * Starting snort ...                                                                                                   [ ok ]

hero run # ls -ahl
total 41K
drwxr-xr-x 10 root     root      568 Feb  3 11:29 .
drwxr-xr-x 14 root     root      360 Feb  2 17:28 ..
-rw-r--r--  1 root     root        5 Feb  3 10:49 apache2.pid
srwx------  1 apache   root        0 Feb  3 10:49 cgisock
drwxr-xr-x  2 clamav   clamav    144 Feb  3 10:49 clamav
drwxr-xr-x  2 root     root       48 Jan 28 21:08 console
drwxr-xr-x  2 ddclient ddclient   48 Feb  3 00:37 ddclient
-rw-r--r--  1 root     root        5 Feb  3 10:49 dhcpcd-eth1.pid
drwxr-xr-x  2 distcc   daemon     80 Feb  3 10:49 distccd
srw-rw-rw-  1 root     root        0 Feb  3 10:49 fcron.fifo
-rw-r--r--  1 root     root        5 Feb  3 10:49 fcron.pid
drwxr-xr-x  2 named    named      80 Feb  3 10:49 named
drwxr-xr-x  2 root     root      120 Feb  3 10:49 proftpd
-rw-r--r--  1 root     root        5 Feb  3 10:49 proftpd.pid
-rw-------  1 root     root      512 Feb  3 10:49 random-seed
drwxr-xr-x  2 root     root       96 Feb  3 10:49 samba
drwxr-xr-x  2 snort    snort      48 Feb  3 11:29 snort
-rw-r--r--  1 root     squid       5 Feb  3 10:58 squid.pid
-rw-r--r--  1 root     root        5 Feb  3 10:49 sshd.pid
-rw-------  1 root     root        5 Feb  3 10:49 syslog-ng.pid
-rw-rw-r--  1 root     utmp     5.3K Feb  3 11:08 utmp
hero run #
hero run # ls -ahl snort/
total 512
drwxr-xr-x  2 snort snort  48 Feb  3 11:29 .
drwxr-xr-x 10 root  root  568 Feb  3 11:29 ..
hero run #


geht leider auch net!
Back to top
View user's profile Send private message
sm0ker
n00b
n00b


Joined: 20 Jan 2006
Posts: 28

PostPosted: Sun Feb 05, 2006 6:08 pm    Post subject: Reply with quote

y0
hat sich erledigt. werd des gentoo wieder killen und nen lfs druff ziehen. da hatte ich irgendwie net so nen stress! zumal die boot scripte besser zu 'durchschauen' sind.... aber das soll keine kritik am gentoo an sich sein. der mensch ist und bleibt halt ein gewohnheitstier. ich hab mir halt lfs 'angewoehnt' ;)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum