PDA

View Full Version : dhcp-3.0.4 with mac 10.3.9 Startup issue


intouch1
08-17-2006, 09:55 AM
Hi All,

I have install dhcp-3.0.4 on my mac OS 10.3.9 server.

It has been running ok and I can start the DHCP services by typing 'sudo dhcpd'

However, I can NOT configure it to startup on boot up.

I have done the following below:

1. Add DHCP=-YES- to /etc/hostconfig entry
2. Make StartupItem folders:
% mkdir /Library/StartupItems
% mkdir /Library/StartupItems/DHCP
% mkdir /Library/StartupItems/DHCP/Resources
% mkdir /Library/StartupItems/DHCP/Resources/English.lproj
3. Make /Library/StartupItems/DHCP/DHCP. On my network, DHCP is being served by en0; modify "/usr/sbin/dhcpd en0" to taste:
______________________________________________________________________
#!/bin/sh

##
# DHCP
##

. /etc/rc.common

StartService ()
{
if [ "${DHCP:=-NO-}" = "-YES-" ]; then
if ! pid=$(GetPID dhcpd); then
ConsoleMessage "Starting DHCP services"
/usr/sbin/dhcpd en0
fi
fi
}

StopService ()
{
if pid=$(GetPID dhcpd); then
ConsoleMessage "Stopping DHCP services"
kill -TERM "${pid}"
else
echo "dhcpd is not running."
fi
}

RestartService ()
{
if pid=$(GetPID sendmail); then
ConsoleMessage "Restarting DHCP services"
kill -HUP "${pid}"
else
StartService
fi
}

RunService "$1"
___________________________________________________________
4. Make /Library/StartupItems/DHCP/StartupParameters.plist:
___________________________________________________________
{
Description = "DHCP server";
Provides = ("DHCP");
Requires = ("Network");
Uses = ("Disks", "Network Time");
OrderPreference = "None";
}
___________________________________________________________

NOTE: THE ABOVE MALFORMATION ERROR SO I CHANGED IT TO;
___________________________________________________________
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Description</key>
<string>DHCP server</string>
<key>Messages</key>
<dict>
<key>start</key>
<string>Starting DHCP server</string>
<key>stop</key>
<string>Stopping DHCP server</string>
</dict>
<key>OrderPreference</key>
<string>None</string>
<key>Provides</key>
<array>
<string>DHCP</string>
</array>
<key>Requires</key>
<array>
<string>Network</string>
</array>
<key>Uses</key>
<array>
<string>Disks</string>
<string>Network Time</string>
</array>
</dict>
</plist>
___________________________________________________________



5. Make /Library -> StartupItems -> DHCP -> Resources -> English.lproj -> Localizable.strings:
___________________________________________________________
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/
Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>Starting DHCP services</key>
<string>Starting DHCP services</string>
<key>Stopping DHCP services</key>
<string>Stopping DHCP services</string>
<key>Restarting DHCP services</key>
<string>Restarting DHCP services</string>
</dict>
</plist>
___________________________________________________________
6 Set ownership and permissions:
% chown -R root.wheel /Library/StartupItems/DHCP
% chmod -R 755 /Library/StartupItems/DHCP
% chmod 644 /Library/StartupItems/DHCP/StartupParameters.plist

7. Finally, start the DHCP services:
% sudo SystemStarter start DHCP

___________________________________________________________

However, when I run
% sudo SystemStarter start DHCP
It ERRORS with:
___________________________________________________________
Welcome to Macintosh.
Initializing network
Exec failed for item /Library/StartupItems/DHCP: Exec format error
DHCP server (6970) did not complete successfully.
The following StartupItems failed to properly start:
/Library/StartupItems/DHCP - execution of Startup script failed
Startup complete.
Hangup
___________________________________________________________

Can anyone tell me how to fix this problem?

Thanks

James

BillMen
08-17-2006, 10:08 AM
I did it through the GUI, (Server Admin App), and it worked fine.

giskard22
08-17-2006, 10:17 AM
If you don't get an answer here, try Apple's OS X Server email list at lists.apple.com.