[Main]
Type = classic
Version = 0.1.4
Description = "elogind daemon"
User = ( root )
Depends = ( devmanager dbus )
Options = ( log )
InTree = ( logind )
CopyFrom = (
	/etc/s6-rc/sv/elogind/notification-fd
	/etc/s6-rc/sv/elogind/data
)
[Start]
Notify = 3
Execute = (
	fdmove -c 2 1
	s6-notifyoncheck -t 30000 -n 60 -w 250
	
	# When vdev is the device manager, import /run/vdev/env (same as
	# vdev-coldplug) and wait for early coldplug (uaccess/seat/dri) before
	# enumerating seats. No-op without vdevd / envdir (eudev, mdev, …).
	foreground {
		ifelse { test -d /run/vdev/env }
		{
			s6-envdir /run/vdev/env			
			multisubstitute
			{
				importas -D /run/vdev/vdev.ready VDEV_EARLY_STAMP VDEV_EARLY_STAMP
			}			
			loopwhilex
			ifelse { test -f ${VDEV_EARLY_STAMP} }
			{ exit 1 }
			sleep 0.2
		}
		{ }
	}
	
	exec /usr/libexec/elogind
)
[Logger]
RunAs = s6log
Backup = 3
MaxSize = 2000000
Timestamp = tai
Destination = /var/log/elogind
