svn commit: r420083 - in head: . deskutils/taskd deskutils/taskd/files
Steven Kreuzer
skreuzer at FreeBSD.org
Thu Aug 11 16:06:53 UTC 2016
Author: skreuzer
Date: Thu Aug 11 16:06:51 2016
New Revision: 420083
URL: https://svnweb.freebsd.org/changeset/ports/420083
Log:
Add a rc script and have taskd run as an unprivileged user
PR: 204757
Submitted by: Ike Eichorn <ike at michaeleichorn.com>
Added:
head/deskutils/taskd/files/
head/deskutils/taskd/files/taskd.in (contents, props changed)
head/deskutils/taskd/pkg-message (contents, props changed)
head/deskutils/taskd/pkg-plist (contents, props changed)
Modified:
head/GIDs
head/UIDs
head/deskutils/taskd/Makefile
Modified: head/GIDs
==============================================================================
--- head/GIDs Thu Aug 11 15:57:37 2016 (r420082)
+++ head/GIDs Thu Aug 11 16:06:51 2016 (r420083)
@@ -557,7 +557,7 @@ freeswitch:*:610:
# free: 613
# free: 614
ntpa:*:615:
-# free: 616
+taskd:*:616:
# free: 617
# free: 618
# free: 619
Modified: head/UIDs
==============================================================================
--- head/UIDs Thu Aug 11 15:57:37 2016 (r420082)
+++ head/UIDs Thu Aug 11 16:06:51 2016 (r420083)
@@ -562,7 +562,7 @@ freeswitch:*:610:610::0:0:Freeswitch use
# free: 613
# free: 614
ntpa:*:615:615::0:0:NTPa user:/nonexistent:/usr/sbin/nologin
-# free: 616
+taskd:*:616:616::0:0:taskd user:/nonexistent:/usr/sbin/nologin
# free: 617
# free: 618
# free: 619
Modified: head/deskutils/taskd/Makefile
==============================================================================
--- head/deskutils/taskd/Makefile Thu Aug 11 15:57:37 2016 (r420082)
+++ head/deskutils/taskd/Makefile Thu Aug 11 16:06:51 2016 (r420083)
@@ -3,7 +3,7 @@
PORTNAME= taskd
PORTVERSION= 1.1.0
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= deskutils
MASTER_SITES= http://taskwarrior.org/download/
@@ -16,6 +16,19 @@ LIB_DEPENDS= libgnutls.so:security/gnutl
RUN_DEPENDS= bash:shells/bash
USES= cmake:outsource compiler:c++11-lib shebangfix
+USE_RC_SUBR= taskd
+
+USERS= taskd
+GROUPS= taskd
+
+TASKD_DBDIR?= /var/db/${PORTNAME}
+
+PLIST_SUB+= TASKD_DBDIR="${TASKD_DBDIR}" \
+ TASKD_USER="${USERS}" \
+ TASKD_GROUP="${GROUPS}"
+
+SUB_LIST+= TASKD_DBDIR="${TASKD_DBDIR}"
+
SHEBANG_FILES= demo/client/case* \
demo/client/malformed* \
demo/client/run \
@@ -33,25 +46,10 @@ SHEBANG_FILES= demo/client/case* \
CFLAGS+= -g -O0
-PLIST_FILES= bin/taskd \
- bin/taskdctl \
- man/man1/taskd.1.gz \
- man/man1/taskdctl.1.gz \
- man/man5/taskdrc.5.gz \
- share/taskd/README \
- share/taskd/generate \
- share/taskd/generate.ca \
- share/taskd/generate.client \
- share/taskd/generate.crl \
- share/taskd/generate.server \
- share/taskd/vars
-
PORTDOCS= *
post-install:
(cd ${WRKSRC}/pki && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR})
-.for s in generate generate.ca generate.client generate.crl generate.server
- ${CHMOD} 755 ${STAGEDIR}${DATADIR}/${s}
-.endfor
+ ${MKDIR} ${STAGEDIR}${TASKD_DBDIR}
.include <bsd.port.mk>
Added: head/deskutils/taskd/files/taskd.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/deskutils/taskd/files/taskd.in Thu Aug 11 16:06:51 2016 (r420083)
@@ -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"
Added: head/deskutils/taskd/pkg-message
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/deskutils/taskd/pkg-message Thu Aug 11 16:06:51 2016 (r420083)
@@ -0,0 +1,22 @@
+=======================================================================
+taskd requires user directed configuration prior to use.
+
+See taskwarrior.org/docs/taskserver/configure.html for configuration
+information. The generate script has been installed to
+/usr/local/share/taskd.
+
+After completing configuration to start taskd at system startup add
+taskd_enable="YES" to rc.conf. If you configured taskd with a TASKDDATA
+other than /var/db/taskd you will also need to set taskd_data in rc.conf
+to that path.
+
+The rc script will start taskd as the unprivileged user taskd, this
+requires that your TASKDDATA directory and /var/log/taskd.log be owned
+by taskd:taskd. If you prefer to use another user specify this in
+rc.conf using taskd_user.
+
+To add users see: taskwarrior.org/docs/taskserver/user.html
+
+To configure taskwarrior to use your taskd server see:
+taskwarrior.org/docs/taskserver/taskwarrior.html
+=======================================================================
Added: head/deskutils/taskd/pkg-plist
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/deskutils/taskd/pkg-plist Thu Aug 11 16:06:51 2016 (r420083)
@@ -0,0 +1,14 @@
+bin/taskd
+bin/taskdctl
+man/man1/taskd.1.gz
+man/man1/taskdctl.1.gz
+man/man5/taskdrc.5.gz
+share/taskd/README
+ at mode 0755
+%%DATADIR%%/generate
+%%DATADIR%%/generate.ca
+%%DATADIR%%/generate.client
+%%DATADIR%%/generate.crl
+%%DATADIR%%/generate.server
+%%DATADIR%%/vars
+ at dir(%%TASKD_USER%%,%%TASKD_GROUP%%,) %%TASKD_DBDIR%%
More information about the svn-ports-head
mailing list