Les fichiers pour installer le serveur NALC.
Go to file
2022-05-27 14:36:02 +02:00
doc Rewrite of the install script 2022-05-27 14:36:02 +02:00
world [dev] Mise à jour des news 2021-12-17 18:27:28 +01:00
.dir-locals.el Corrige la mise à jour du serveur quand on garde l'ancienne map 2019-12-29 17:11:04 +01:00
.gitignore Initial commit 2018-03-15 21:57:46 +01:00
backup.sh Réorganisation du dépôt. 2019-04-22 14:40:36 +02:00
genmap.sh [minetestmapper] Corrige emplacement du spawn dans genmap.sh 2021-11-10 12:02:33 +01:00
install.sh Rewrite of the install script 2022-05-27 14:36:02 +02:00
LICENSE Initial commit 2018-03-15 21:57:46 +01:00
minetest-dev.conf Maj news et accélération mana 2021-11-10 11:58:30 +01:00
minetest-experimental.conf Maj news et accélération mana 2021-11-10 11:58:30 +01:00
minetest-stable.conf Maj news et accélération mana 2021-11-10 11:58:30 +01:00
README.md Rewrite of the install script 2022-05-27 14:36:02 +02:00
shutdown.sh Modifie génération de carte pour utiliser leaftest 2021-08-27 23:58:10 +02:00
start.sh.example Rewrite of the install script 2022-05-27 14:36:02 +02:00
upgrade.sh Rewrite of the install script 2022-05-27 14:36:02 +02:00
worldmt-1.1.conf Réorganisation du dépôt. 2019-04-22 14:40:36 +02:00

Description

The files to install the Minetest NALC server.

Installation

Start the install.sh script and follow instructions.

Help: ./install.sh help

Requirements

  • Official Minetest server must already be installed on your GNU/Linux system. If it is not the case, please refers to the https://minetest.net website for the installation instructions.
  • You'll also need 'git', 'cmake' and 'make' programs installed.

Examples of installation

For a production server intended to be publicly available

We suppose that you have already installed Minetest server from your package manager.

The home of the 'minetest' user is located to /var/lib/minetest and you have the write access to it.

  1. Create the dir '\/var/lib/minetest/.minetest' if not exist.
  2. cd /var/lib/minetest
  3. git clone depth 1 -b master https://sys4.fr/gitea/nalc/nalc-server.git
  4. cd nalc-server
  5. ./install.sh -d \/var/lib/minetest/.minetest
  6. Follow the instructions

For a test server

We suppose you have already installed a production server that is actually in use and stable. But you want to install another one in palallel on the same system in order to test the development version of NALC.

For the next steps we will be logged in as a normal user:

  1. cd
  2. Create the dir '~/.minetest' if it not exist.
  3. No need to download the server files again because they are already downloaded in the dir /var/lib/minetest/nalc-server. So you can just do a 'mkdir ~/nalc-dev'. But you can always do a 'git clone https://sys4.fr/gitea/nalc/nalc-server.git ~/nalc-dev' if you prefer. Whatever your choice and for the next steps we will refer to the install dir as '$INSTALL'.
  4. $INSTALL/install.sh -d ~/.minetest -w test -P 30001 branch dev ~/nalc-dev
  5. Follow the instructions

Case of a custom Minetest installation

We suppose you have compiled Minetest from sources with the CMAKE option RUNINPLACE=TRUE. The location of your installation is ~/games/minetest.

  1. cd ~/games
  2. git clone https://sys4.fr/gitea/nalc/nalc-server.git
  3. cd nalc-server
  4. ./install.sh -b ~/games/minetest/bin/minetestserver -d ~/games/minetest
  5. Follow the instructions

Other cases

Other combinaisons are possibles and I cannot describe all of them. Don't hesitate to read the help of the script with help option and do your own tests :)

Add or disable mods

If you want to add mods you can do it easily. For that you can create the dir $DESTINATION/custom/mods where $DESTINATION is the dir where you have installed the server (the one containing the nalc.conf file). Then copy your mods and modpacks in $DESTINATION/custom/mods and you need to execute $INSTALL/upgrade.sh -s $DESTINATION -w -b -f worldmt for regenerating the world.mt file of your world. Replace by your world name. Replace by the branch name specified during the installation, either 'stable', 'dev' or 'exp'.

If you want to disable mods you need to edit the file $DESTINATION/modsdisabled.txt and add one mod name per line. Then execute again $INSTALL/upgrade.sh -s $DESTINATION -w -b -f worldmt.

Note: Depending on how you have installed NALC server, but $INSTALL and $DESTINATION can point to the same directory. If it's the case you can ommit the -s option.

Start/Stop the server

Use provided scripts

You can rename the $INSTALL/start.sh.example file to start.sh and give it executable permissions. Then launch the server with the command $INSTALL/start.sh -s $DESTINATION.

Note: -s option can be ommited if you launch the script from the dir $DESTINATION.

For shutting down the server press CTRL-C.

You can edit the start.sh script for your needs.

Use openrc to start/stop NALC as a daemon

We suppose minetest is installed from portage with the +server USE flag and NALC server is installed in the home of the minetest user /var/lib/minetest/nalc-server. If you would use your Gentoo/Calculate Linux system init to start/stop NALC server as a service then you can follow theses steps:

  1. Edit your /etc/conf.d/minetest-server file like that:

    # /etc/conf.d/minetest-server: config file for /etc/init.d/minetest-server
    
    # user
    USER="minetest"
    
    # group
    GROUP="minetest"
    
    # pidfile
    PIDFILE="/run/minetest-server.pid"
    
    # executable
    MINETESTBIN="/usr/bin/minetestserver"
    
    # additional arguments for the server
    ARGS="--logfile /var/log/minetest/minetest-server.log"
    
  2. Edit or create the file /etc/init.d/minetest-server:

    #!/sbin/openrc-run
    # Copyright 1999-2019 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2
    
    supervisor="supervise-daemon"
    
    description="Minetest dedicated server"
    
    depend() {
        need net postgresql-13 # Remove postgresql-13 if you don't use it as a Minetest backend.
    }
    
    start() {
        ebegin "starting Minetest server"
        ${supervisor} ${RC_SVCNAME} \
    	  --pidfile "${PIDFILE}" \
    	  --user ${USER} \
    	  --group ${GROUP} \
    	  --start "${MINETESTBIN}" -- ${ARGS}
        eend $?
    }
    
    stop() {
        ebegin "stopping Minetest server"
        ${supervisor} ${RC_SVCNAME} \
    	  --stop \
    	  --signal 15 \
    	  --pidfile "${PIDFILE}" \
    	  --user ${USER} \
    	  --group ${GROUP}
        eend $?
    }
    
  3. Add the service to your default init level: rc-update add minetest-server default.

  4. Start the service: rc-service minetest-server start.

  5. Stop the service: rc-service minetest-server stop.

TODO Use systemd to start/stop NALC as a daemon

Update the server

You can execute the install.sh script again. If a nalc.conf file is detected in the specified destination, it will load all the settings specified during the previous installation. Then you have to follow the instructions of the script and you will be able to update your server.