Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-31-2010, 03:04 PM
cubber
Discordant
 
Join Date: Apr 2006
Posts: 374
Default Gentoo Startup Script

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!"
}
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:21 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3