@@ -16,23 +16,23 @@ Bootstrap and kickstart an APFS volume
1616#[ derive( Debug , serde:: Deserialize , serde:: Serialize , Clone ) ]
1717#[ serde( tag = "action_name" , rename = "bootstrap_launchctl_service" ) ]
1818pub struct BootstrapLaunchctlService {
19- service : String ,
19+ service_name : String ,
2020 path : PathBuf ,
2121 is_present : bool ,
2222 is_disabled : bool ,
2323}
2424
2525impl BootstrapLaunchctlService {
2626 #[ tracing:: instrument( level = "debug" , skip_all) ]
27- pub async fn plan ( service : & str , path : & str ) -> Result < StatefulAction < Self > , ActionError > {
28- let service = service . to_owned ( ) ;
27+ pub async fn plan ( service_name : & str , path : & str ) -> Result < StatefulAction < Self > , ActionError > {
28+ let service_name = service_name . to_owned ( ) ;
2929 let path = PathBuf :: from ( path) ;
3030
3131 let is_present = {
3232 let mut command = Command :: new ( "launchctl" ) ;
3333 command. process_group ( 0 ) ;
3434 command. arg ( "print" ) ;
35- command. arg ( format ! ( "{DARWIN_LAUNCHD_DOMAIN}/{service }" ) ) ;
35+ command. arg ( format ! ( "{DARWIN_LAUNCHD_DOMAIN}/{service_name }" ) ) ;
3636 command. stdin ( std:: process:: Stdio :: null ( ) ) ;
3737 command. stdout ( std:: process:: Stdio :: piped ( ) ) ;
3838 command. stderr ( std:: process:: Stdio :: piped ( ) ) ;
@@ -44,12 +44,12 @@ impl BootstrapLaunchctlService {
4444 command_output. status . success ( )
4545 } ;
4646
47- let is_disabled = service_is_disabled ( DARWIN_LAUNCHD_DOMAIN , & service )
47+ let is_disabled = service_is_disabled ( DARWIN_LAUNCHD_DOMAIN , & service_name )
4848 . await
4949 . map_err ( Self :: error) ?;
5050
5151 Ok ( StatefulAction :: uncompleted ( Self {
52- service ,
52+ service_name ,
5353 path,
5454 is_present,
5555 is_disabled,
@@ -66,7 +66,7 @@ impl Action for BootstrapLaunchctlService {
6666 fn tracing_synopsis ( & self ) -> String {
6767 format ! (
6868 "Bootstrap the `{}` service via `launchctl bootstrap {} {}`" ,
69- self . service ,
69+ self . service_name ,
7070 DARWIN_LAUNCHD_DOMAIN ,
7171 self . path. display( )
7272 )
@@ -89,7 +89,7 @@ impl Action for BootstrapLaunchctlService {
8989 #[ tracing:: instrument( level = "debug" , skip_all) ]
9090 async fn execute ( & mut self ) -> Result < ( ) , ActionError > {
9191 let Self {
92- service ,
92+ service_name ,
9393 path,
9494 is_present,
9595 is_disabled,
@@ -100,20 +100,20 @@ impl Action for BootstrapLaunchctlService {
100100 Command :: new ( "launchctl" )
101101 . process_group ( 0 )
102102 . arg ( "enable" )
103- . arg ( format ! ( "{DARWIN_LAUNCHD_DOMAIN}/{service }" ) )
103+ . arg ( format ! ( "{DARWIN_LAUNCHD_DOMAIN}/{service_name }" ) )
104104 . stdin ( std:: process:: Stdio :: null ( ) ) ,
105105 )
106106 . await
107107 . map_err ( Self :: error) ?;
108108 }
109109
110110 if * is_present {
111- crate :: action:: macos:: retry_bootout ( DARWIN_LAUNCHD_DOMAIN , service )
111+ crate :: action:: macos:: retry_bootout ( DARWIN_LAUNCHD_DOMAIN , service_name )
112112 . await
113113 . map_err ( Self :: error) ?;
114114 }
115115
116- crate :: action:: macos:: retry_bootstrap ( DARWIN_LAUNCHD_DOMAIN , service , path)
116+ crate :: action:: macos:: retry_bootstrap ( DARWIN_LAUNCHD_DOMAIN , service_name , path)
117117 . await
118118 . map_err ( Self :: error) ?;
119119
@@ -133,7 +133,7 @@ impl Action for BootstrapLaunchctlService {
133133
134134 #[ tracing:: instrument( level = "debug" , skip_all) ]
135135 async fn revert ( & mut self ) -> Result < ( ) , ActionError > {
136- crate :: action:: macos:: retry_bootout ( DARWIN_LAUNCHD_DOMAIN , & self . service )
136+ crate :: action:: macos:: retry_bootout ( DARWIN_LAUNCHD_DOMAIN , & self . service_name )
137137 . await
138138 . map_err ( Self :: error) ?;
139139
0 commit comments