Web Threads » Misc » Eggdrop on Mac OS X, Auto Start Service
Eggdrop on Mac OS X, Auto Start Service
I run eggdrop on my Mac Mini, which connects to an IRC channel that is used via java applet by website users. With Eggdrop I can monitor the channel users and display who’s in chat on the website.
I needed this service to start when the Mac starts or reboots regardless of whether someone’s logged in or not. It did take some digging and much trial and error (only a little blood, sweat and tears), but I did find a solution.
With MS Windows you drag and drop a program to the Startup folder, or there is an included service installed with the install program. Not so for Eggdrop, at least the version I installed some time ago.
I now have in my Mac > Library > StartupItems a StartupEggdrop directory which contains two files, startupeggdrop and StartupParameters.plist.
startupeggdrop:
#!/bin/sh # #============================================================== # MyStartupEggdrop # Copyright (c) 2009 Leah. All rights reserved. #============================================================== . /etc/rc.common StartService () { # Log a console message ConsoleMessage "Starting Eggdrop" # Start eggdrop with the path to another startup shell script which launches the program # /Users/leah/eggdrop/eggdropstart.sh } StopService () { # Log a console message # ConsoleMessage "Stopping Eggdrop" # Stop eggdrop with the killall, though this might not be the best way to stop it, I'm no guru # killall eggdrop } RestartService () { StopService StartService } RunService "$1"
StartupParameters.plist:
<?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>eggdrop irc bot</string> <key>OrderPreference</key> <string>Last</string> <key>Provides</key> <array> <string>StartupEggdrop</string> </array> <key>Requires</key> <array/> <key>Uses</key> <array/> </dict> </plist>
I opted for eggdrop to start last as it has some dependencies on other system services but I couldn’t tell you which.
The shell script that is in the eggdrop directory specified in the startupeggdrop file…
eggdropstart.sh
#!/bin/sh cd /Users/leah/eggdrop sudo -u Leah ./eggdrop
How can you tell if you’re not logged in that it’s running? telnet to the machine and type “top” (q to exit), it will name the running processes and eggdrop should be listed, ftw.
I’m normally a PC user, but I also have a Mac Mini for development purposes. There are some things that the Mac does better for me than a PC, and vice versa. I don’t take part in the mac v. pc argument. There are good and bad about both, but having both gives me the best of both worlds.
Now I can go on to setup the ventrillo service to startup in the same way!




Like









