I am new to Mac OSX and i am trying to develop a daemon (i am familiar with windows services, and trying to achieve about the same things).
What i did so far:
Managed to write a plist file in LaunchDaemons (i found out that those daemons run under system account, not user, just like a windows service with local system permissions).
I managed to make it run on startup, and run my simple hello world application that just writes something to a file every 10 seconds.
The problem is, when i unload the daemon with launchd, it just kills my process. Is it any way to have the daemon either run something else on unload, or communicate to my process that it is shutting down, so i can perform an unload action in my code?
Thank you