File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ func WritePlistFile() error {
54
54
RunAtLoad bool
55
55
}{
56
56
Program : src ,
57
- RunAtLoad : false ,
57
+ RunAtLoad : true , // This will start the agent right after login (and also after `launchctl load ...`)
58
58
}
59
59
60
60
t := template .Must (template .New ("launchdConfig" ).Parse (string (launchdAgentDefinition )))
Original file line number Diff line number Diff line change @@ -335,9 +335,12 @@ func loop() {
335
335
if err != nil {
336
336
log .Info (err )
337
337
} else {
338
- err = config .LoadLaunchdAgent ()
338
+ err = config .LoadLaunchdAgent () // this will load the agent: basically starting a new instance
339
339
if err != nil {
340
340
log .Error (err )
341
+ } else {
342
+ log .Info ("Quitting, another instance of the agent has been started by launchd" )
343
+ os .Exit (0 )
341
344
}
342
345
}
343
346
} else {
You can’t perform that action at this time.
0 commit comments