Silence - finaly
It's set up, it's running and you cannot hear it!My cube is working. It now functions as a dhcp and dns server for my local Network, downloads stuff via BitTorrent and burns DVDs via a network connectio to my PowerBook. Great.
After installing a frash copy of Panther on the Cube the basic user stup was really simple - just copy the applications, the ~/Libary/Preferences and the ~/Libary/Application Support Folders and everything feels like it is on the PowerBook. I then only copied over some other things I needed: QuickTime Extentions for DivX/Xvid/OGG Playback, my iCal Calendars and my iTunes folder.
Then I instsalles Fink - and learned the you have to respect their installation instructions precicely.
Then I installed Ruby to get my scripts working.
After having a working system I copied over my bind and dhcpd settings from my SuSE Linux box, which served as the dns/dhcp server before and ran
#apt-get install dhcp
- I didn't need BIND, bacause OS X already has BIND installd. After copying named.conf and my zone setup files into /etc/ and /var/named/ I activated bind by changing DNSSERVER:-NO- to -YES- in /etc/hostconfig. So named was up and running after hacking
sudo SystemStarter BIND start
into a Terminal window. As I mentioned before there is no dhcpd installed in OS X by default. After installing it via Fink and placing my dhcpd.conf in /etc I had to set it up to start at system startup. In OS X/Darwin Apple advises you to use SystemStarter for this purpose. as
man SystemStarter
told me it executes starup scripts from two locations: /System/Library/StartupItems
which contains the ones Apple provides and you should not mess with and /System/Library/StartupItems
user (e.g. admin) defined startup items from /Library/StartupItems
. Those Startup items consist mainly of a directory which contains an execuable (a script in most cases - same name as the dir [eg. .../DHCP/DHCP]) which gets the arguments start
,stop
and restart
passed on by the SystemStarter application during bootup/shutdown - much like /etc/init.d/ in the LSB (Linux Standard Base - rules for things that most Linux distris have in common - least common denominator for Linux you could call it), but whats different is the .plist file in the directory, which contains some infos for the SystemStarter - the name of the service, the required services for this sevice/deamon to run, an optional precedence (should it be started early or late...) and the services it uses (but are not essetial).So by using
/System/Library/StartupItems/BIND/
I created a Startup Item for my DHCP which is launched if DHCPSERVER:-YES- is configured in /etc/hostconfig:BIND - the startup script
#!/bin/shand the StartupParameters.plist
##
# DHCP service - using Fink
# by Toto (MrToto[ÄT]gmx.net)
##
. /etc/rc.common
StartService ()
{
if [ "${DHCPSERVER:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Starting dhcpd"
/sw/sbin/dhcpd
fi
}
StopService ()
{
ConsoleMessage "Stopping dhcpd"
kill -TERM `cat /var/run/dhcpd.pid`
}
RestartService ()
{
if [ "${DHCPSERVER:=-NO-}" = "-YES-" ]; then
ConsoleMessage "Restarting dhcpd"
if [ -x /var/run/dhcpd.pid ]; then
kill -HUP `cat /var/run/dhcpd.pid`
else
/sw/sbin/dhcpd
fi
else
StopService
fi
}
RunService "$1"
{
Description = "DHCP server";
Provides = ("DHCP");
Requires = ("Network");
Uses = ("Network");
OrderPreference = "None";
}
Feel free to use those for yourself it should work seamlessly if you use Fink in /sw and type
sudo apt-get install dhcp
. Just place the two files in /Library/StartupItems/DHCP (if it's not there create it) owned by root. The startup script should be execuable and named DHCP and the .plist file has to be named StartupParameters.plist.Have fun and welcome to Darwin! ;-)
Monday, 1. March 2004, 17:42, by mrtoto |
|comment