Skip to content

Instantly share code, notes, and snippets.

@joenas
Created April 10, 2017 13:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joenas/cb336516c2944954835857887bc31a4c to your computer and use it in GitHub Desktop.
Save joenas/cb336516c2944954835857887bc31a4c to your computer and use it in GitHub Desktop.
Minetest systemd service for user
[Unit]
Description=Minetest server
After=syslog.target network.target
[Service]
Type=simple
Restart=on-failure
ExecStart=/usr/bin/minetest --server --world /home/minetest/.minetest/worlds/%i --gameid %i --config server.conf
[Install]
WantedBy=default.target
@joenas
Copy link
Author

joenas commented Apr 10, 2017

This allows for easily running different games/worlds with a quick command
Place minetest@.service in ~/.config/systemd/user to be able to run without sudo.
Usage: systemctl --user [start|stop|status|restart] minetest@aftermath for example
To keep the session when user logs out: loginctl enable-linger [username]

Inspired by this, I might add something with EnvironmentFile as well to use different ports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment