StartupItems daemon

spb

Registered
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
 
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
 
Back
Top