[Main]
Type = oneshot
Version = 0.1.0
Description = "sudo oneshot"
User = ( root )
Depends = ( populate-run )
Options = ( !log )

[Start]
Execute = (
	# Privilege timestamp directory.
	ifelse { test -d /run/systemd/system } { exit 0 }
	ifelse { test -d /run/sudo } {
		foreground { find /run/sudo -exec touch -d @0 {} ; }
		exit 0
	}
	foreground { install -d -m 0711 -o root -g root /run/sudo }
	foreground { install -d -m 0700 -o root -g root /run/sudo/ts }
	foreground {
		ifelse { test -x /sbin/restorecon } {
			/sbin/restorecon /run/sudo /run/sudo/ts
		}
		exit 0
	}
	exit 0
)
