aboutsummaryrefslogtreecommitdiffstats
path: root/deskutils/taskd/files
diff options
context:
space:
mode:
authorskreuzer <skreuzer@FreeBSD.org>2016-08-12 00:06:51 +0800
committerskreuzer <skreuzer@FreeBSD.org>2016-08-12 00:06:51 +0800
commit56b4f58723be1e16ba95616bc6e2df539c2a44a7 (patch)
treea5a8b1f62e6956aa4a1bab0c8deb26ff0ec8f764 /deskutils/taskd/files
parent220eb1799371518287c02dc053b1c871b90e1116 (diff)
downloadfreebsd-ports-gnome-56b4f58723be1e16ba95616bc6e2df539c2a44a7.tar.gz
freebsd-ports-gnome-56b4f58723be1e16ba95616bc6e2df539c2a44a7.tar.zst
freebsd-ports-gnome-56b4f58723be1e16ba95616bc6e2df539c2a44a7.zip
Add a rc script and have taskd run as an unprivileged user
PR: 204757 Submitted by: Ike Eichorn <ike@michaeleichorn.com>
Diffstat (limited to 'deskutils/taskd/files')
-rw-r--r--deskutils/taskd/files/taskd.in35
1 files changed, 35 insertions, 0 deletions
diff --git a/deskutils/taskd/files/taskd.in b/deskutils/taskd/files/taskd.in
new file mode 100644
index 000000000000..11c2403d50a1
--- /dev/null
+++ b/deskutils/taskd/files/taskd.in
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: taskd
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# taskd_enable (bool): Set to NO by default.
+# Set it to YES to enable taskd.
+# taskd_data (path): Set to %%TASKD_DBDIR%% by default.
+# Taskd data directory (TASKDDATA)
+# taskd_user (str): Set to taskd by default.
+# User to run taskd as.
+
+. /etc/rc.subr
+
+name=taskd
+rcvar=taskd_enable
+
+load_rc_config $name
+
+: ${taskd_enable="NO"}
+: ${taskd_data="%%TASKD_DBDIR%%"}
+: ${taskd_user="taskd"}
+
+command=%%PREFIX%%/bin/${name}
+pidfile=$(${command} config --data $taskd_data | awk '/pid.file/ {print $2}')
+
+command_args="server --data $taskd_data --daemon"
+
+run_rc_command "$1"