Skip to content

Commit

Permalink
Merge branch 'master' into revise-section-exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
jugmac00 committed May 8, 2019
2 parents 2aaf967 + 9bfad48 commit 894df2a
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 19 deletions.
21 changes: 6 additions & 15 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
include *.txt
include *.py
include *.rst

include *.cfg
exclude pyvenv.cfg
include *.txt
include buildout.cfg
include sources.cfg
include versions-prod.cfg
include versions.cfg

include *.yml
exclude *.yml

exclude .*.cfg

include .editorconfig
exclude .editorconfig

Expand All @@ -17,9 +17,6 @@ exclude .gitignore

exclude MANIFEST.in

prune docs/.build
prune docs/_build

recursive-include docs *.bat
recursive-include docs *.css
recursive-include docs *.jpg
Expand Down Expand Up @@ -55,9 +52,3 @@ recursive-include src *.woff2
recursive-include src *.xml
recursive-include src *.zcml
recursive-include src *.zpt

include *.py
include buildout.cfg
include sources.cfg
include versions-prod.cfg
include versions.cfg
88 changes: 84 additions & 4 deletions docs/operation.rst
Original file line number Diff line number Diff line change
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 894df2a

Please sign in to comment.