Function run_command_as_user

Source
pub fn run_command_as_user(
    command: &str,
    command_args: &[&str],
    user: &str,
    command_input: Option<&[u8]>,
) -> Result<CommandOutput, Error>
Expand description

Runs a command with command_args as a specific user and returns CommandOutput, which captures the command’s completion status.

Uses runuser to run the the command as a specific user.