[memcached] Add fixes for /var/run running on tmpfs, fixes bugzilla 656621
Paul Lindner
plindner at fedoraproject.org
Sun Nov 28 12:27:59 UTC 2010
commit f95f6cb173dd149e3cb18bfce04df23982e9482b
Author: Paul Lindner <lindner at inuus.com>
Date: Sun Nov 28 04:26:19 2010 -0800
Add fixes for /var/run running on tmpfs, fixes bugzilla 656621
memcached.spec | 7 +++++--
memcached.sysv | 10 +++++++---
2 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/memcached.spec b/memcached.spec
index 9a0c45e..fd5eed6 100644
--- a/memcached.spec
+++ b/memcached.spec
@@ -3,7 +3,7 @@
Name: memcached
Version: 1.4.5
-Release: 3%{?dist}
+Release: 4%{?dist}
Epoch: 0
Summary: High Performance, Distributed Memory Object Cache
@@ -135,7 +135,7 @@ exit 0
%doc AUTHORS ChangeLog COPYING NEWS README doc/CONTRIBUTORS doc/*.txt
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
-%dir %attr(755,%{username},%{groupname}) %{_localstatedir}/run/memcached
+%ghost %dir %attr(755,%{username},%{groupname}) %{_localstatedir}/run/memcached
%{_bindir}/memcached-tool
%{_bindir}/memcached
%{_mandir}/man1/memcached.1*
@@ -147,6 +147,9 @@ exit 0
%{_includedir}/memcached/*
%changelog
+* Sun Nov 28 2010 Paul Lindner <lindner at mirth.inuus.com> - 0:1.4.5-4
+- Add code to deal with /var/run/memcached on tmpfs
+
* Wed Sep 8 2010 Paul Lindner <lindner at inuus.com> - 0:1.4.5-3
- Apply patch from memcached issue #60, solves Bugzilla 631051
diff --git a/memcached.sysv b/memcached.sysv
index 62ac51f..19e5a12 100755
--- a/memcached.sysv
+++ b/memcached.sysv
@@ -37,9 +37,13 @@ lockfile=${LOCKFILE-/var/lock/subsys/memcached}
start () {
echo -n $"Starting $prog: "
- # Ensure that /var/run/memcached has proper permissions
- if [ "`stat -c %U /var/run/memcached`" != "$USER" ]; then
- chown $USER /var/run/memcached
+ # Ensure that $pidfile directory has proper permissions and exists
+ piddir=`dirname $pidfile`
+ if [ ! -d $piddir ]; then
+ mkdir $piddir
+ fi
+ if [ "`stat -c %U $piddir`" != "$USER" ]; then
+ chown $USER $piddir
fi
daemon --pidfile ${pidfile} memcached -d -p $PORT -u $USER -m $CACHESIZE -c $MAXCONN -P ${pidfile} $OPTIONS
More information about the scm-commits
mailing list