| |
1 #!@l_prefix@/bin/openpkg rc |
| |
2 ## |
| |
3 ## rc.proftpd -- Run-Commands |
| |
4 ## |
| |
5 |
| |
6 %config |
| |
7 proftpd_enable="$openpkg_rc_def" |
| |
8 proftpd_nice="0" |
| |
9 proftpd_acc_file="@l_prefix@/var/proftpd/proftpd.access.log" |
| |
10 proftpd_acc_prolog="true" |
| |
11 proftpd_acc_epilog="true" |
| |
12 proftpd_acc_numfiles="10" |
| |
13 proftpd_acc_minsize="1M" |
| |
14 proftpd_acc_complevel="9" |
| |
15 proftpd_auth_file="@l_prefix@/var/proftpd/proftpd.auth.log" |
| |
16 proftpd_auth_prolog="true" |
| |
17 proftpd_auth_epilog="true" |
| |
18 proftpd_auth_numfiles="10" |
| |
19 proftpd_auth_minsize="1M" |
| |
20 proftpd_auth_complevel="9" |
| |
21 proftpd_sys_file="@l_prefix@/var/proftpd/proftpd.system.log" |
| |
22 proftpd_sys_prolog="true" |
| |
23 proftpd_sys_epilog="true" |
| |
24 proftpd_sys_numfiles="10" |
| |
25 proftpd_sys_minsize="1M" |
| |
26 proftpd_sys_complevel="9" |
| |
27 proftpd_xfer_file="@l_prefix@/var/proftpd/proftpd.xfer.log" |
| |
28 proftpd_xfer_prolog="true" |
| |
29 proftpd_xfer_epilog="true" |
| |
30 proftpd_xfer_numfiles="10" |
| |
31 proftpd_xfer_minsize="1M" |
| |
32 proftpd_xfer_complevel="9" |
| |
33 |
| |
34 %common |
| |
35 proftpd_pidfile="@l_prefix@/var/proftpd/proftpd.pid" |
| |
36 proftpd_signal () { |
| |
37 [ -f $proftpd_pidfile ] && kill -$1 `cat $proftpd_pidfile` |
| |
38 } |
| |
39 |
| |
40 %status -u @l_susr@ -o |
| |
41 proftpd_usable="unknown" |
| |
42 proftpd_active="no" |
| |
43 rcService proftpd enable yes && \ |
| |
44 proftpd_signal 0 && proftpd_active="yes" |
| |
45 echo "proftpd_enable=\"$proftpd_enable\"" |
| |
46 echo "proftpd_usable=\"$proftpd_usable\"" |
| |
47 echo "proftpd_active=\"$proftpd_active\"" |
| |
48 |
| |
49 %start -u @l_susr@ |
| |
50 rcService proftpd enable yes || exit 0 |
| |
51 rcService proftpd active yes && exit 0 |
| |
52 nice -n $proftpd_nice @l_prefix@/sbin/proftpd |
| |
53 |
| |
54 %stop -u @l_susr@ |
| |
55 rcService proftpd enable yes || exit 0 |
| |
56 rcService proftpd active no && exit 0 |
| |
57 proftpd_signal TERM |
| |
58 sleep 2 |
| |
59 |
| |
60 %restart -u @l_susr@ |
| |
61 rcService proftpd enable yes || exit 0 |
| |
62 rcService proftpd active no && exit 0 |
| |
63 rc proftpd stop start |
| |
64 |
| |
65 %reload -u @l_susr@ |
| |
66 rcService proftpd enable yes || exit 0 |
| |
67 proftpd_signal HUP |
| |
68 |
| |
69 %daily -u @l_susr@ |
| |
70 rcService proftpd enable yes || exit 0 |
| |
71 rcTmp -i |
| |
72 hintfile=`rcTmp -f -n hint` |
| |
73 shtool rotate -f \ |
| |
74 -n ${proftpd_acc_numfiles} -s ${proftpd_acc_minsize} -d \ |
| |
75 -z ${proftpd_acc_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ |
| |
76 -P "${proftpd_acc_prolog}" \ |
| |
77 -E "${proftpd_acc_epilog}; echo 1 >$hintfile" \ |
| |
78 ${proftpd_acc_file} |
| |
79 shtool rotate -f \ |
| |
80 -n ${proftpd_auth_numfiles} -s ${proftpd_auth_minsize} -d \ |
| |
81 -z ${proftpd_auth_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ |
| |
82 -P "${proftpd_auth_prolog}" \ |
| |
83 -E "${proftpd_auth_epilog}; echo 1 >$hintfile" \ |
| |
84 ${proftpd_auth_file} |
| |
85 shtool rotate -f \ |
| |
86 -n ${proftpd_sys_numfiles} -s ${proftpd_sys_minsize} -d \ |
| |
87 -z ${proftpd_sys_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ |
| |
88 -P "${proftpd_sys_prolog}" \ |
| |
89 -E "${proftpd_sys_epilog}; echo 1 >$hintfile" \ |
| |
90 ${proftpd_sys_file} |
| |
91 shtool rotate -f \ |
| |
92 -n ${proftpd_xfer_numfiles} -s ${proftpd_xfer_minsize} -d \ |
| |
93 -z ${proftpd_xfer_complevel} -m 644 -o @l_susr@ -g @l_mgrp@ \ |
| |
94 -P "${proftpd_xfer_prolog}" \ |
| |
95 -E "${proftpd_xfer_epilog}; echo 1 >$hintfile" \ |
| |
96 ${proftpd_xfer_file} |
| |
97 if [ -s $hintfile ]; then |
| |
98 rc proftpd restart |
| |
99 fi |
| |
100 rcTmp -k |
| |
101 |