root/psad/tags/psad-2.1.2/init-scripts/psad-init.gentoo

Revision 1613, 1.0 kB (checked in by mbr, 2 years ago)

Added Id expansion

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Id
Line 
1 #!/sbin/runscript
2 ## Copyright 2006 Michael Rash
3 # Distributed under the terms of the GNU General Public License v2
4 # Author: Michael Rash
5 #    Developed for the Gentoo Linux distribution
6 # $Id$
7
8 depend() {
9         need logger
10 }
11
12 checkconfig() {
13         if [ ! -f /etc/psad/psad.conf ] ; then
14         eerror "Please create /etc/psad/psad.conf"
15         eerror "You can find a sample config file at /etc/psad/psad.conf.sample"
16         return 1
17         fi
18         return 0
19 }
20
21 start() {
22         checkconfig || return 1
23
24         ebegin "Starting ${SVCNAME}"
25         start-stop-daemon --start --quiet --exec /usr/sbin/psad
26         eend $? "Failed to start ${SVCNAME}"
27 }
28
29 stop() {
30         ebegin "Stopping psadwatchd"
31         start-stop-daemon --stop --quiet --pidfile /var/run/psad/psadwatchd.pid
32         eend $? "Failed to stop psadwatchd"
33
34         if [ -f /var/run/psad/kmsgsd.pid ] ; then
35                 ebegin "Stopping kmsgsd"
36                 start-stop-daemon --stop --quiet --pidfile /var/run/psad/kmsgsd.pid
37                 eend $? "Failed to stop kmsgsd"
38         fi
39
40         ebegin "Stopping ${SVCNAME}"
41         start-stop-daemon --stop --quiet --pidfile /var/run/psad/psad.pid
42         eend $? "Failed to stop ${SVCNAME}"
43 }
Note: See TracBrowser for help on using the browser.