michael@574: #!@l_prefix@/bin/openpkg rc michael@574: ## michael@574: ## rc.honeyd -- Run-Commands michael@574: ## michael@574: michael@574: %config michael@574: honeyd_enable="$openpkg_rc_def" michael@574: honeyd_log_prolog="true" michael@574: honeyd_log_epilog="true" michael@574: honeyd_log_numfiles="10" michael@574: honeyd_log_minsize="1M" michael@574: honeyd_log_complevel="9" michael@574: honeyd_ip_network="192.168.100.0/24" michael@574: honeyd_if="" michael@574: michael@574: %common michael@574: honeyd_pidfile="@l_prefix@/var/honeyd/honeyd.pid" michael@574: honeyd_cfgfile="@l_prefix@/etc/honeyd/honeyd.conf" michael@574: honeyd_prnfile="@l_prefix@/share/honeyd/nmap.prints" michael@574: honeyd_xpbfile="@l_prefix@/share/honeyd/xprobe2.conf" michael@574: honeyd_assfile="@l_prefix@/share/honeyd/nmap.assoc" michael@574: honeyd_signal () { michael@574: [ -f $honeyd_pidfile ] && kill -$1 `cat $honeyd_pidfile` michael@574: } michael@574: michael@574: %status -u @l_susr@ -o michael@574: honeyd_usable="no" michael@574: honeyd_active="no" michael@574: rcService honeyd enable yes && \ michael@574: honeyd_chroot && honeyd_usable="yes" michael@574: rcService honeyd enable yes && \ michael@574: honeyd_signal 0 && honeyd_active="yes" michael@574: echo "honeyd_enable=\"$honeyd_enable\"" michael@574: echo "honeyd_usable=\"$honeyd_usable\"" michael@574: echo "honeyd_active=\"$honeyd_active\"" michael@574: michael@574: %start -u @l_susr@ michael@574: rcService honeyd enable yes || exit 0 michael@574: rcService honeyd active yes && exit 0 michael@574: if [ ".$honeyd_if" != . ]; then michael@691: honeyd_interface="-i $honeyd_if" michael@574: fi michael@574: @l_prefix@/bin/honeyd \ michael@574: -p $honeyd_prnfile \ michael@574: -x $honeyd_xpbfile \ michael@574: -a $honeyd_assfile \ michael@574: -f $honeyd_cfgfile \ michael@574: $honeyd_interface \ michael@574: $honeyd_ip_network \ michael@574: >/dev/null 2>&1 michael@574: michael@574: %stop -u @l_susr@ michael@574: rcService honeyd enable yes || exit 0 michael@574: rcService honeyd active no && exit 0 michael@574: honeyd_signal TERM michael@574: michael@574: %restart -u @l_susr@ michael@574: rcService honeyd enable yes || exit 0 michael@574: rcService honeyd active no && exit 0 michael@574: rc honeyd stop michael@574: sleep 2 michael@574: rc honeyd start michael@574: michael@574: %reload -u @l_susr@ michael@574: rcService honeyd enable yes || exit 0 michael@574: rcService honeyd active no && exit 0 michael@574: honeyd_signal HUP michael@574: michael@574: %daily -u @l_susr@ michael@574: rcService honeyd enable yes || exit 0 michael@574: shtool rotate -f \ michael@574: -n ${honeyd_log_numfiles} -s ${honeyd_log_minsize} -d \ michael@574: -z ${honeyd_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \ michael@574: -P "${honeyd_log_prolog}" \ michael@574: -E "${honeyd_log_epilog}; rc honeyd restart" \ michael@574: @l_prefix@/var/honeyd/honeyd.log michael@574: