summaryrefslogtreecommitdiff
path: root/databases/memcached
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2018-01-19 14:32:16 +0000
committerMark Felder <feld@FreeBSD.org>2018-01-19 14:32:16 +0000
commitc904c1df8aafb66986d79a7e506291da72858ba4 (patch)
tree4c40d135f5882b7a9f5425c43600f84daaea4ab7 /databases/memcached
parentd144b4e849dfe60abc7bd53332b2818aa844c06c (diff)
downloadfreebsd-ports-c904c1df8aafb66986d79a7e506291da72858ba4.zip
databases/memcached: Fix user/group handling for running process
You can now set memcached_user and memcached_group in rc.conf and get expected results of running process and socket ownership. MFH: 2018Q1 Differential Revision: https://reviews.freebsd.org/D13967
Diffstat (limited to 'databases/memcached')
-rw-r--r--databases/memcached/Makefile1
-rw-r--r--databases/memcached/files/memcached.in7
2 files changed, 6 insertions, 2 deletions
diff --git a/databases/memcached/Makefile b/databases/memcached/Makefile
index 2656451cf3a3..14336526b0e4 100644
--- a/databases/memcached/Makefile
+++ b/databases/memcached/Makefile
@@ -3,6 +3,7 @@
PORTNAME= memcached
PORTVERSION= 1.5.4
+PORTREVISION= 1
CATEGORIES= databases
MASTER_SITES= http://www.memcached.org/files/ \
GENTOO
diff --git a/databases/memcached/files/memcached.in b/databases/memcached/files/memcached.in
index 26a74681bd42..667363ca0ef3 100644
--- a/databases/memcached/files/memcached.in
+++ b/databases/memcached/files/memcached.in
@@ -14,6 +14,8 @@
# Default is empty "".
# memcached_user (user): Set user to run memcached.
# Default is "nobody".
+# memcached_group (group): Set group to run memcached.
+# Default is "nobody".
# memcached_profiles (str): Set to "" by default.
# Define your profiles here.
# memcached_post_start (str): Set extra commands that should be executed after memcached was successfully
@@ -30,6 +32,7 @@ pidfile="${_piddir}/memcached.pid"
: ${memcached_enable="NO"}
: ${memcached_user="nobody"}
+: ${memcached_group="nobody"}
load_rc_config ${name}
@@ -39,6 +42,7 @@ if [ -n "$2" ]; then
pidfile="${_piddir}/memcached.${profile}.pid"
eval memcached_enable="\${memcached_${profile}_enable:-${memcached_enable}}"
eval memcached_user="\${memcached_${profile}_user:-${memcached_user}}"
+ eval memcached_group="\${memcached_${profile}_group:-${memcached_group}}"
eval memcached_flags="\${memcached_${profile}_flags:-${memcached_flags}}"
eval memcached_post_start="\${memcached_${profile}_post_start:-${memcached_post_start}}"
else
@@ -103,9 +107,8 @@ memcached_poststop()
}
command=%%PREFIX%%/bin/memcached
-command_args="-d -u ${memcached_user} -P ${pidfile} "
+command_args="-d -P ${pidfile} "
-memcached_group=`id -gn $memcached_user`
start_precmd="install -d -o $memcached_user -g $memcached_group -m 755 $_piddir"
start_postcmd="${name}_poststart"
stop_postcmd="${name}_poststop"