[glusterfs/el6] glusterd.init use /run per Fedora File System Layout, or /var/run when needed
Kaleb S. KEITHLEY
kkeithle at fedoraproject.org
Tue Jan 10 18:05:13 UTC 2012
commit 2cd9c4e4c806aee8ac7573ef4d15f9a846a36a54
Author: Kaleb KEITHLEY <kkeithle at redhat.com>
Date: Tue Jan 10 13:03:15 2012 -0500
glusterd.init use /run per Fedora File System Layout, or /var/run when
needed
glusterd.init | 10 +++++++---
glusterfs.spec | 6 +++++-
2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/glusterd.init b/glusterd.init
index d09847a..0007d2e 100644
--- a/glusterd.init
+++ b/glusterd.init
@@ -20,9 +20,13 @@
# Source function library.
. /etc/rc.d/init.d/functions
-exec="/usr/sbin/glusterd"
+exe="/usr/sbin/glusterd"
prog="glusterd"
+# Fedora File System Layout dictates /run
+[ -e /run ] && RUNDIR="/run"
+pidf="${RUNDIR:-/var/run}/$prog.pid"
+
# Set defaults, then source config for eventual overrides
GLUSTERD_NOFILE="65536"
@@ -31,10 +35,10 @@ GLUSTERD_NOFILE="65536"
lockfile=/var/lock/subsys/$prog
start() {
- [ -x $exec ] || exit 5
+ [ -x $exe ] || exit 5
ulimit -n $GLUSTERD_NOFILE
echo -n $"Starting $prog: "
- daemon $exec${GLUSTERD_LOGFILE+" -l $GLUSTERD_LOGFILE"}${GLUSTERD_LOGLEVEL+" -L $GLUSTERD_LOGLEVEL"} -p /var/run/glusterd.pid
+ daemon $exe${GLUSTERD_LOGFILE+" -l $GLUSTERD_LOGFILE"}${GLUSTERD_LOGLEVEL+" -L $GLUSTERD_LOGLEVEL"} -p $pidf
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
diff --git a/glusterfs.spec b/glusterfs.spec
index 76de754..88058b4 100644
--- a/glusterfs.spec
+++ b/glusterfs.spec
@@ -25,7 +25,7 @@
Summary: Cluster File System
Name: glusterfs
Version: 3.2.5
-Release: 5%{?dist}
+Release: 6%{?dist}
License: GPLv3
Group: System Environment/Base
Vendor: Red Hat
@@ -391,6 +391,10 @@ if [ $1 -ge 1 ]; then
fi
%changelog
+* Tue Jan 10 2012 Kaleb S. KEITHLEY <kkeithle at redhat.com> - 3.2.5-6
+- glusterd.init use /run per Fedora File System Layout, or /var/run when
+ needed
+
* Tue Jan 3 2012 Kaleb S. KEITHLEY <kkeithle at redhat.com> - 3.2.5-5
- revised spec for init.d for fedora<=16, rhel<=6; native systemd for
f17 and rhel7
More information about the scm-commits
mailing list