diff options
author | Patrick Lauer <patrick@gentoo.org> | 2010-11-02 18:22:10 +0000 |
---|---|---|
committer | Patrick Lauer <patrick@gentoo.org> | 2010-11-02 18:22:10 +0000 |
commit | 00816485e268518b19abece79708e52a781bdb4b (patch) | |
tree | 55e070b161b99d118a9635c8107ecf8d8fb29533 /net-analyzer/snort/files | |
parent | Stable for PPC (bug #343069). (diff) | |
download | historical-00816485e268518b19abece79708e52a781bdb4b.tar.gz historical-00816485e268518b19abece79708e52a781bdb4b.tar.bz2 historical-00816485e268518b19abece79708e52a781bdb4b.zip |
Bump for #341013, many ebuild improvements by Jason Wallace and pva
Package-Manager: portage-2.2.0_alpha3/cvs/Linux x86_64
Diffstat (limited to 'net-analyzer/snort/files')
-rw-r--r-- | net-analyzer/snort/files/snort.rc10 | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/net-analyzer/snort/files/snort.rc10 b/net-analyzer/snort/files/snort.rc10 new file mode 100644 index 000000000000..fa88cbd2d7ca --- /dev/null +++ b/net-analyzer/snort/files/snort.rc10 @@ -0,0 +1,50 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/snort/files/snort.rc10,v 1.1 2010/11/02 18:22:10 patrick Exp $ + +opts="checkconfig reload" + +depend() { + need net + after mysql + after postgresql +} + +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.distrib" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting snort" + start-stop-daemon --start --quiet --exec /usr/bin/snort \ + -- --nolock-pidfile --pid-path ${PIDPATH} ${SNORT_OPTS} >/dev/null 2>&1 + eend $? +} + +stop() { + ebegin "Stopping snort" + start-stop-daemon --stop --quiet --pidfile ${PIDPATH}/${PIDFILE} + # Snort needs a few seconds to fully shutdown + sleep 15 + eend $? +} + +reload() { + if [ ! -f ${PIDPATH}/${PIDFILE} ]; then + eerror "Snort isn't running" + return 1 + fi + + checkconfig || return 1 + ebegin "Reloading Snort" + start-stop-daemon --stop --oknodo --signal HUP --pidfile ${PIDPATH}/${PIDFILE} + eend $? +} + + |