I created a startup script for Gentoo users that can be placed in /etc/init.d/ and set using rc-update to run on server startup.
You can also manually use it like any other rc script and execute it by doing a /etc/init.d/eqemu-server start or stop
Make sure you change the variables to reflect your particular setup, pay special attention to the following:
EQEMU_FOLDER="/opt/eqemu" - your eqemu server location
LS_FOLDER="/opt/loginserver" - your login server location
OWNER="eqemu" - the user you run eqemu as
the rest of the variables assume you have the peq startup scripts provided from the wiki in your eqemu directory as well as the ucs scripts.
Don't forget to chmod +x the file before you try to use it!
Note: This is my first attempt at a gentoo rc-script so if you have any suggestions for improvement please feel free to post them. When I have some more free time I am going to try to work out an ebuild next.
Code:
#!/sbin/runscript
# ----------------------------------------------------------------------
# File: /etc/init.d/eqemu-server
# Purpose: Startup the EverQuest Emulator Game Server
# By: Cubber
# Date: 8-31-2010
# ----------------------------------------------------------------------
#Variables
EQEMU_FOLDER="/opt/eqemu"
LS_FOLDER="/opt/loginserver"
OWNER="eqemu"
EQEMU_START='./start'
EQEMU_STOP='./stop'
LS_START='./EQEmuLoginServer &'
LS_STOP='killall EQEmuLoginServer'
UCS_START='./ucs &'
UCS_STOP='killall ucs'
depend() {
need net mysql
}
start() {
ebegin "Starting the EQEmu Server"
cd "$LS_FOLDER"
/bin/su $OWNER -c "$LS_START"
cd "$EQEMU_FOLDER"
/bin/su $OWNER -c "$EQEMU_START"
/bin/su $OWNER -c "$UCS_START"
eend $? "Failed to start the EQEmu Server!"
}
stop() {
ebegin "Stopping the EQEmu Server"
cd "$EQEMU_FOLDER"
/bin/su $OWNER -c "$EQEMU_STOP"
/bin/su $OWNER -c "$UCS_STOP"
cd "$LS_FOLDER"
/bin/su $OWNER -c "$LS_STOP"
eend $? "Failed to stop the EQEmu Server!"
}