Daemon

Discussion in 'Mac Programming' started by sivaprakash, Mar 23, 2011.

  1. sivaprakash macrumors member

    Joined:
    Mar 10, 2011
    Location:
    Chennai, India
    #1
    Hi


    Can someone give me a tutorial which explains how to write Daemon and register in the system?

    Thanks
    Siva
     
  2. misee macrumors member

    Joined:
    Jul 4, 2010
    #2
    I'm just answering because I'm in an extremely boring lecture. But here are the two first results when I googled "writing a deamon os x":
    1. Technical Note TN2083 titled "Daemons and Agents"
    2. System Startup Programming Topics
    And as a bonus I give you a link to the manpage for launchd

    By the way, if you're already too lazy to use google, at least give us more information (operating system & version, language and anything else you think might be important) and what you want to use it for - launchd is available for OS X 10.4 and above, so if you wan't to run your app on older systems, you'll need to find a different solution (think it was called startup items?).
     
  3. sivaprakash thread starter macrumors member

    Joined:
    Mar 10, 2011
    Location:
    Chennai, India
    #3
    Hi

    Thanks !! Since I am coming from Microsoft background things are little bit hard to capture the things.


    I am using Mac OS version of 10.6.5 and what I am trying to achieve is, I want to run a service (Daemon) which should listen for some message from my client based on the message it has to act (Async). The Daemon has to start it self when ever system boots up.

    I am planning to use Distributed Objects to pass the data between Client and Server.

    Can you please guide me?

    Thanks
    Siva
     
  4. misee macrumors member

    Joined:
    Jul 4, 2010
    #4
    First, you should read the documentation I linked to (especially the technote). It will probably answer a lot of your questions. I don't think anyone will give you a step for step guide, since it would take a lot of time. The apple docs are really good (at least I think so) and if anything is unclear, post your question and I'm sure there will be a lot of people willing to help you.
    Some more links:
    All About launchd Items (and How To Make One Yourself)
    launchd examples
    Tutorial: Backups with launchd.
     
  5. sivaprakash thread starter macrumors member

    Joined:
    Mar 10, 2011
    Location:
    Chennai, India
    #5
    Thanks much !!

    With the help of documents you shared I am able to write the services and it works well !!

    http://www.macresearch.org/tutorial_backups_with_launchd

    One basic question can I write Objective-C based Services ? Because I want to Invoke some WebServices from there ?
     
  6. misee macrumors member

    Joined:
    Jul 4, 2010
    #6
    There's the web services core which provides a C API for accessing web services if I'm not mistaken. You might want to look at WSDL2ObjC which will create Objective-C code from a WSDL file.
     
  7. sivaprakash thread starter macrumors member

    Joined:
    Mar 10, 2011
    Location:
    Chennai, India
    #7
    Thanks !! My question something different

    - Will I be able to write Objective-C code in Service layer? Because all I do is write Plist file and C-Based script (http://www.macresearch.org/tutorial_backups_with_launchd).

    - How can I write and deploy .m (Objective-C) to hook up

    Thanks
    Siva
     

Share This Page