-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mac: Use launchd to start the daemon as part of setup
This PR adds a launchd plist file for daemon in `~/Library/LaunchAgents/com.redhat.crc.daemon.plist` and starts it as part of setup. As of now this plist file doesn't use socket activation due to initial socket file descriptor hold by the launchd process and not by the `crc daemon` process, first query to daemon api blocks and one way to overcome to this problem is use something we are doing in the linux to check the file descriptor and use for golang net listener on that file. In the mac it is tricky because then we need cgo which will break the cross compilation by using something like https://github.com/sstephenson/launch_socket_server/blob/master/src/launch/socket.go ``` ✗ ./crc setup [...] Your system is correctly setup for using CodeReady Containers. Use 'crc start' to start the instance ✗ launchctl list | grep crc 97867 0 com.redhat.crc.daemon ✗ ps aux | grep crc prkumar 97734 0.0 0.2 34905808 28068 ?? S 8:58PM 0:00.10 /Users/prkumar/.crc/bin/crc daemon --log-level=debug ✗ curl --unix-socket ~/.crc/crc-http.sock http://foo/api/version {"CrcVersion":"2.0.1","CommitSha":"b9541d33","OpenshiftVersion":"4.10.3","PodmanVersion":"3.4.4"} ✗ ./crc cleanup [...] Cleanup finished ✗ launchctl list | grep crc <-no result-> ✗ curl --unix-socket ~/.crc/crc-http.sock http://foo/api/version curl: (7) Couldn't connect to server ```
- Loading branch information
1 parent
197df63
commit 2ca23cf
Showing
6 changed files
with
110 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters