michael@182: #!@l_prefix@/bin/openpkg rc michael@182: ## michael@182: ## rc.proftpd -- Run-Commands michael@182: ## michael@182: michael@182: %config michael@182: proftpd_enable="$openpkg_rc_def" michael@182: proftpd_nice="0" michael@182: proftpd_acc_file="@l_prefix@/var/proftpd/proftpd.access.log" michael@182: proftpd_acc_prolog="true" michael@182: proftpd_acc_epilog="true" michael@182: proftpd_acc_numfiles="10" michael@182: proftpd_acc_minsize="1M" michael@182: proftpd_acc_complevel="9" michael@182: proftpd_auth_file="@l_prefix@/var/proftpd/proftpd.auth.log" michael@182: proftpd_auth_prolog="true" michael@182: proftpd_auth_epilog="true" michael@182: proftpd_auth_numfiles="10" michael@182: proftpd_auth_minsize="1M" michael@182: proftpd_auth_complevel="9" michael@182: proftpd_sys_file="@l_prefix@/var/proftpd/proftpd.system.log" michael@182: proftpd_sys_prolog="true" michael@182: proftpd_sys_epilog="true" michael@182: proftpd_sys_numfiles="10" michael@182: proftpd_sys_minsize="1M" michael@182: proftpd_sys_complevel="9" michael@182: proftpd_xfer_file="@l_prefix@/var/proftpd/proftpd.xfer.log" michael@182: proftpd_xfer_prolog="true" michael@182: proftpd_xfer_epilog="true" michael@182: proftpd_xfer_numfiles="10" michael@182: proftpd_xfer_minsize="1M" michael@182: proftpd_xfer_complevel="9" michael@182: michael@182: %common michael@182: proftpd_pidfile="@l_prefix@/var/proftpd/proftpd.pid" michael@182: proftpd_signal () { michael@182: [ -f $proftpd_pidfile ] && kill -$1 `cat $proftpd_pidfile` michael@182: } michael@182: michael@182: %status -u @l_susr@ -o michael@182: proftpd_usable="unknown" michael@182: proftpd_active="no" michael@182: rcService proftpd enable yes && \ michael@182: proftpd_signal 0 && proftpd_active="yes" michael@182: echo "proftpd_enable=\"$proftpd_enable\"" michael@182: echo "proftpd_usable=\"$proftpd_usable\"" michael@182: echo "proftpd_active=\"$proftpd_active\"" michael@182: michael@182: %start -u @l_susr@ michael@182: rcService proftpd enable yes || exit 0 michael@182: rcService proftpd active yes && exit 0 michael@182: nice -n $proftpd_nice @l_prefix@/sbin/proftpd michael@182: michael@182: %stop -u @l_susr@ michael@182: rcService proftpd enable yes || exit 0 michael@182: rcService proftpd active no && exit 0 michael@182: proftpd_signal TERM michael@182: sleep 2 michael@182: michael@182: %restart -u @l_susr@ michael@182: rcService proftpd enable yes || exit 0 michael@182: rcService proftpd active no && exit 0 michael@182: rc proftpd stop start michael@182: michael@182: %reload -u @l_susr@ michael@182: rcService proftpd enable yes || exit 0 michael@182: proftpd_signal HUP michael@182: michael@182: %daily -u @l_susr@ michael@182: rcService proftpd enable yes || exit 0 michael@182: rcTmp -i michael@182: hintfile=`rcTmp -f -n hint` michael@182: shtool rotate -f \ michael@182: -n ${proftpd_acc_numfiles} -s ${proftpd_acc_minsize} -d \ michael@182: -z ${proftpd_acc_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ michael@182: -P "${proftpd_acc_prolog}" \ michael@182: -E "${proftpd_acc_epilog}; echo 1 >$hintfile" \ michael@182: ${proftpd_acc_file} michael@182: shtool rotate -f \ michael@182: -n ${proftpd_auth_numfiles} -s ${proftpd_auth_minsize} -d \ michael@182: -z ${proftpd_auth_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ michael@182: -P "${proftpd_auth_prolog}" \ michael@182: -E "${proftpd_auth_epilog}; echo 1 >$hintfile" \ michael@182: ${proftpd_auth_file} michael@182: shtool rotate -f \ michael@182: -n ${proftpd_sys_numfiles} -s ${proftpd_sys_minsize} -d \ michael@182: -z ${proftpd_sys_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ michael@182: -P "${proftpd_sys_prolog}" \ michael@182: -E "${proftpd_sys_epilog}; echo 1 >$hintfile" \ michael@182: ${proftpd_sys_file} michael@182: shtool rotate -f \ michael@182: -n ${proftpd_xfer_numfiles} -s ${proftpd_xfer_minsize} -d \ michael@182: -z ${proftpd_xfer_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ michael@182: -P "${proftpd_xfer_prolog}" \ michael@182: -E "${proftpd_xfer_epilog}; echo 1 >$hintfile" \ michael@182: ${proftpd_xfer_file} michael@182: if [ -s $hintfile ]; then michael@182: rc proftpd restart michael@182: fi michael@182: rcTmp -k michael@182: