[Main]
Type = oneshot
Version = 0.1.0
Description = "schroot oneshot"
User = ( root )
Options = ( !log )

[Start]
Execute = (
	# Recover schroot sessions (runit: sv once schroot; OpenRC start).
	
	ifelse { test -x /usr/bin/schroot } {
		ifelse { test -x /usr/share/schroot/bin/schroot-init } {
			foreground { /usr/share/schroot/bin/schroot-init start }
			exit 0
		}
	}
	exit 0
)

[Stop]
Execute = (
	# Stop schroot sessions (runit: sv once schroot-stop; OpenRC stop).
	
	ifelse { test -x /usr/share/schroot/bin/schroot-init } {
		foreground { /usr/share/schroot/bin/schroot-init stop }
	}
	exit 0
)
