File ensure-mount-dir-exists.patch of Package kbfs

From: Matthias Bach <>
Date: 2018-11-04 21:40:00 +0100
Subject: Ensure the default KBFS mount directoy is created on service start
Upstream: never

This ensure that the default KBFS mount directory is create on service start.
Upstream does this using their `run_keybase` script which is not included in
this package.

This solution is much cleaner than upstreams. However, we cannot directly
upstream it due to the hack for Leap 15.0. In addition, upstream probably
wouldn't like the Systemd 235 requirement.

diff -rub kbfs-2.10.1o/packaging/linux/systemd/kbfs.service kbfs-2.10.1/packaging/linux/systemd/kbfs.service

--- kbfs-2.10.1o/packaging/linux/systemd/kbfs.service	2018-11-13 19:08:53.000000000 +0100
+++ kbfs-2.10.1/packaging/linux/systemd/kbfs.service	2018-11-23 20:42:55.907799624 +0100
@@ -13,6 +13,11 @@
 ExecStart=/usr/bin/kbfsfuse -debug -log-to-file
 ExecStop=-/bin/sh -c 'fusermount -uz "$(keybase config get -d -b mountdir)"'
+# Ensure the default mountdir exists
+# Work around Systemd on Leap 15.0 being to old for RuntimeDirectory with deep directories (requires Systemd 235)
+ExecStartPre=/bin/sh -c 'mkdir -p "${XDG_RUNTIME_DIR}/keybase/kbfs"'