OSX: monitoring startup, daemons and agents

Is there a way that we can control the launch of the program itself, that is, if the task is loaded or unloaded from the daemon / agent list from launch? For example, can any administrative application register to receive an event whenever a new plist is loaded or unloaded by the launchD daemon, for example by running this command launchctl load/unload /Library/LaunchDaemons(or launchAgents)/test.plist

:?

A survey is one option, but is there an effective resource?

Any help would be appreciated.

+3


source to share


1 answer


I'm not sure if this is exactly what you are looking for, but there is a very powerful tool out there for OSX called dtrace

. You can use it to view all kinds of events in the system and filter them how you want, like system calls.

With your specific scenario, I would even take a look at dtruss

which is much easier to use a tool that uses dtrace to provide you with information: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dtruss .1m.html It should be pretty easy to get a "hint" from dtruss every time a call is made launchctl

, I'm not sure what information you want from the call.



dtrace

contains whole books on how to use it and write signatures for it. If you can't get everything you need from dtruss

, you can explore it a little more.

Also, these are not command line tools, if you are looking for something software, you have a little more work in front of you.

0


source







All Articles