Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Jan 2007 10:35:49 +0300 (MSK)
From:      Anton Yuzhaninov <citrin@rambler-co.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/108465: [patch] databases/memcached: allow to run with negative priority (niceness)
Message-ID:  <20070128073549.D53A011427@mcgi18.rambler.ru>
Resent-Message-ID: <200701280800.l0S80arg022849@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         108465
>Category:       ports
>Synopsis:       [patch] databases/memcached: allow to run with negative priority (niceness)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 28 08:00:35 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Anton Yuzhaninov
>Release:        FreeBSD 6.1-RELEASE-p1 i386
>Organization:
Rambler
>Environment:
System: FreeBSD mcgi18.rambler.ru 6.1-RELEASE-p1 FreeBSD 6.1-RELEASE-p1 #0: Fri Jun 9 17:23:22 MSD 2006 citrin@mcgi18.rambler.ru:/usr/obj/usr/src/sys/MCGI i386
Port: memcached-1.2.0_2
>Description:

rc.d script uses var memcached_user to set -u option for memcached, but *_user variables
has special meaning in rc.subr - if $name_user is set, command
run via su(1).

It not need for memcached, because it has -u option, and this don't
allow to increase process priority.

In 6.2 nice run before su, and it possible to increase priority:
http://lists.freebsd.org/pipermail/cvs-all/2006-August/185240.html
but anyway su(1) don't need for memcached.

>How-To-Repeat:

Add to /etc/rc.conf

memcached_enable="YES"
memcached_nice="-10"

# /usr/local/etc/rc.d/memcached start
Starting memcached.
nice: setpriority: Permission denied

>Fix:

--- files/memcached.in.orig     Sun Jan 28 10:11:44 2007
+++ files/memcached.in  Sun Jan 28 10:12:12 2007
@@ -28,4 +28,6 @@
 command=%%PREFIX%%/bin/memcached
 command_args="-d -u ${memcached_user}"

+unset memcached_user
+
 run_rc_command "$1"

Another option is rename memcached_user to memcached_username, but it
break POLA.
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070128073549.D53A011427>