From 2af42b920d30f906541b6b8b6171dcc1df66b4a8 Mon Sep 17 00:00:00 2001 From: praveenkumar Date: Fri, 1 Apr 2022 13:40:20 +0530 Subject: [PATCH] Mac: Enable daemon service to run as soon as user login This PR enable the daemon service to run user session basis, if system reboot and user logs in then this service now auto started. - User installs crc first time and do crc setup - As part of the setup crc daemon is started by launchd - User reboots - Tray autostart with reboot but crc setup --check-only fails because launchd agent 'com.redhat.crc.daemon' is not running which triggers the on-boarding fixes: #3104 --- pkg/os/launchd/launchd_darwin.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/os/launchd/launchd_darwin.go b/pkg/os/launchd/launchd_darwin.go index 3d12fca792..6f05a88611 100644 --- a/pkg/os/launchd/launchd_darwin.go +++ b/pkg/os/launchd/launchd_darwin.go @@ -41,6 +41,8 @@ const ( {{ $value }} {{ end }} + RunAtLoad + ` @@ -112,12 +114,12 @@ func CheckPlist(config AgentConfig) error { // LoadPlist loads a launchd agents' plist file func LoadPlist(label string) error { - return runLaunchCtl("load", getPlistPath(label)) + return runLaunchCtl("load", "-w", getPlistPath(label)) } // UnloadPlist Unloads a launchd agent's service func UnloadPlist(label string) error { - return runLaunchCtl("unload", getPlistPath(label)) + return runLaunchCtl("unload", "-w", getPlistPath(label)) } // RemovePlist removes a launchd agent plist config file