Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managed (with difficulty) to build and run, but... #2

Open
Motti-Shneor opened this issue Jan 12, 2021 · 1 comment
Open

Managed (with difficulty) to build and run, but... #2

Motti-Shneor opened this issue Jan 12, 2021 · 1 comment

Comments

@Motti-Shneor
Copy link

First, the "install" and "uninstall" targets are quite weird (they do their stuff at "build" time and not on "run" time - so on later Xcode versions, they simply fail immediately for not producing anything.

Second - you indeed said in ReadMe -

You will need to set SUDO_ASKPASS to run the installation and uninstallation targets.

but you didn't say where and to what --- I looked quite everywhere and didn't manage to find a way to make this work (I even saw your own setting somewhere in the project - assumed the value should be 'root' password and tried that too - to no avail.

So finally - only by doing both the "install" and "uninstall" stages manually in terminal (copying the .plist, the binary and then using launchctl to load the daemon) was I finally able to Mae things work. So -- this part needs some enhancement.

HOWEVER... I'm trying to use this wisdom and know-how in my own project, and simply cannot make it work.

I replicated almost exactly what you did, and my "Client" (some sample UI app I put up for this) cannot "talk" to the "XPC Service" (a global daemon I have). the lazily-initialised "connection" property always gets the "connection invalidated".

while my daemon's "listener" delegate (the one that should setup and approve a connection) simply never gets called.

Now... I wonder where I went wrong - and if there are specific "rules" you didn't write about ---

Mine is a global launch-daemon running with root privileges. its .plist is installed exactly the same place as yours, but the binary cannot reside in /Library/PrivilegedHelpers/ because it MUST be packaged within an App bundle, which is stored in /Library/xxxxx/myDaemon.app

I wonder if you can help with identifying the missing part/s so that when I get it to work - I will be able to contribute to this repo, by enhancing the documentation, or even brining in more content...

I will be more than happy to hear from you.

@klmitchell2
Copy link

Hey @Motti-Shneor,

Regarding the first part of your issue. I followed this:

image

And then configured the first line of the run script like so in Xcode:

. ~/.zshrc
sudo -A ${PROJECT_DIR}/Scripts/install.sh ${PROJECT_DIR} ${BUILT_PRODUCTS_DIR}

Regarding the last portion of your issue, I am trying to figure out connect multiple clients to the Launch Daemon. It appears that the Client in this project works, but when I make a second client that tries to make a connection to the daemon the invalidationHandler is triggered.

Any ideas if Launch Daemons can handle multiple client connections?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants