honeyd/rc.honeyd

changeset 574
1074e5934dd9
child 691
a9cbdfa9697a
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/honeyd/rc.honeyd	Tue Aug 28 18:35:30 2012 +0200
     1.3 @@ -0,0 +1,77 @@
     1.4 +#!@l_prefix@/bin/openpkg rc
     1.5 +##
     1.6 +##  rc.honeyd -- Run-Commands
     1.7 +##
     1.8 +
     1.9 +%config
    1.10 +    honeyd_enable="$openpkg_rc_def"
    1.11 +    honeyd_log_prolog="true"
    1.12 +    honeyd_log_epilog="true"
    1.13 +    honeyd_log_numfiles="10"
    1.14 +    honeyd_log_minsize="1M"
    1.15 +    honeyd_log_complevel="9"
    1.16 +    honeyd_ip_network="192.168.100.0/24"
    1.17 +    honeyd_if=""
    1.18 +
    1.19 +%common
    1.20 +    honeyd_pidfile="@l_prefix@/var/honeyd/honeyd.pid"
    1.21 +    honeyd_cfgfile="@l_prefix@/etc/honeyd/honeyd.conf"
    1.22 +    honeyd_prnfile="@l_prefix@/share/honeyd/nmap.prints"
    1.23 +    honeyd_xpbfile="@l_prefix@/share/honeyd/xprobe2.conf"
    1.24 +    honeyd_assfile="@l_prefix@/share/honeyd/nmap.assoc"
    1.25 +    honeyd_signal () {
    1.26 +        [ -f $honeyd_pidfile ] && kill -$1 `cat $honeyd_pidfile`
    1.27 +    }
    1.28 +
    1.29 +%status -u @l_susr@ -o
    1.30 +    honeyd_usable="no"
    1.31 +    honeyd_active="no"
    1.32 +    rcService honeyd enable yes && \
    1.33 +        honeyd_chroot && honeyd_usable="yes"
    1.34 +    rcService honeyd enable yes && \
    1.35 +        honeyd_signal 0 && honeyd_active="yes"
    1.36 +    echo "honeyd_enable=\"$honeyd_enable\""
    1.37 +    echo "honeyd_usable=\"$honeyd_usable\""
    1.38 +    echo "honeyd_active=\"$honeyd_active\""
    1.39 +
    1.40 +%start -u @l_susr@
    1.41 +    rcService honeyd enable yes || exit 0
    1.42 +    rcService honeyd active yes && exit 0
    1.43 +    if [ ".$honeyd_if" != . ]; then
    1.44 +        arpd_interface="-i $honeyd_if"
    1.45 +    fi
    1.46 +    @l_prefix@/bin/honeyd \
    1.47 +        -p $honeyd_prnfile \
    1.48 +        -x $honeyd_xpbfile \
    1.49 +        -a $honeyd_assfile \
    1.50 +        -f $honeyd_cfgfile \
    1.51 +        $honeyd_interface \
    1.52 +        $honeyd_ip_network \
    1.53 +        >/dev/null 2>&1
    1.54 +
    1.55 +%stop -u @l_susr@
    1.56 +    rcService honeyd enable yes || exit 0
    1.57 +    rcService honeyd active no && exit 0
    1.58 +    honeyd_signal TERM
    1.59 +
    1.60 +%restart -u @l_susr@
    1.61 +    rcService honeyd enable yes || exit 0
    1.62 +    rcService honeyd active no && exit 0
    1.63 +    rc honeyd stop
    1.64 +    sleep 2
    1.65 +    rc honeyd start
    1.66 +
    1.67 +%reload -u @l_susr@
    1.68 +    rcService honeyd enable yes || exit 0
    1.69 +    rcService honeyd active no && exit 0
    1.70 +    honeyd_signal HUP
    1.71 +
    1.72 +%daily -u @l_susr@
    1.73 +    rcService honeyd enable yes || exit 0
    1.74 +    shtool rotate -f \
    1.75 +        -n ${honeyd_log_numfiles} -s ${honeyd_log_minsize} -d \
    1.76 +        -z ${honeyd_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \
    1.77 +        -P "${honeyd_log_prolog}" \
    1.78 +        -E "${honeyd_log_epilog}; rc honeyd restart" \
    1.79 +        @l_prefix@/var/honeyd/honeyd.log
    1.80 +

mercurial