[Main]
Type = classic
Version = 0.1.0
Description = "proftpd daemon"
User = ( root )
Depends = ( mount-rw )
Options = ( log )

[Start]
Execute = (
	# proftpd in foreground (-n), matching debian/sv/proftpd.
	# Fail longrun if --configtest fails (runit uses exit 162).
	
	envfile -I /etc/default/proftpd
	importas -sCuD "/etc/proftpd/proftpd.conf" CONFIG_FILE CONFIG_FILE
	importas -sCuD "" OPTIONS OPTIONS
	
	foreground { mkdir -p /run/proftpd }
	
	foreground { /usr/sbin/proftpd -c ${CONFIG_FILE} --configtest }
	
	exec /usr/sbin/proftpd ${Args} -c ${CONFIG_FILE} ${OPTIONS}
)

[Logger]
RunAs = s6log
Backup = 3
MaxSize = 2000000
Timestamp = tai
Destination = /var/log/proftpd-s6

[Environment]
Args = !-n
