Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 2 of 2
  1. #1
    spb
    spb is offline Registered User
    Join Date
    Dec 2004
    Posts
    138
    Thanks
    0
    Thanked 0 Times in 0 Posts

    StartupItems daemon

    Hi,

    ddclient is a script that checked one's IP address and then updated a registered domain name to match the IP address if it has changed. In Linux is it typically run as a daemon once the script it properly configured.

    I want to run it as a daemon on my Macmini (running Tiger).

    To this end I've created:

    1) A folder in StartupItems called DDCLIENT

    2) A script to run the daemon called DDCLIENT, located inside the directory DDCLIENT

    pernod:/Library/StartupItems/DDCLIENT scott$ more DDCLIENT
    #!/bin/sh

    . /etc/rc.common

    StartService ( )
    {
    ConsoleMessage "Starting DDCLIENT"
    /usr/sbin/ddclient &
    }


    3) A property list file called StartupParameters.plist also located in the directory.

    pernod:/Library/StartupItems/DDCLIENT scott$ more StartupParameters.plist
    {
    Description = "ddclient daemon initialization";
    Provides = ("DDCLIENT");
    Requires = ("Network");
    OrderPreference = "Late";
    Messages =
    {
    start = "Starting DDCLIENT";
    stop = "Stopping DDCLIENT";
    };
    }

    I should be able to run "sudo SystemStarter start DDCLIENT" and everything should be fine. Right? When I run SystemStarter it doesn't complain, but when I run "ps -aux | grep -i ddclient" I don't find any instances of ddclient running.

    Does anyone see a mistake? Does systemstarter work in Tiger or is this something elimiated in the transition from Panther to Tiger?

    Thank you,
    SB

  2. #2
    cfr
    cfr is offline Registered User
    Join Date
    Jul 2005
    Posts
    55
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure if this is everything, but a couple of things off the top of my head:
    For the script DDCLIENT:
    1) Remove the & from the line "/usr/sbin/ddclient &"
    2) Add
    RunService "$1"
    at the end of the file.
    Also:
    3) The script just gives StartService, but the plist file says it should give both StartService and StopService.
    4) Make sure the permissions are correct. The following works:
    -rwxr-xr-x 1 root wheel 2726 Aug 7 23:28 SomeScript*
    -rw-r--r-- 1 root wheel 331 Feb 19 2006 StartupParameters.plist
    Check them and adjust as required. (Other ownership might work in some cases - I'm not sure.)
    5) Look in the console and system log files to diagnose the problem.

    - cfr

 

 

Similar Threads

  1. /library/startupitems
    By hohum in forum Mac OS X System & Mac Software
    Replies: 0
    Last Post: October 9th, 2005, 09:30 PM
  2. Put Postfix in startupItems?
    By Matsaki in forum Mac OS X System & Mac Software
    Replies: 14
    Last Post: July 13th, 2005, 10:58 PM
  3. StartupItems
    By macxhead in forum Mac OS X System & Mac Software
    Replies: 0
    Last Post: February 11th, 2002, 06:48 PM
  4. StartupItems
    By couzteau in forum Mac OS X System & Mac Software
    Replies: 3
    Last Post: November 21st, 2001, 10:12 PM
  5. StartUpItems vs. (erm) StartUpItems
    By MasonMcD in forum Mac OS X System & Mac Software
    Replies: 1
    Last Post: December 18th, 2000, 07:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •