<h1>Start Stop Reload<aclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">mygame/</span></code> here), using the <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code>
program. If the <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> program is not available on the command line you must first install
Evennia as described on the <aclass="reference internal"href="Installation.html"><spanclass="doc std std-doc">Installation</span></a> page.</p>
<p>If you ever try the <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> command and get an error complaining that the command is not available, make sure your <aclass="reference internal"href="../Glossary.html#virtualenv"><spanclass="std std-doc">virtualenv</span></a> is active. On Windows you may need to to run <codeclass="docutils literal notranslate"><spanclass="pre">py</span><spanclass="pre">-m</span><spanclass="pre">evennia</span></code> once first.</p>
<p>Evennia consists of two components, the Evennia <aclass="reference internal"href="../Components/Portal-And-Server.html"><spanclass="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 game.</p>
<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 <codeclass="docutils literal notranslate"><spanclass="pre">mygame/server/logs/</span></code>. For convenience you can follow those logs directly in your terminal by attaching <codeclass="docutils literal notranslate"><spanclass="pre">-l</span></code> to commands:</p>
<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” <aclass="reference internal"href="../Components/Scripts.html"><spanclass="doc std std-doc">Scripts</span></a>. It also calls <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">reload</span></code> command is used. You can also reload the server from outside the game:</p>
<p>From inside the game you initiate a shutdown with the <codeclass="docutils literal notranslate"><spanclass="pre">shutdown</span></code> command. From command line you do</p>
<p>will start/restart the <em>Server</em> in interactive mode. This is required if you want to run a
<aclass="reference internal"href="../Coding/Debugging.html"><spanclass="doc std std-doc">debugger</span></a>. Next time you <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span><spanclass="pre">reload</span></code> the server, it will return to normal mode.</p>
<p>If you do <codeclass="docutils literal notranslate"><spanclass="pre">Ctrl-C</span></code>/<codeclass="docutils literal notranslate"><spanclass="pre">Cmd-C</span></code> in foreground mode, the component will stop. You’ll need to run <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span><spanclass="pre">start</span></code> to get the game going again.</p>
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 <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">reset</span></code> command is used. From the terminal:</p>
<p>Note that this functionality is not supported on Windows.</p>
</section>
<sectionid="django-options">
<h2>Django options<aclass="headerlink"href="#django-options"title="Permalink to this headline">¶</a></h2>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> program will also pass-through options used by the <codeclass="docutils literal notranslate"><spanclass="pre">django-admin</span></code>. These operate on the database in various ways.</p>
<divclass="highlight-bash notranslate"><divclass="highlight"><pre><span></span> evennia migrate <spanclass="c1"># migrate the database</span>
evennia shell <spanclass="c1"># launch an interactive, django-aware python shell</span>
evennia dbshell <spanclass="c1"># launch the database shell</span>
</pre></div>
</div>
<p>For (many) more options, see <aclass="reference external"href="https://docs.djangoproject.com/en/1.7/ref/django-admin/#usage">the django-admin docs</a>.</p>
<h2>Advanced handling of Evennia processes<aclass="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’<codeclass="docutils literal notranslate"><spanclass="pre">top</span></code> or the more advanced <codeclass="docutils literal notranslate"><spanclass="pre">htop</span></code>), you will find the following processes to be
related to Evennia:</p>
<ulclass="simple">
<li><p>1 x <codeclass="docutils literal notranslate"><spanclass="pre">twistd</span><spanclass="pre">...</span><spanclass="pre">evennia/server/portal/portal.py</span></code> - this is the Portal process.</p></li>
<li><p>3 x <codeclass="docutils literal notranslate"><spanclass="pre">twistd</span><spanclass="pre">...</span><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">mygame/server/server.pid</span></code> to determine which is the main process.</p></li>
<h3>Syntax errors during live development<aclass="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