honeyd/rc.honeyd

Wed, 08 Feb 2012 20:07:00 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 08 Feb 2012 20:07:00 +0200
changeset 588
300d43423c2e
child 691
a9cbdfa9697a
permissions
-rw-r--r--

Update version, adapt patch, correct PID writing, correct build on newer
FreeBSD releases, and most importantly introduce new patch to try to
avoid segfault caused by multiple network interfaces with the same (or
no) address. This is common when configuring bridges and tunnels.

     1 #!@l_prefix@/bin/openpkg rc
     2 ##
     3 ##  rc.honeyd -- Run-Commands
     4 ##
     6 %config
     7     honeyd_enable="$openpkg_rc_def"
     8     honeyd_log_prolog="true"
     9     honeyd_log_epilog="true"
    10     honeyd_log_numfiles="10"
    11     honeyd_log_minsize="1M"
    12     honeyd_log_complevel="9"
    13     honeyd_ip_network="192.168.100.0/24"
    14     honeyd_if=""
    16 %common
    17     honeyd_pidfile="@l_prefix@/var/honeyd/honeyd.pid"
    18     honeyd_cfgfile="@l_prefix@/etc/honeyd/honeyd.conf"
    19     honeyd_prnfile="@l_prefix@/share/honeyd/nmap.prints"
    20     honeyd_xpbfile="@l_prefix@/share/honeyd/xprobe2.conf"
    21     honeyd_assfile="@l_prefix@/share/honeyd/nmap.assoc"
    22     honeyd_signal () {
    23         [ -f $honeyd_pidfile ] && kill -$1 `cat $honeyd_pidfile`
    24     }
    26 %status -u @l_susr@ -o
    27     honeyd_usable="no"
    28     honeyd_active="no"
    29     rcService honeyd enable yes && \
    30         honeyd_chroot && honeyd_usable="yes"
    31     rcService honeyd enable yes && \
    32         honeyd_signal 0 && honeyd_active="yes"
    33     echo "honeyd_enable=\"$honeyd_enable\""
    34     echo "honeyd_usable=\"$honeyd_usable\""
    35     echo "honeyd_active=\"$honeyd_active\""
    37 %start -u @l_susr@
    38     rcService honeyd enable yes || exit 0
    39     rcService honeyd active yes && exit 0
    40     if [ ".$honeyd_if" != . ]; then
    41         arpd_interface="-i $honeyd_if"
    42     fi
    43     @l_prefix@/bin/honeyd \
    44         -p $honeyd_prnfile \
    45         -x $honeyd_xpbfile \
    46         -a $honeyd_assfile \
    47         -f $honeyd_cfgfile \
    48         $honeyd_interface \
    49         $honeyd_ip_network \
    50         >/dev/null 2>&1
    52 %stop -u @l_susr@
    53     rcService honeyd enable yes || exit 0
    54     rcService honeyd active no && exit 0
    55     honeyd_signal TERM
    57 %restart -u @l_susr@
    58     rcService honeyd enable yes || exit 0
    59     rcService honeyd active no && exit 0
    60     rc honeyd stop
    61     sleep 2
    62     rc honeyd start
    64 %reload -u @l_susr@
    65     rcService honeyd enable yes || exit 0
    66     rcService honeyd active no && exit 0
    67     honeyd_signal HUP
    69 %daily -u @l_susr@
    70     rcService honeyd enable yes || exit 0
    71     shtool rotate -f \
    72         -n ${honeyd_log_numfiles} -s ${honeyd_log_minsize} -d \
    73         -z ${honeyd_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \
    74         -P "${honeyd_log_prolog}" \
    75         -E "${honeyd_log_epilog}; rc honeyd restart" \
    76         @l_prefix@/var/honeyd/honeyd.log

mercurial