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

[Start]
Execute = (
	# lighttpd in foreground (-D), matching debian/sv/lighttpd.
	
	
	foreground { install -d -o www-data -g www-data -m 0750 /run/lighttpd }
	foreground { install -d -o www-data -g www-data -m 0750 /var/cache/lighttpd }
	foreground { install -d -o www-data -g www-data -m 0750 /var/cache/lighttpd/compress }
	foreground { install -d -o www-data -g www-data -m 0750 /var/cache/lighttpd/uploads }
	foreground { install -d -o www-data -g www-data -m 0750 /var/log/lighttpd }
	
	# Fail the longrun (restart) if configtest fails — same as previous shell run.
	foreground { /usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf }
	
	exec /usr/sbin/lighttpd ${Args}
)

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