{"id":25557875,"url":"https://github.com/puredarwin/xpc","last_synced_at":"2025-04-12T02:36:42.916Z","repository":{"id":75748806,"uuid":"126681155","full_name":"PureDarwin/XPC","owner":"PureDarwin","description":"XPC and Friends (libxpc, launchd and soon xpc.framework)","archived":false,"fork":false,"pushed_at":"2024-10-06T00:17:14.000Z","size":3816,"stargazers_count":62,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-12T02:36:42.620Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PureDarwin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-03-25T09:11:50.000Z","updated_at":"2025-03-25T04:32:48.000Z","dependencies_parsed_at":"2023-06-07T13:45:17.144Z","dependency_job_id":"860625da-79b1-4402-aa50-0ce2c81f78da","html_url":"https://github.com/PureDarwin/XPC","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureDarwin%2FXPC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureDarwin%2FXPC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureDarwin%2FXPC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureDarwin%2FXPC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PureDarwin","download_url":"https://codeload.github.com/PureDarwin/XPC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248507002,"owners_count":21115519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-20T15:19:52.627Z","updated_at":"2025-04-12T02:36:42.890Z","avatar_url":"https://github.com/PureDarwin.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XPC and Family! \n\nAn open-source reimplementation of Apple's XPC library and launchd for PureDarwin. Based on [launchd 842.91.1](https://opensource.apple.com/tarballs/launchd/launchd-842.91.1.tar.gz) and iXsystems's skeleton re-implementation of libxpc.\n\n**NOTE: The code in this repo compiles and runs but is currently untested. In particular, the implementation of xpc is incomplete, with several functions being no-ops.**\n\nThis project differs from a 'pure' launchd built from Apple's source to align better with what can be inferred of the current (macOS 10.13) implementation:\n\n* `liblaunch.dylib` contains no code. Instead it acts as a proxy to `libxpc.dylib` by way of indirect symbols.\n* `libxpc.dylib` contains the bulk of the logic that was in `liblaunch.dylib`, along with the untested / non-existant XPC code.\n* `launchd` is mostly unchanged, although audit logging is currently disabled.\n* `launchctl` has had a couple of code paths commented-out so that it builds.\n* A launch daemon script is included to launch bash at startup.\n\n#### Prerequisites\n\nYou will need a version of `libSystem` which links to `libxpc`, like [this one](https://github.com/PureDarwin/Libsystem). You will also need a version of `libcoreservices`, which it requires. You can find one [here](https://github.com/PureDarwin/libcoreservices).\n\nYou will also need a versions of `libedit` and `libbsm`.\n\n#### Installation\n\nA binary root will be made availble once the code has been shown to work to at least minimum standards.\n\nInstall the binaries into a Darwin image in the following locations:\n\n* `libxpc.dylib` and `liblaunch.dylib` into `/usr/lib/system`.\n* `launchd` into `/sbin`, but please read the discussion below first, you'll probably need to rename it to `pdlaunchd`.\n* `launchctl` into `/bin`.\n* Copy `org.puredarwin.console.plist` into `/System/Library/LaunchDaemons/`.\n* Install a version of `libSystem` which links to `liblaunch` and `libxpc`.\n* Install a version of `libsystem_coreservices` if one isn't already present.\n* Install versions of `libedit` and `libbsm` if they aren't already available.\n\nOnce you have done this, check the ownership of all directories up to the `LaunchDaemons` directory and all files inside it. They need to be `root:wheel` for `launchd` to be happy about launching them. Please note that if `chown`/`chmod` has no effect, you may need to run `diskutil enableOwnership` on the mounted volume first.\n\n`launchd` should run as the first user task (`pid` 1) in order to set up certain important services (such as the mach port nameserver) which child tasks inherit. When the kernel finishes booting the system it automatically runs `/sbin/launchd`. In current PureDarwin systems this file is a script which sets up various system parameters and then runs `/bin/bash`. To work with this, you should rename `launchd` to `pdlaunchd` and then replace\n\n```\n/bin/bash -i\n```\n\nin the `launchd` script with\n\n```\nexec /sbin/pdlaunchd\n```\n\nThe `exec` part is important. This will allow `launchd` to replace the startup script as `pid` 1. `launchd` will then in turn launch `launchctl` to bootstrap the system. If you have installed the `org.puredarwin.console.plist` then a `bash` shell will be started.\n\n#### TODO\n\n* Complete implementation of these xpc functions: `XPC_ERROR_CONNECTION_INTERRUPTED`; `XPC_CONNECTION_MACH_SERVICE_LISTENER`; `XPC_CONNECTION_MACH_SERVICE_PRIVILEGED`; `XPC_ERROR_CONNECTION_INVALID`\n* Get audit logging working using recent OpenBSM\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuredarwin%2Fxpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuredarwin%2Fxpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuredarwin%2Fxpc/lists"}