-
Notifications
You must be signed in to change notification settings - Fork 442
Installing on OpenBSD 7.6
OpenBSD 7.6 has ports for Radicale 1.x and 2.x but not for 3.x. Given the recent fairly active development of Radicale a port for Radicale 3.x would become outdated rapidly. As an alternative here are step-by-step instructions for installing Radicale 3.x on OpenBSD 7.6.
- These instructions only cover the OpenBSD specific issues of installing Radicale itself. You may also want to set up TLS and/or a reverse proxy, authentication, etc. Please refer to the Radicale documentation, such as https://radicale.org/v3.html or other parts of this wiki, for these aspects of setting up the service.
- At the time of writing Radicale 3.3.0 was the latest version. Other versions are untested.
- Use at your own risk.
- A fresh installation of OpenBSD 7.6 is assumed.
- The OpenBSD host needs to be able to access the Internet to install ports and to access the pip repository.
- Sufficient disk space to install Python, the virtual Python environment and Radicale is assumed. (The needed space is not excessive, so in most cases this will be a non-issue.)
- You will need access as
root
, either directly or by using doas(1) on the host. These instructions assume directroot
access as indicated by the#
prompt. A$
prompt indicates that noroot
access is required for the command. - A text editor of your choice or the capability to edit files elsewhere and transfer them to the host are also required. vi(1) and mg(1) are included in the OpenBSD base installation and other editors such as Emacs or nano are available as ports. (In theory you could get by without an editor. But that would involve complicated and tedious alternatives.) Note that text files follow the *NIX line ending convention, i.e. ending lines with a single LF (ASCII/UTF-8 0x0a, U+000a) character. The character encoding should be ASCII or UTF-8 (which are identical for anything described here).
These instructions may also work on OpenBSD 7.5 and on future versions. But this is untested.
- Add the ports for Python and pip (unless they are already installed):
# pkg_add python py3-pip
- Create a virtual Python environment to avoid mixing pkg_add(1) and pip managed code:
# python3 -m venv /usr/local/lib/radicale
- [Optional] Update pip in the virtual Python environment to silence warnings when using pip:
# /usr/local/lib/radicale/bin/pip install --upgrade pip
- Install Radicale into the virtual Python environment:
# /usr/local/lib/radicale/bin/pip install radicale
- Create a user and group for running Radicale:
# useradd -g =uid -L daemon -c 'Radicale user' -s /sbin/nologin -u 672 -d /nonexistent _radicale
Note: This is the same user and group that is installed by the Radicale 2.x port. If you feel that it is too dangerous to reuse the same name and UID/GID then feel free to use different values, but make sure you adjust the following instructions accordingly. - Create a directory for the Radicale configuration:
# mkdir /etc/radicale
- Create at least a minimal configuration file
/etc/radicale/config
to override the default storage location/var/lib/…
which doesn't exist on OpenBSD:
[storage]
filesystem_folder = /var/db/radicale/collections
Of course you will probably want to add your own configuration settings to this file as well.
- Create the storage location and set its owner/group to the user/group created above:
# install -o _radicale -g _radicale -d /var/db/radicale
- Create an rc.d(8) service script for Radicale as
/etc/rc.d/radicale3
and make it executable:
#!/bin/ksh
daemon='/usr/local/lib/radicale/bin/radicale'
daemon_user='_radicale'
daemon_logger='daemon.info'
. /etc/rc.d/rc.subr
pexp=".* ${daemon}.*"
rc_reload=NO
rc_configtest=NO
rc_bg=YES
rc_cmd $1
# chmod 755 /etc/rc.d/radicale3
- [Optional] Enable the service to start at system boot:
# rcctl enable radicale3
- Start the Radicale service:
# rcctl start radicale3
Radicale logs can be found in /var/log/daemon
. You can configure syslogd(8) to place the logs into their own log file, e.g. by following these additional steps:
- Add the following to the top of
/etc/syslogd.conf
:
!!radicale3
daemon.info /var/log/radicale
!*
- Create the log file:
# touch /var/log/radicale
- Reload the syslogd(8) configuration:
# rcctl reload syslogd
- [Optional] Set up log rotation for the Radicale log file by adding something like the following to
/etc/newsyslog.conf
:
/var/log/radicale 644 7 250 * Z
Note: The OpenBSD syslog(3) mechanism mangles UTF-8 characters outside the 7-bit ASCII range. It is unknown whether that would be an issue for Radicale?
FYI only (this is general OpenBSD knowledge, not specific to Radicale). See rcctl(8) for details.
# rcctl stop radicale3
# rcctl check radicale3
# rcctl ls started
# rcctl restart radicale3
# rcctl disable radicale3
Once installed as described above there may come a time when you want to update Radicale to the newest version.
- Stop the Radicale service:
# rcctl stop radicale3
- Update Radicale in the virtual Python environment:
# /usr/local/lib/radicale/bin/pip install --upgrade radicale
- Make any required changes to the configuration if the new version requires any changes.
- Start the Radicale service:
# rcctl start radicale3
Check which version of Radicale is installed:
$ /usr/local/lib/radicale/bin/pip show radicale