From e1a5de37e48391d0ea7c08892f490cb48f9aedc1 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Sun, 26 Sep 2021 15:54:20 +0200 Subject: [PATCH 1/2] add systemd deployment guide --- docs/ocis/deployment/systemd.md | 69 +++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 docs/ocis/deployment/systemd.md diff --git a/docs/ocis/deployment/systemd.md b/docs/ocis/deployment/systemd.md new file mode 100644 index 0000000000..32ce12fe40 --- /dev/null +++ b/docs/ocis/deployment/systemd.md @@ -0,0 +1,69 @@ +--- +title: "Systemd service" +date: 2020-02-27T20:35:00+01:00 +weight: 16 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs/ocis/deployment +geekdocFilePath: systemd.md +--- + +{{< toc >}} + +## Install the oCIS binary +Download the oCIS binary of your preferred version and for your CPU architecture and operating system from [download.owncloud.com](https://download.owncloud.com/ocis/ocis). + +Rename the downloaded binary to `ocis` and move it to `/usr/bin/`. As a next step, you need to mark it as executable with `chmod +x /usr/bin/ocis`. + +When you now run `ocis help` on your command line, you should see the available options for the oCIS command. + + +## Systemd service definition + +Create the Systemd service definition for oCIS in the file `/etc/systemd/system/ocis.service` with following content: +``` +[Unit] +Description=OCIS server +After=syslog.target + +[Service] +Type=simple +User=root +Group=root +EnvironmentFile=/etc/ocis/ocis.env +ExecStart=ocis server +Restart=always + +[Install] +WantedBy=multi-user.target +``` + +For reasons of simplicity we are using the root user and group to run oCIS which is not recommended. Please use a non-root user in production environments and modify the oCIS service definition accordingly. + + +In the service definition we referenced `/etc/ocis/ocis.env` as our file containing environment variables for the oCIS process. +In order to create the file we need first to create the folder `/etc/ocis/` and than we can add the actual `/etc/ocis/ocis.env` with following content: + +``` +OCIS_URL=https://some-hostname-or-ip:9200 +PROXY_HTTP_ADDR=0.0.0.0:9200 + +OCIS_LOG_LEVEL=error + +GLAUTH_LDAPS_CERT=/etc/ocis/ldap/ldaps.crt +GLAUTH_LDAPS_KEY=/etc/ocis/ldap/ldaps.key +IDP_TRANSPORT_TLS_CERT=/etc/ocis/idp/server.crt +IDP_TRANSPORT_TLS_KEY=/etc/ocis/idp/server.key +PROXY_TRANSPORT_TLS_CERT=/etc/ocis/proxy/server.crt +PROXY_TRANSPORT_TLS_KEY=/etc/ocis/proxy/server.key +``` + +Please change your `OCIS_URL` in order to reflect your actual deployment. + + +## Starting the oCIS service + +You can enable oCIS now by running `systemctl enable --now ocis`. It will ensure that oCIS also is restarted after a reboot of the host. + +If you need to restart oCIS because of configuration changes in `/etc/ocis/ocis.env`, run `systemctl restart ocis`. + +You can have a look at the logs of oCIS by issuing `journalctl -f -u ocis`. From f4e6414d07824b3a6e782ee82e752b2af64b769c Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Mon, 27 Sep 2021 09:55:05 +0200 Subject: [PATCH 2/2] remove syslog target --- docs/ocis/deployment/systemd.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/ocis/deployment/systemd.md b/docs/ocis/deployment/systemd.md index 32ce12fe40..716e690efa 100644 --- a/docs/ocis/deployment/systemd.md +++ b/docs/ocis/deployment/systemd.md @@ -1,6 +1,6 @@ --- title: "Systemd service" -date: 2020-02-27T20:35:00+01:00 +date: 2020-09-27T06:00:00+01:00 weight: 16 geekdocRepo: https://github.com/owncloud/ocis geekdocEditPath: edit/master/docs/ocis/deployment @@ -23,7 +23,6 @@ Create the Systemd service definition for oCIS in the file `/etc/systemd/system/ ``` [Unit] Description=OCIS server -After=syslog.target [Service] Type=simple