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

[Start]
Execute = (
	# avahi-daemon in foreground (no -D); unicast-.local gate like OpenRC.
	
	envfile -I /etc/default/avahi-daemon
	importas -uD "1" AVAHI_DAEMON_DETECT_LOCAL AVAHI_DAEMON_DETECT_LOCAL
	
	ifelse {
		ifelse { test -e /var/run/avahi-daemon/disabled-for-unicast-local } {
			# Tag present: pause unless detect-local disabled
			ifelse { test "${AVAHI_DAEMON_DETECT_LOCAL}" = 0 } { true } { exit 1 }
		} { true }
	} {
		exec /usr/sbin/avahi-daemon
	}
	s6-pause
)

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

