Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider re-adding the ability to select the game to configuration file #15682

Open
twrightsman opened this issue Jan 15, 2025 · 2 comments
Open
Labels
Feature request Issues that request the addition or enhancement of a feature @ Startup / Config / Util

Comments

@twrightsman
Copy link

twrightsman commented Jan 15, 2025

Problem

#13550 dropped the default_game setting from minetest.conf. This setting was useful for situations like running minetestserver in a template systemd unit.

For example, suppose I have a systemd template unit configured to start a server with the config in /etc/minetest/pvp.conf when [email protected] is started or in /etc/minetest/mineclonia.conf when [email protected] is started. Previously, I could use the same template service file and set the game in the configuration file. Now, if I want to run different games it seems I have to create individual service files that have --gameid set to the appropriate value, which defeats the purpose of the template units.

Perhaps I am missing some configuration option that allows this.

Solutions

Add a configuration option back to set the game from the configuration file.

Alternatives

#13550 mentions it should "automatically pick the first non-devtest game", but this doesn't seem to be the case for the dedicated server, which errors out if --gameid is not set even if MTG is installed and available.
(has been fixed)

Additional context

Related to setting the game, hopefully the map-dir setting in the configuration file is not deprecated like the CLI option to minetestserver is?

@twrightsman twrightsman added the Feature request Issues that request the addition or enhancement of a feature label Jan 15, 2025
@sfan5
Copy link
Collaborator

sfan5 commented Jan 17, 2025

Just fyi an usual solution to this limitation is to use an environment file (I think they can also be templated).
Here's an example from a different program:

prometheus.service:
[...]
[Service]
Restart=on-failure
User=prometheus
EnvironmentFile=/etc/default/prometheus
ExecStart=/usr/bin/prometheus $ARGS
[...]

/etc/default/prometheus:
ARGS='--enable-feature=memory-snapshot-on-shutdown'

#13550 mentions it should "automatically pick the first non-devtest game", but this doesn't seem to be the case for the dedicated server, which errors out if --gameid is not set even if MTG is installed and available.

somewhat related: #14989

@twrightsman
Copy link
Author

Ah totally forgot about EnvironmentFile, thanks! That's a solid workaround. Though long-term I still think it's easier for server admins running multiple servers to have the game + world configurable from the standard configuration file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Issues that request the addition or enhancement of a feature @ Startup / Config / Util
Projects
None yet
Development

No branches or pull requests

3 participants