View Single Post
  #12  
Old 03-21-2019, 06:28 PM
timber28
Fire Beetle
 
Join Date: Feb 2009
Location: florida
Posts: 1
Default

Here is a tad better way to do it (I try to avoid doing stuff like this in cron), if you want to be able to control it with systemctl.

Edit the server_start script you want to use and server_stop.sh and add a cd /home/eqemu/server (or wherever you installed it) as the 2nd line.

Code:
#!/usr/bin/env bash
cd /home/eqemu/server
Then create this in /etc/systemd/system as eqemu.service
Code:
[Unit]
Description=EQ Emulator Server with Login server
After=mysql.service

[Service]
User=eqemu
Group=eqemu
Type=forking
ExecStart=/home/eqemu/server/server_start_with_login.sh
ExecStop=/home/eqemu/server/server_stop.sh
Restart=on-failure

[Install]
WantedBy=multi-user.target
Then run systemctl daemon-reload
This will let you see the status of the service with systemctl status eqemu, and you can start/stop the server with the normal start/stop commands.

Don't forget to systemctl enable eqemu to enable it starting at boot.
Reply With Quote