wiki:Instance management

Version 5 (modified by Christian Illy, 10 years ago) ( diff )

--

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 ask you for all the config-parameters. Parameter queries look like this:

Server name:                    

Public server [false]:              

Drop on Death, options:
   0: Everything
   1: Toolbelt only
   2: Backpack only
   3: Delete all
Select option (0-3) [1]:            

Night percentage (10-90) [15]:      
Server name
This example shows a parameter which has no default so you have to enter a name.
Public server
Here a default value (false) is given. If you only press <ENTER> without typing anything the default will be used. Also this is a boolean value, so you can only enter yes/no/y/n/true/false.
Drop on Death
This is a enumerated value, meaning you are shown the option values and then select one of them by the appropriate number.
Night percentage
Here a valid range (10-90) is given, meaning you can not enter a value outside this range.

NOTE: Currently there are three options that are automatically set:

  • 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.
  • SaveGameFolder: This is set to the instance folder.

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

Printing configuration

To view the current configuration settings use:

7dtd.sh instances print_config <instancename>

Editing

To edit the configuration of an instance start

7dtd.sh instances edit <instancename>

You will then be shown an interface to edit the options similar to the interface when creating a new instance.

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
  • 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
Note: See TracWiki for help on using the wiki.