The Minetest server tries to locate a home directory on start up and fails with the following message if a home directory is not available:
ERROR[Main]: Cannot create user data directory
Since the default Gentoo minetest user does not have a home directory by default, the Minetest server is unable to start by default.
Minetest searches for the user's home directory in order to create/access the .minetest directory. The path for this directory is currently not configurable in the Minetest source code.
There are a few ways to resolve this. The easiest and most obvious is to give the Gentoo minetest user a home directory. Although this is the solution put forward by the upstream Minetest team (see https://github.com/minetest/minetest/issues/6869), I don't think there's a technical reason why the user running Minetest must have a home directory set.
Perhaps we should try implementing a command line option to allow the relevant directory to be configured by the user rather than hardcoded to the home directory.
I've submitted a patch upstream implementing a commandline option to configure a custom user data directory path: https://github.com/minetest/minetest/pull/9424
I haven't received word from upstream yet about the patch to add support for custom user data paths, so I have implemented an update to acct-user/minetest to add a default home directory of /var/lib/minetest to the Gentoo minetest user: https://github.com/gentoo/gentoo/pull/14890
The custom user data path patch would be the proper way to resolve this, but I hesitate adding it to Gentoo just yet since upstream might ultimately reject it. For now, setting a default home directory for the Gentoo minetest user should fix this until upstream responds to the upstream patch submission.
The bug has been referenced in the following commit(s):
Author: William Breathitt Gray <firstname.lastname@example.org>
AuthorDate: 2020-03-09 01:03:38 +0000
Commit: Joonas Niilola <email@example.com>
CommitDate: 2020-03-09 05:55:10 +0000
acct-user/minetest: Add home directory
Minetest requires a home directory to store user data. This patch adds
/var/lib/minetest as the default home directory for the minetest user.
Signed-off-by: William Breathitt Gray <firstname.lastname@example.org>
Signed-off-by: Joonas Niilola <email@example.com>
acct-user/minetest/minetest-1.ebuild | 14 ++++++++++++++
1 file changed, 14 insertions(+)