How to get pid of process providing mach service
How to get pid of process providing mach service
- Subject: How to get pid of process providing mach service
- From: Tim Murison <email@hidden>
- Date: Thu, 26 Feb 2009 14:47:25 -0500
- Thread-topic: How to get pid of process providing mach service
I'm looking for some advice on how get the pid of a process that provides a
particular service that has been checked into the bootstrap server.
The bigger picture is that I want to check the runtime code signature of the
process that owns this service. I have made some progress on the issue, but
I've hit a roadblock.
My first attempt involved using the launch.h APIs to retrieve all launchd
processes, find the mach service of interest and get the PID from there.
This works when the provider process is started as a user, as root or as a
user using launchctl... but fails when started as root using launchctl. I've
given up on this approach since I understand that as a user I have no access
to services managed by the root launchd process.
My second attempt involves appending the PID of the target process to its
service name and iterating over all service names using bootstrap_info().
This would work quite nicely, but it appears that bootstrap_info() has been
deprecated in Leopard.
Is there another way to accomplish this? Is there a Leopard-and-up friendly
way of listing all (including root managed) service names from a user
process?
Thanks in advance,
-Tim
***********************************************************************
This e-mail and its attachments are confidential, legally privileged, may be subject to copyright and sent solely for the attention of the addressee(s).
Any unauthorized use or disclosure is prohibited. Statements and opinions expressed in this e-mail may not represent those of Radialpoint.
Le contenu de ce courriel est confidentiel, privilégié et peut être soumis à des droits d'auteur. Il est envoyé à l'intention exclusive de son ou de ses
destinataires. Il est interdit de l'utiliser ou de le divulguer sans autorisation. Les opinions exprimées dans le présent courriel peuvent diverger de celles de Radialpoint.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden