summaryrefslogtreecommitdiff
path: root/www-apps/radicale/files
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/radicale/files')
-rw-r--r--www-apps/radicale/files/radicale-r2.init.d27
-rw-r--r--www-apps/radicale/files/radicale.service25
2 files changed, 52 insertions, 0 deletions
diff --git a/www-apps/radicale/files/radicale-r2.init.d b/www-apps/radicale/files/radicale-r2.init.d
new file mode 100644
index 000000000000..00f85d29e0e5
--- /dev/null
+++ b/www-apps/radicale/files/radicale-r2.init.d
@@ -0,0 +1,27 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+PIDFILE=/run/radicale.pid
+
+depend() {
+ need localmount
+}
+
+start() {
+ ebegin "Starting radicale"
+ start-stop-daemon --start --quiet --background \
+ --user radicale \
+ --umask 0027 \
+ --stderr-logger /usr/bin/logger \
+ --pidfile ${PIDFILE} --make-pidfile \
+ --exec /usr/bin/radicale -- --foreground
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping radicale"
+ start-stop-daemon --stop --quiet \
+ --pidfile ${PIDFILE}
+ eend $?
+}
diff --git a/www-apps/radicale/files/radicale.service b/www-apps/radicale/files/radicale.service
new file mode 100644
index 000000000000..ffafba8d3ae7
--- /dev/null
+++ b/www-apps/radicale/files/radicale.service
@@ -0,0 +1,25 @@
+## this is heavily inspired by https://radicale.org/setup/
+
+[Unit]
+Description=A simple CalDAV (calendar) and CardDAV (contact) server
+After=network.target
+Requires=network.target
+
+[Service]
+ExecStart=/usr/bin/radicale
+Restart=on-failure
+User=radicale
+# Deny other users access to the calendar data
+UMask=0027
+PrivateTmp=true
+ProtectSystem=strict
+ProtectHome=true
+PrivateDevices=true
+ProtectKernelTunables=true
+ProtectKernelModules=true
+ProtectControlGroups=true
+NoNewPrivileges=true
+StateDirectory=radicale
+
+[Install]
+WantedBy=multi-user.target