pub enum RunAs {
System,
User,
SystemGui,
}Expand description
Token + session combination the agent uses to spawn a job’s child process. Two orthogonal axes — whose privileges and which session — collapse into three meaningful combinations:
| variant | session | privileges | GUI |
|---|---|---|---|
System (default) | Session 0 (services) | LocalSystem | ❌ |
User | active console session | logged-in user (UAC-filtered when admin) | ✅ |
SystemGui | active console session | LocalSystem | ✅ |
SystemGui is the “PsExec -i -s” pattern: the agent duplicates
its own SYSTEM token and rewrites TokenSessionId to the user’s
console session, then launches with that hybrid token — useful
when an installer needs admin power and needs the user to see
its UI.
On macOS, LocalSystem is root and the console session is the GUI
bootstrap of the user who owns /dev/console, joined via
launchctl asuser; User runs as that user with a fresh environment.
On both OSes User / SystemGui fail — the script does not run —
when nobody is logged in. Linux agents skip User / SystemGui jobs.
Variants§
System
LocalSystem privileges in Session 0. No GUI. Historical default — every pre-v0.21 job ran this way.
User
The currently-logged-in console user’s identity, in their
session. Can write HKCU / %APPDATA% (macOS: ~/Library, the
login Keychain) / show GUI to the user. Privileges are whatever
the user has (Windows admin users get the UAC-filtered limited
token, not the elevated one).
SystemGui
LocalSystem (macOS: root) privileges in the user’s session — admin power with GUI visibility. Niche but real (force-restart dialogs, admin installers with progress UI).
Trait Implementations§
impl Copy for RunAs
Source§impl<'de> Deserialize<'de> for RunAs
impl<'de> Deserialize<'de> for RunAs
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RunAs
Source§impl JsonSchema for RunAs
impl JsonSchema for RunAs
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for RunAs
Auto Trait Implementations§
impl Freeze for RunAs
impl RefUnwindSafe for RunAs
impl Send for RunAs
impl Sync for RunAs
impl Unpin for RunAs
impl UnsafeUnpin for RunAs
impl UnwindSafe for RunAs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.