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 02-27-2022, 12:04 AM
Gazebeaux
Fire Beetle
 
Join Date: Apr 2021
Location: Chicago, Illinois
Posts: 1
Default How to make a systemd service to start your server after system boot

I'm brand new to Linux and also a stupid idiot with a waste of a brain. But I figured something out, and in my googling I found lots of threads where people asked for help with this but I couldn't find an example that worked for me, so I came up with this:

[Unit]
Description=BoQ server

[Service]
Type=forking
User=boq
Group=users
WorkingDirectory=/home/eqemu/server
ExecStartPre=/bin/sleep 10
ExecStart=/home/eqemu/server/server_start.sh

[Install]
WantedBy=multi-user.target


the 2 most important parts of this for me were type=forking (instead of type=simple)and execstartpre/=/bin/sleep 10. I have no idea wtf forking means but the way I understand it is when you run a script and it keeps running a process in the background but the prompt returns, that requires forking. When I used simple, it ended the process but still reported success in the log because technically it was a success, simple isn't used for processes that keep running (that's how i understand it, could be wrong, don't hurt me)

execstartpre/=/bin/sleep 10 creates a 10 sec delay after booting before it runs the server. It wouldn't work without this for me because it hadn't completed its mySQL connection before it tried running the server.

Don't let Linux scare you. There's more than enough info online to figure it and there are big advantages to using it over windows, for me the primary one being that it's cheaper to rent a server that runs on it lol. Thanks to Akkadius and all who work on EQEmu and thanks to all those who answer questions here and on the discord. Y'all rock.
Reply With Quote
  #2  
Old 02-28-2022, 04:45 AM
Freejack
Sarnak
 
Join Date: Jan 2022
Location: In the woods
Posts: 66
Default

Quote:
Originally Posted by Gazebeaux View Post
I'm brand new to Linux and also a stupid idiot with a waste of a brain. But I figured something out, and in my googling I found lots of threads where people asked for help with this but I couldn't find an example that worked for me, so I came up with this:

[Unit]
Description=BoQ server

[Service]
Type=forking
User=boq
Group=users
WorkingDirectory=/home/eqemu/server
ExecStartPre=/bin/sleep 10
ExecStart=/home/eqemu/server/server_start.sh

[Install]
WantedBy=multi-user.target


the 2 most important parts of this for me were type=forking (instead of type=simple)and execstartpre/=/bin/sleep 10. I have no idea wtf forking means but the way I understand it is when you run a script and it keeps running a process in the background but the prompt returns, that requires forking. When I used simple, it ended the process but still reported success in the log because technically it was a success, simple isn't used for processes that keep running (that's how i understand it, could be wrong, don't hurt me)

execstartpre/=/bin/sleep 10 creates a 10 sec delay after booting before it runs the server. It wouldn't work without this for me because it hadn't completed its mySQL connection before it tried running the server.

Don't let Linux scare you. There's more than enough info online to figure it and there are big advantages to using it over windows, for me the primary one being that it's cheaper to rent a server that runs on it lol. Thanks to Akkadius and all who work on EQEmu and thanks to all those who answer questions here and on the discord. Y'all rock.
Just to let you know the docker install takes care of all of this. the only issue I have is on a reboot. Docker never gets completely shutdown fast enough.
__________________
Freejacks EQ World
Just a place to adventure and do the things I did not do before and that was a long time ago.
Reply With Quote
  #3  
Old 02-28-2022, 04:02 PM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 69
Default

I really need to look into docker...
Reply With Quote
  #4  
Old 03-01-2022, 02:39 AM
Freejack
Sarnak
 
Join Date: Jan 2022
Location: In the woods
Posts: 66
Default

Quote:
Originally Posted by markusdabrave View Post
I really need to look into docker...
https://github.com/Akkadius/akk-stack


Complete install instructions and setup, works like a wine prefix. also doing this you get all the tools and monitoring capabilities. Updates are a breeze.
__________________
Freejacks EQ World
Just a place to adventure and do the things I did not do before and that was a long time ago.
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 11:40 AM.


 

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