savannah-hackers-public
[Top][All Lists]
Advanced

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

[Savannah-hackers-public] frontend /etc/init.d/sql_injection_monitor err


From: Bob Proulx
Subject: [Savannah-hackers-public] frontend /etc/init.d/sql_injection_monitor errors
Date: Thu, 7 Mar 2013 00:47:27 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

While cleaning up munin I noticed that there are errors from insserv.

  insserv: Script sql_injection_monitor is broken: incomplete LSB comment.
  insserv: missing `Required-Start:' entry: please add even if empty.
  insserv: missing `Required-Stop:'  entry: please add even if empty.
  insserv: missing `Default-Stop:'   entry: please add even if empty.

Looking I see that the file is very sparse.  Too sparse.

  #!/bin/bash
  ### BEGIN INIT INFO
  # Provides:          sql_injection_monitor
  # Default-Start:     2 3 4 5
  #1;2403;0c Default-Stop:      0 1 6
  ### END INIT INFO
  /root/bin/sql_injection_monitor &

That really isn't a proper init.d script.  And it will start a new
copy of it during shutdown too.

Initially to stop the errors I am going to change that to this
following partial skeleton-copy rewrite.  I have inspected it closely
but I don't have an easy way to test this.

Bob

#!/bin/sh
### BEGIN INIT INFO
# Provides:          sql_injection_monitor
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $network $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: SQL Injection Monitor
# Description:       SQL Injection Monitor
### END INIT INFO

# Author: Unknown but likely Michael J. Flickinger or Sylvain Beucler.
# Updated: Bob Proulx.

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="SQL Injection Monitor"
NAME=sql_injection_monitor
SCRIPTNAME=/etc/init.d/$NAME

# Read configuration variable file if it is present
test -r /etc/default/$NAME && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

case $1 in
  start)
    log_daemon_msg "Starting $DESC" "$NAME"
    /root/bin/sql_injection_monitor &
    log_end_msg 0
    ;;
  stop)
    log_daemon_msg "Stopping $DESC" "$NAME"
    log_end_msg 0
    ;;
  restart|force-reload)
    log_daemon_msg "Restarting $DESC" "$NAME"
    do_start
    log_end_msg 0
    ;;
  *)
    echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" 1>&2
    exit 3
    ;;
esac

exit 0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]