Skip to content

Commit

Permalink
Merge branch 'master' into DTMLMethod-content-conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
dwt committed May 9, 2019
2 parents ffab872 + 9bfad48 commit 3bdf537
Showing 1 changed file with 84 additions and 4 deletions.
88 changes: 84 additions & 4 deletions docs/operation.rst
Expand Up @@ -116,7 +116,7 @@ In order to enable debug mode, you can add the additional ``-d`` or

.. code-block:: console
$ bin/runwsgi -v etc/zope.ini -d
$ bin/runwsgi -dv etc/zope.ini
Starting server in PID 55111.
serving on http://127.0.0.1:8080
Expand All @@ -130,9 +130,48 @@ Now you are able to log in using a browser, as described in

Running Zope as a Daemon
~~~~~~~~~~~~~~~~~~~~~~~~
Zope has no built-in support for running as a daemon any more. You can
use projects like supervisord to achieve this or use your operating
system's built-in process manager.
Zope itself has no built-in support for running as a daemon any more.

If you create your Zope instance using ``plone.recipe.zope2instance`` you can
use its start/stop script to daemonize Zope. See the next section for how to do
that.

Alternatively, you can use projects like supervisord to achieve this or use
your operating system's built-in process manager, like ``systemd`` on most
Linux versions. As an example, the following ``systemd`` service configuration
works with the ``runwsgi`` script. It assumes your buildout is located at
``/opt/zopeinstance`` and the user account your Zope instance runs under is
``zope``:

.. code-block:: cfg
[Unit]
Description=Zope client zopeinstance
After=network.target
[Service]
Type=simple
User=zope
ExecStart=/opt/zopeinstance/bin/runwsgi /opt/zopeinstance/etc/zope.ini
KillMode=control-group
TimeoutStartSec=10
TimeoutStopSec=10
[Install]
WantedBy=multi-user.target
Save this configuration under ``/etc/systemd/system/zopeinstance.service`` and
execute ``systemctl daemon-reload`` for ``systemd`` to read it. After that you
can use standard ``systemctl`` commands to start, restart or stop the Zope
instance:

.. code-block:: console
[root@server]# systemctl start zopeinstance
[root@server]# systemctl restart zopeinstance
[root@server]# systemctl status zopeinstance
[root@server]# systemctl stop zopeinstance
...
Debugging Zope
Expand Down Expand Up @@ -219,6 +258,47 @@ Here's how to get status information and how to stop the Zope instance:
daemon process stopped
To have your instance start automatically upon reboot, you will need to
integrate with your operating system's service startup facility. As an example,
the following ``systemd`` service configuration works with the start/stop
script generated by ``plone.recipe.zope2instance``. It assumes the script name
is ``zopeinstance``, your buildout is located at ``/opt/zopeinstance`` and the
user account your Zope instance runs under is ``zope``:

.. code-block:: cfg
[Unit]
Description=Zope client zopeinstance
After=network.target
[Service]
Type=forking
User=zope
ExecStart=/opt/zopeinstance/bin/zopeinstance start
PIDFile=/opt/zopeinstance/var/zopeinstance/Z4.pid
ExecStop=/opt/zopeinstance/bin/zopeinstance stop
ExecReload=/opt/zopeinstance/bin/zopeinstance stop && /opt/zopeinstance/bin/zopeinstance start
KillMode=control-group
TimeoutStartSec=10
TimeoutStopSec=10
[Install]
WantedBy=multi-user.target
Save this configuration under ``/etc/systemd/system/zopeinstance.service`` and
execute ``systemctl daemon-reload`` for ``systemd`` to read it. After that you
can use standard ``systemctl`` commands to start, restart or stop the Zope
instance:

.. code-block:: console
[root@server]# systemctl start zopeinstance
[root@server]# systemctl restart zopeinstance
[root@server]# systemctl status zopeinstance
[root@server]# systemctl stop zopeinstance
...
Debugging Zope
~~~~~~~~~~~~~~
Debugging can be done at the command line:
Expand Down

0 comments on commit 3bdf537

Please sign in to comment.