mirror of
https://github.com/evennia/evennia.git
synced 2026-03-18 13:56:30 +01:00
328 lines
No EOL
20 KiB
HTML
328 lines
No EOL
20 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
||
|
||
<title>Start Stop Reload — Evennia 1.0-dev documentation</title>
|
||
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
|
||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||
<script src="../_static/jquery.js"></script>
|
||
<script src="../_static/underscore.js"></script>
|
||
<script src="../_static/doctools.js"></script>
|
||
<script src="../_static/language_data.js"></script>
|
||
<link rel="shortcut icon" href="../_static/favicon.ico"/>
|
||
<link rel="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Search" href="../search.html" />
|
||
<link rel="next" title="Game Settings and Configuration direcotry" href="Settings.html" />
|
||
<link rel="prev" title="Non-interactive setup" href="Installation-Non-Interactive.html" />
|
||
</head><body>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="General Index"
|
||
accesskey="I">index</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="Settings.html" title="Game Settings and Configuration direcotry"
|
||
accesskey="N">next</a> |</li>
|
||
<li class="right" >
|
||
<a href="Installation-Non-Interactive.html" title="Non-interactive setup"
|
||
accesskey="P">previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="Setup-Overview.html" accesskey="U">Server Setup and Life</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">Start Stop Reload</a></li>
|
||
</ul>
|
||
<div class="develop">develop branch</div>
|
||
</div>
|
||
|
||
<div class="document">
|
||
|
||
<div class="documentwrapper">
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<p class="logo"><a href="../index.html">
|
||
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
|
||
</a></p>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3 id="searchlabel">Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="../search.html" method="get">
|
||
<input type="text" name="q" aria-labelledby="searchlabel" />
|
||
<input type="submit" value="Go" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script>$('#searchbox').show(0);</script>
|
||
<h3><a href="../index.html">Table of Contents</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">Start Stop Reload</a><ul>
|
||
<li><a class="reference internal" href="#starting-evennia">Starting Evennia</a></li>
|
||
<li><a class="reference internal" href="#reloading">Reloading</a></li>
|
||
<li><a class="reference internal" href="#stopping">Stopping</a></li>
|
||
<li><a class="reference internal" href="#foreground-mode">Foreground mode</a></li>
|
||
<li><a class="reference internal" href="#resetting">Resetting</a></li>
|
||
<li><a class="reference internal" href="#rebooting">Rebooting</a></li>
|
||
<li><a class="reference internal" href="#status-and-info">Status and info</a></li>
|
||
<li><a class="reference internal" href="#killing-linux-mac-only">Killing (Linux/Mac only)</a></li>
|
||
<li><a class="reference internal" href="#django-options">Django options</a></li>
|
||
<li><a class="reference internal" href="#advanced-handling-of-evennia-processes">Advanced handling of Evennia processes</a><ul>
|
||
<li><a class="reference internal" href="#syntax-errors-during-live-development">Syntax errors during live development</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<h4>Previous topic</h4>
|
||
<p class="topless"><a href="Installation-Non-Interactive.html"
|
||
title="previous chapter">Non-interactive setup</a></p>
|
||
<h4>Next topic</h4>
|
||
<p class="topless"><a href="Settings.html"
|
||
title="next chapter">Game Settings and Configuration direcotry</a></p>
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../_sources/Setup/Start-Stop-Reload.md.txt"
|
||
rel="nofollow">Show Page Source</a></li>
|
||
</ul>
|
||
</div><h3>Links</h3>
|
||
<ul>
|
||
<li><a href="https://www.evennia.com">Home page</a> </li>
|
||
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
|
||
<li><a href="http://games.evennia.com">Game Index</a> </li>
|
||
<li>
|
||
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
|
||
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
|
||
<a href="https://evennia.blogspot.com/">Blog</a>
|
||
</li>
|
||
</ul>
|
||
<h3>Versions</h3>
|
||
<ul>
|
||
<li><a href="Start-Stop-Reload.html">1.0-dev (develop branch)</a></li>
|
||
<ul>
|
||
<li><a href="../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<section class="tex2jax_ignore mathjax_ignore" id="start-stop-reload">
|
||
<h1>Start Stop Reload<a class="headerlink" href="#start-stop-reload" title="Permalink to this headline">¶</a></h1>
|
||
<p>You control Evennia from your game folder (we refer to it as <code class="docutils literal notranslate"><span class="pre">mygame/</span></code> here), using the <code class="docutils literal notranslate"><span class="pre">evennia</span></code>
|
||
program. If the <code class="docutils literal notranslate"><span class="pre">evennia</span></code> program is not available on the command line you must first install
|
||
Evennia as described on the <a class="reference internal" href="Installation.html"><span class="doc std std-doc">Installation</span></a> page.</p>
|
||
<aside class="sidebar">
|
||
<p class="sidebar-title">evennia not found?</p>
|
||
<p>If you ever try the <code class="docutils literal notranslate"><span class="pre">evennia</span></code> command and get an error complaining that the command is not available, make sure your <a class="reference internal" href="../Glossary.html#virtualenv"><span class="std std-doc">virtualenv</span></a> is active.</p>
|
||
</aside>
|
||
<p>Below are described the various management options. Run</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia -h
|
||
</pre></div>
|
||
</div>
|
||
<p>to give you a brief help and</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia menu
|
||
</pre></div>
|
||
</div>
|
||
<p>to give you a menu with options.</p>
|
||
<section id="starting-evennia">
|
||
<h2>Starting Evennia<a class="headerlink" href="#starting-evennia" title="Permalink to this headline">¶</a></h2>
|
||
<p>Evennia consists of two components, the Evennia <a class="reference internal" href="../Components/Portal-And-Server.html"><span class="doc std std-doc">Portal and Server</span></a>. Briefly,
|
||
the <em>Server</em> is what is running the mud. It handles all game-specific things but doesn’t care
|
||
exactly how players connect, only that they have. The <em>Portal</em> is a gateway to which players
|
||
connect. It knows everything about telnet, ssh, webclient protocols etc but very little about the
|
||
game. Both are required for a functioning mud.</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> evennia start
|
||
</pre></div>
|
||
</div>
|
||
<p>The above command will start the Portal, which in turn will boot up the Server. The command will print a summary of the process and unless there is an error you will see no further output. Both components will instead log to log files in <code class="docutils literal notranslate"><span class="pre">mygame/server/logs/</span></code>. For convenience you can follow those logs directly in your terminal by attaching <code class="docutils literal notranslate"><span class="pre">-l</span></code> to commands:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> evennia -l
|
||
</pre></div>
|
||
</div>
|
||
<p>Will start following the logs of an already running server. When starting Evennia you can also do</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> evennia start -l
|
||
</pre></div>
|
||
</div>
|
||
<blockquote>
|
||
<div><p>To stop viewing the log files, press <code class="docutils literal notranslate"><span class="pre">Ctrl-C</span></code>.</p>
|
||
</div></blockquote>
|
||
</section>
|
||
<section id="reloading">
|
||
<h2>Reloading<a class="headerlink" href="#reloading" title="Permalink to this headline">¶</a></h2>
|
||
<p>The act of <em>reloading</em> means the Portal will tell the Server to shut down and then boot it back up
|
||
again. Everyone will get a message and the game will be briefly paused for all accounts as the
|
||
server
|
||
reboots. Since they are connected to the <em>Portal</em>, their connections are not lost.</p>
|
||
<p>Reloading is as close to a “warm reboot” you can get. It reinitializes all code of Evennia, but
|
||
doesn’t kill “persistent” <a class="reference internal" href="../Components/Scripts.html"><span class="doc std std-doc">Scripts</span></a>. It also calls <code class="docutils literal notranslate"><span class="pre">at_server_reload()</span></code> hooks on all
|
||
objects so you
|
||
can save eventual temporary properties you want.</p>
|
||
<p>From in-game the <code class="docutils literal notranslate"><span class="pre">@reload</span></code> command is used. You can also reload the server from outside the game:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> evennia reload
|
||
</pre></div>
|
||
</div>
|
||
<p>Sometimes reloading from “the outside” is necessary in case you have added some sort of bug that
|
||
blocks in-game input.</p>
|
||
</section>
|
||
<section id="stopping">
|
||
<h2>Stopping<a class="headerlink" href="#stopping" title="Permalink to this headline">¶</a></h2>
|
||
<p>A full shutdown closes Evennia completely, both Server and Portal. All accounts will be booted and
|
||
systems saved and turned off cleanly.</p>
|
||
<p>From inside the game you initiate a shutdown with the <code class="docutils literal notranslate"><span class="pre">@shutdown</span></code> command. From command line you do</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> evennia stop
|
||
</pre></div>
|
||
</div>
|
||
<p>You will see messages of both Server and Portal closing down. All accounts will see the shutdown
|
||
message and then be disconnected. The same effect happens if you press <code class="docutils literal notranslate"><span class="pre">Ctrl+C</span></code> while the server
|
||
runs in interactive mode.</p>
|
||
</section>
|
||
<section id="foreground-mode">
|
||
<h2>Foreground mode<a class="headerlink" href="#foreground-mode" title="Permalink to this headline">¶</a></h2>
|
||
<p>Normally, Evennia runs as a ‘daemon’, in the background. If you want you can start either of the
|
||
processes (but not both) as foreground processes in <em>interactive</em> mode. This means they will log
|
||
directly to the terminal (rather than to log files that we then echo to the terminal) and you can
|
||
kill the process (not just the log-file view) with <code class="docutils literal notranslate"><span class="pre">Ctrl-C</span></code>.</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia istart
|
||
</pre></div>
|
||
</div>
|
||
<p>will start/restart the <em>Server</em> in interactive mode. This is required if you want to run a
|
||
<a class="reference internal" href="../Coding/Debugging.html"><span class="doc std std-doc">debugger</span></a>. Next time you <code class="docutils literal notranslate"><span class="pre">evennia</span> <span class="pre">reload</span></code> the server, it will return to normal mode.</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia ipstart
|
||
</pre></div>
|
||
</div>
|
||
<p>will start the <em>Portal</em> in interactive mode.</p>
|
||
</section>
|
||
<section id="resetting">
|
||
<h2>Resetting<a class="headerlink" href="#resetting" title="Permalink to this headline">¶</a></h2>
|
||
<p><em>Resetting</em> is the equivalent of a “cold reboot” - the Server will shut down and then restarted
|
||
again, but will behave as if it was fully shut down. As opposed to a “real” shutdown, no accounts
|
||
will be disconnected during a
|
||
reset. A reset will however purge all non-persistent scripts and will call <code class="docutils literal notranslate"><span class="pre">at_server_shutdown()</span></code>
|
||
hooks. It can be a good way to clean unsafe scripts during development, for example.</p>
|
||
<p>From in-game the <code class="docutils literal notranslate"><span class="pre">@reset</span></code> command is used. From the terminal:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia reset
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="rebooting">
|
||
<h2>Rebooting<a class="headerlink" href="#rebooting" title="Permalink to this headline">¶</a></h2>
|
||
<p>This will shut down <em>both</em> Server and Portal, which means all connected players will lose their
|
||
connection. It can only be initiated from the terminal:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia reboot
|
||
</pre></div>
|
||
</div>
|
||
<p>This is identical to doing these two commands:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span> evennia stop
|
||
evennia start
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="status-and-info">
|
||
<h2>Status and info<a class="headerlink" href="#status-and-info" title="Permalink to this headline">¶</a></h2>
|
||
<p>To check basic Evennia settings, such as which ports and services are active, this will repeat the
|
||
initial return given when starting the server:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia info
|
||
</pre></div>
|
||
</div>
|
||
<p>You can also get a briefer run-status from both components with this command</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia status
|
||
</pre></div>
|
||
</div>
|
||
<p>This can be useful for automating checks to make sure the game is running and is responding.</p>
|
||
</section>
|
||
<section id="killing-linux-mac-only">
|
||
<h2>Killing (Linux/Mac only)<a class="headerlink" href="#killing-linux-mac-only" title="Permalink to this headline">¶</a></h2>
|
||
<p>In the extreme case that neither of the server processes locks up and does not respond to commands,
|
||
<span class="xref myst"></span>you can send them kill-signals to force them to shut down. To kill only the Server:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia skill
|
||
</pre></div>
|
||
</div>
|
||
<p>To kill both Server and Portal:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia kill
|
||
</pre></div>
|
||
</div>
|
||
<p>Note that this functionality is not supported on Windows.</p>
|
||
</section>
|
||
<section id="django-options">
|
||
<h2>Django options<a class="headerlink" href="#django-options" title="Permalink to this headline">¶</a></h2>
|
||
<p>The <code class="docutils literal notranslate"><span class="pre">evennia</span></code> program will also pass-through options used by the <code class="docutils literal notranslate"><span class="pre">django-admin</span></code>. These operate on the database in various ways.</p>
|
||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span> evennia migrate <span class="c1"># migrate the database</span>
|
||
evennia shell <span class="c1"># launch an interactive, django-aware python shell</span>
|
||
evennia dbshell <span class="c1"># launch the database shell</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>For (many) more options, see <a class="reference external" href="https://docs.djangoproject.com/en/1.7/ref/django-admin/#usage">the django-admin docs</a>.</p>
|
||
</section>
|
||
<section id="advanced-handling-of-evennia-processes">
|
||
<h2>Advanced handling of Evennia processes<a class="headerlink" href="#advanced-handling-of-evennia-processes" title="Permalink to this headline">¶</a></h2>
|
||
<p>If you should need to manually manage Evennia’s processors (or view them in a task manager program
|
||
such as Linux’ <code class="docutils literal notranslate"><span class="pre">top</span></code> or the more advanced <code class="docutils literal notranslate"><span class="pre">htop</span></code>), you will find the following processes to be
|
||
related to Evennia:</p>
|
||
<ul class="simple">
|
||
<li><p>1 x <code class="docutils literal notranslate"><span class="pre">twistd</span> <span class="pre">...</span> <span class="pre">evennia/server/portal/portal.py</span></code> - this is the Portal process.</p></li>
|
||
<li><p>3 x <code class="docutils literal notranslate"><span class="pre">twistd</span> <span class="pre">...</span> <span class="pre">server.py</span></code> - One of these processes manages Evennia’s Server component, the main game. The other processes (with the same name but different process id) handle’s Evennia’s internal web server threads. You can look at <code class="docutils literal notranslate"><span class="pre">mygame/server/server.pid</span></code> to determine which is the main process.</p></li>
|
||
</ul>
|
||
<section id="syntax-errors-during-live-development">
|
||
<h3>Syntax errors during live development<a class="headerlink" href="#syntax-errors-during-live-development" title="Permalink to this headline">¶</a></h3>
|
||
<p>During development, you will usually modify code and then reload the server to see your changes.
|
||
This is done by Evennia re-importing your custom modules from disk. Usually bugs in a module will
|
||
just have you see a traceback in the game, in the log or on the command line. For some really
|
||
serious syntax errors though, your module might not even be recognized as valid Python. Evennia may
|
||
then fail to restart correctly.</p>
|
||
<p>From inside the game you see a text about the Server restarting followed by an ever growing list of
|
||
“…”. Usually this only lasts a very short time (up to a few seconds). If it seems to go on, it
|
||
means the Portal is still running (you are still connected to the game) but the Server-component of
|
||
Evennia failed to restart (that is, it remains in a shut-down state). Look at your log files or
|
||
terminal to see what the problem is - you will usually see a clear traceback showing what went
|
||
wrong.</p>
|
||
<p>Fix your bug then run</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>evennia start
|
||
</pre></div>
|
||
</div>
|
||
<p>Assuming the bug was fixed, this will start the Server manually (while not restarting the Portal).
|
||
In-game you should now get the message that the Server has successfully restarted.</p>
|
||
</section>
|
||
</section>
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="General Index"
|
||
>index</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="Settings.html" title="Game Settings and Configuration direcotry"
|
||
>next</a> |</li>
|
||
<li class="right" >
|
||
<a href="Installation-Non-Interactive.html" title="Non-interactive setup"
|
||
>previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="Setup-Overview.html" >Server Setup and Life</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">Start Stop Reload</a></li>
|
||
</ul>
|
||
<div class="develop">develop branch</div>
|
||
</div>
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2022, The Evennia developer community.
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
|
||
</div>
|
||
</body>
|
||
</html> |