EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Linux Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=588)
-   -   systemctl startup/shutdown script (https://www.eqemulator.org/forums/showthread.php?t=39751)

Yummy 06-10-2015 04:57 PM

systemctl startup/shutdown script
 
Does anyone have an example of a systemd startup and shutdown script?

Fedora/CentOS move from sys-v to systemd has left me feeling a bit lost. :)

Thank you

Flopz 08-10-2015 06:36 PM

Here are what I'm using for mine

Code:

# cat /usr/lib/systemd/system/eqemu-world.service
[Unit]
Description=EQ Emulator World server
After=network.target

[Service]
Type=simple
User=eq
Group=users
WorkingDirectory=/home/eq/server
ExecStartPre=/home/eq/server/shared_memory
ExecStart=/home/eq/server/world

[Install]
WantedBy=multi-user.target

Code:

# cat /usr/lib/systemd/system/eqemu-zones.service
[Unit]
Description=EQ Emulator Zone server
After=network.target
After=eqemu-world.service
Requires=eqemu-world.service

[Service]
Type=simple
User=eq
Group=users
WorkingDirectory=/home/eq/server
ExecStart=/home/eq/server/eqlaunch zone

[Install]
WantedBy=multi-user.target

EDIT: This is on CentOS 7. I'd imagine would work fine on Fedora without modifying (beyond changing the paths, that is)

jpyou127 08-19-2015 11:55 AM

Would this work on Ubuntu? And how is the service called at bootup?

I have systemd with systemd-shim.list, but the directory structure in the above scripts are different.

Yummy 09-06-2015 05:48 PM

Quote:

Originally Posted by Flopz (Post 242424)
Here are what I'm using for mine

Thank you! I will give it a go and let you know the results.

Yummy 09-06-2015 08:19 PM

Quote:

Originally Posted by Flopz (Post 242424)
Here are what I'm using for mine

I had to make some minor changes but your examples were perfect as a starting point. You saved me hours and hours. Thank you!

For Fedora 22, I chose to create five systemd scripts. The those unfamiliar with the process, I have provided details here https://blog-harmonson.rhcloud.com/2...erver-minimal/ under the section titled Systemd Scripts.


eqemu-loginserver.service
Code:

[Unit]
Description=EQ Emulator Login server
After=mysqld.service
Requires=mysqld.service

[Service]
Type=simple
User=eqadmin
Group=users
WorkingDirectory=/home/eqadmin/eqemu/server
ExecStart=/home/eqadmin/eqemu/server/loginserver

[Install]
WantedBy=multi-user.target


eqemu-world.service
Code:

[Unit]
Description=EQ Emulator World server
After=eqemu-loginserver.service
Requires=eqemu-loginserver.service

[Service]
Type=simple
User=eqadmin
Group=users
WorkingDirectory=/home/eqadmin/eqemu/server
ExecStartPre=/home/eqadmin/eqemu/server/shared_memory
ExecStart=/home/eqadmin/eqemu/server/world

[Install]
WantedBy=multi-user.target

eqemu-queryserv.service
Code:


[Unit]
Description=EQ Emulator Query server
After=eqemu-world.service
Requires=eqemu-world.service

[Service]
Type=simple
User=eqadmin
Group=users
WorkingDirectory=/home/eqadmin/eqemu/server
ExecStart=/home/eqadmin/eqemu/server/queryserv

[Install]
WantedBy=multi-user.target

eqemu-ucs.service
Code:

Unit]
Description=EQ Emulator UCS server
After=eqemu-queryserv.service
Requires=eqemu-world.service

[Service]
Type=simple
User=eqadmin
Group=users
WorkingDirectory=/home/eqadmin/eqemu/server
ExecStart=/home/eqadmin/eqemu/server/ucs

[Install]
WantedBy=multi-user.target

eqemu-zones.service
Code:

[Unit]
Description=EQ Emulator Zone server
After=eqemu-ucs.service
Requires=eqemu-world.service

[Service]
Type=simple
User=eqadmin
Group=users
WorkingDirectory=/home/eqadmin/eqemu/server
ExecStart=/home/eqadmin/eqemu/server/eqlaunch zone

[Install]
WantedBy=multi-user.target



All times are GMT -4. The time now is 08:17 AM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.