wiki:Instance management

With the instance management you can create a new server instance, edit existing instances or delete them. You can also list all defined instances and show the status of a single instance.

Table of contents

  1. Creating
    1. Templates
    2. Create
  2. Printing configuration
  3. Editing
  4. Deleting
  5. Listing
  6. Start/Stop
  7. Status

Creating

Templates

Creating an instance optionally makes use of template files. Currently those are:

  • admins.xml
  • config.xml

Those have to be in a folder called templates below SDTD_BASE.

If a config.xml exists in this location the create-part of instance management will ask whether this should be used as a base for the new instance config.

If the admins.xml exists it is automatically copied over to new instances.

Create

To create a new instance enter the following command:

7dtd.sh instances create

This will first ask for a name for the new instance and afterwards opens the config.xml in your default text editor.

NOTE: Currently there are three options that are forced when instances are launched so setting them in the config has no effect:

  • TelnetEnabled: This has to true so the management scripts can access the instance. Having this open to the public internet is a security risk. See Ports
  • AdminFileName: This is set to admins.xml so it automatically uses that file in the instance folder.
  • UserDataFolder: This is set to the instance folder.

When you are done with entering all parameters save the config.xml and the instance is ready to be started.

Printing configuration

To view the current configuration settings use:

7dtd.sh instances print_config <instancename>

Alternatively print the actual XML as is, optionally with syntax highlighting if you have pygmentize installed:

7dtd.sh instances print_xml <instancename>

Editing

To edit the configuration of an instance start

7dtd.sh instances edit <instancename>

This will open the config.xml in your default text editor.

Deleting

To delete an instance enter:

7dtd.sh instances delete <instancename>

You will then be asked to enter a confirmation code so you do not accidentally delete an instance.

WARNING: This will delete every aspect of the instance:

  • Save games
  • Created RWG world (if the instance used a custom one)
  • Mods local to the instance
  • Configuration
  • Logs

Listing

To list all defined instances use:

7dtd.sh instances list

This will output a list like in the following example:

Instance name        | Running  | Players | Port 
---------------------+----------+---------+------
test                 |       no |    -/ 4 | 25252
my_first_instance    |      yes |    2/ 6 | 25000

Start/Stop

Starting and stopping instances can be done through the following two commands:

7dtd.sh start <instancename>
7dtd.sh kill <instancename>

Status

To get a more detailed information about an instance use the following command:

7dtd.sh status <instancename>

For a running instance the output will look like this:

Instance: my_first_instance

Status: Running
Open ports:
    25000 (udp)
    25001 (udp)
    25002 (udp)
    25003 (tcp)
Players: 2

Game info:
    Server name:    _
    Password:       XXXXXX
    Max players:    6
    World:          Navezgane

Network info:
    Port:           25000
    Public:         false
    Control Panel:  off
    Telnet:         Port 25003, Pass 123

If the instance is not running it will look like this:

Instance: my_first_instance

Status: Not running

Game info:
    Server name:    _
    Password:       XXXXXX
    Max players:    6
    World:          Navezgane

Network info:
    Port:           25000
    Public:         false
    Control Panel:  off
    Telnet:         Port 25003, Pass 123
Last modified 12 months ago Last modified on Nov 14, 2023, 6:27:51 PM
Note: See TracWiki for help on using the wiki.