[Main]
Type = oneshot
Version = 0.1.1
Description = "vdev-env (no Depends on live stub)"
User = ( root )
Depends = ( mount-sysfs )
Options = ( !log )

[Start]
Execute = (
	ifelse { test -x /sbin/vdevd } {
		foreground {
			redirfd -w 1 /dev/null
			redirfd -w 2 /dev/null
			# VDEV_ENV_PERSIST=1 for later use of s6-envdir
			/bin/sh -c "export VDEV_ENV_PERSIST=1 VDEV_ENV_FORCE=1;
						/bin/mkdir -p /run/vdev;
						. /lib/vdev/vdev-env.sh 2>/dev/null;
						exit 0
			"
		}
	}
)
