aboutsummaryrefslogtreecommitdiffstats
path: root/testing/proftpd/proftpd.initd
blob: 05670abc71540bde4f4e5719c97e1549940b74df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/sbin/openrc-run

name="ProFTPD"
description="ProFTPD FTP Server"

pidfile="/run/proftpd/proftpd.pid"
command="/usr/sbin/proftpd"
command_args="-n"
command_background="yes"
required_files="/etc/proftpd/proftpd.conf"
extra_commands="checkconfig"
extra_started_commands="reload"
description_checkconfig="Check configuration"
description_reload="Reload configuration"

depend() {
	need net
	use logger dns
	after firewall
}

checkconfig() {
	$command -t
}

start_pre() {
	checkpath --directory ${pidfile%/*}
	checkconfig >/dev/null 2>&1
}

reload() {
	ebegin "Reloading ${name:-$RC_SVCNAME}"
	checkconfig >/dev/null 2>&1 && start-stop-daemon --signal HUP --pidfile $pidfile
	eend $?
}