Skip to content

Commit

Permalink
Revert "Back to run-at-load hoping that works"
Browse files Browse the repository at this point in the history
This reverts commit cccb8bc.

It starts too early, fails, and then aborts. When it fails,
launchd says the service failed to initialize and that the system
is read-only.
  • Loading branch information
grahamc committed Oct 11, 2023
1 parent cccb8bc commit c6d9266
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/action/macos/create_nix_hook_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ impl Action for CreateNixHookService {
/// This function must be able to operate at both plan and execute time.
async fn generate_plist(service_label: &str) -> Result<LaunchctlHookPlist, ActionErrorKind> {
let plist = LaunchctlHookPlist {
run_at_load: true,
keep_alive: KeepAliveOpts {
successful_exit: false,
},
label: service_label.into(),
program_arguments: vec![
"/bin/sh".into(),
Expand All @@ -201,11 +203,17 @@ async fn generate_plist(service_label: &str) -> Result<LaunchctlHookPlist, Actio
pub struct LaunchctlHookPlist {
label: String,
program_arguments: Vec<String>,
run_at_load: bool,
keep_alive: KeepAliveOpts,
standard_error_path: String,
standard_out_path: String,
}

#[derive(Deserialize, Clone, Debug, Serialize, PartialEq)]
#[serde(rename_all = "PascalCase")]
pub struct KeepAliveOpts {
successful_exit: bool,
}

#[non_exhaustive]
#[derive(Debug, thiserror::Error)]
pub enum CreateNixHookServiceError {
Expand Down

0 comments on commit c6d9266

Please sign in to comment.