Add doc on running davmail as systemd service

This commit is contained in:
arnydo
2019-02-15 16:19:12 -05:00
committed by GitHub
parent a27b5a4291
commit b3d2efe0b0
+84 -1
View File
@@ -1023,6 +1023,89 @@ To check the status of the service, run:
.. code-block:: bash
journalctl -u parsedmarc.service -r
Running DavMail as a systemd service
---------------------------------------
Use systemd to run ``davmail`` as a service and process reports as they
arrive.
Create a system user
.. code-block:: bash
sudo useradd davmail -r -s /bin/false
Protect the ``davmail`` configuration file from prying eyes
.. code-block:: bash
sudo chown root:parsedmarc /opt/davmail/davmail.properties
sudo chmod u=rw,g=r,o= /opt/davmail/davmail.properties
Create the service configuration file
.. code-block:: bash
sudo nano /etc/systemd/system/davmail.service
.. code-block:: ini
[Unit]
Description=DavMail gateway service
Documentation=https://sourceforge.net/projects/davmail/
Wants=network-online.target
After=syslog.target network.target
[Service]
ExecStart=/opt/davmail/davmail /opt/davmail/davmail.properties
User=davmail
Group=davmail
Restart=always
RestartSec=5m
[Install]
WantedBy=multi-user.target
Then, enable the service
.. code-block:: bash
sudo systemctl daemon-reload
sudo systemctl enable parsedmarc.service
sudo service davmail restart
.. note::
You must also run the above commands whenever you edit
``davmail.service``.
.. warning::
Always restart the service every time you upgrade to a new version of
``davmail``:
.. code-block:: bash
sudo service davmail restart
To check the status of the service, run:
.. code-block:: bash
service davmail status
.. note::
In the event of a crash, systemd will restart the service after 10 minutes,
but the `service davmail status` command will only show the logs for the
current process. To vew the logs for previous runs as well as the
current process (newest to oldest), run:
.. code-block:: bash
journalctl -u davmail.service -r
Using the Kibana dashboards
@@ -1282,4 +1365,4 @@ Indices and tables
.. _XML files: https://github.com/domainaware/parsedmarc/tree/master/splunk
.. _LISTSERV 16.0-2017a: https://www.lsoft.com/news/dmarc-issue1-2018.asp
.. _LISTSERV 16.0-2017a: https://www.lsoft.com/news/dmarc-issue1-2018.asp