public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - cman init: stop abusing SBINDIR
@ 2009-03-27 19:07 Fabio M. Di Nitto
0 siblings, 0 replies; only message in thread
From: Fabio M. Di Nitto @ 2009-03-27 19:07 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=593b15a97d1ab93cbd8cc6c7ee8e21ab21ffed1e
Commit: 593b15a97d1ab93cbd8cc6c7ee8e21ab21ffed1e
Parent: 881639f586306925b9245be53f03b5679bf30d0a
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Fri Mar 27 09:06:50 2009 +0100
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Fri Mar 27 20:05:47 2009 +0100
cman init: stop abusing SBINDIR
we set a "secure path" at the top of the init script.
There is no need to invoke commands directly. Drop SBINDIR, /sbin
and /bin direct commands invokation.
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
cman/init.d/cman.in | 44 ++++++++++++++++++++++----------------------
1 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index ca34398..91cb62c 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -198,7 +198,7 @@ start_daemon()
args="$@"
! status $daemon > /dev/null 2>&1 && \
- errmsg=$( @SBINDIR@/$daemon $args 2>&1 )
+ errmsg=$( $daemon $args 2>&1 )
}
stop_daemon()
@@ -233,7 +233,7 @@ mtab_configfs()
cman_running()
{
- @SBINDIR@/cman_tool status > /dev/null 2>&1
+ cman_tool status > /dev/null 2>&1
}
# NOTE: this could probably grow a bit to do config sanity checks
@@ -280,8 +280,8 @@ xend_bridged_net_enabled() {
test -d /proc/xen || return 1
# uanble to determine current runlevel
- current_runlevel=$(/sbin/runlevel 2>/dev/null | \
- awk '{ print $2 }' 2>/dev/null)
+ current_runlevel=$( runlevel 2>/dev/null | \
+ awk '{ print $2 }' 2>/dev/null )
[ -z "$current_runlevel" ] && return 1
# xend doesn't start at this runlevel.
@@ -354,7 +354,7 @@ fence_xvmd_enabled()
#
if cman_running && \
[ "$FENCE_XVMD_OPTS" = "${FENCE_XVMD_OPTS/-X/}" ]; then
- @SBINDIR@/ccs_tool query /cluster/fence_xvmd \
+ ccs_tool query /cluster/fence_xvmd \
> /dev/null 2>&1 || return 1
fi
}
@@ -380,8 +380,8 @@ xend_bridged_net_start() {
return 1
fi
- /sbin/modprobe netbk >& /dev/null || true
- /sbin/modprobe netloop >& /dev/null || true
+ modprobe netbk >& /dev/null || true
+ modprobe netloop >& /dev/null || true
bridge_parms=$( egrep -m 1 \
"^[[:blank:]]*\([[:blank:]]*network-script[[:blank:]]+(')?[[:blank:]]*${NETWORK_BRIDGE_SCRIPT}([[:blank:]]*\)|[[:blank:]]+)" \
@@ -395,28 +395,28 @@ xend_bridged_net_start() {
load_kernel_modules()
{
- errmsg=$( /sbin/modprobe configfs 2>&1 ) || return 1
- errmsg=$( /sbin/modprobe dlm 2>&1 ) || return 1
- errmsg=$( /sbin/modprobe lock_dlm 2>&1 ) || true
+ errmsg=$( modprobe configfs 2>&1 ) || return 1
+ errmsg=$( modprobe dlm 2>&1 ) || return 1
+ errmsg=$( modprobe lock_dlm 2>&1 ) || true
}
unload_kernel_modules()
{
- /sbin/modprobe -r lock_dlm > /dev/null 2>&1 || true
- /sbin/modprobe -r dlm > /dev/null 2>&1 || true
+ modprobe -r lock_dlm > /dev/null 2>&1 || true
+ modprobe -r dlm > /dev/null 2>&1 || true
}
start_configfs()
{
! mtab_configfs && \
- errmsg=$( /bin/mount -t configfs none /sys/kernel/config 2>&1 )
+ errmsg=$( mount -t configfs none /sys/kernel/config 2>&1 )
}
stop_configfs()
{
if mtab_configfs && [ -z "$(ls -1 /sys/kernel/config)" ]; then
- errmsg=$( /bin/umount /sys/kernel/config 2>&1 ) || return 1
- /sbin/modprobe -r configfs > /dev/null 2>&1 || true
+ errmsg=$( umount /sys/kernel/config 2>&1 ) || return 1
+ modprobe -r configfs > /dev/null 2>&1 || true
fi
}
@@ -441,11 +441,11 @@ set_networking_params()
start_cman()
{
if ! cman_running && cman_checkconfig; then
- errmsg=$( @SBINDIR@/cman_tool -t $CMAN_CLUSTER_TIMEOUT -w join \
+ errmsg=$( cman_tool -t $CMAN_CLUSTER_TIMEOUT -w join \
$cman_join_opts 2>&1 ) || return 1
if [ $CMAN_QUORUM_TIMEOUT -gt 0 ]; then
- errmsg=$( @SBINDIR@/cman_tool -t $CMAN_QUORUM_TIMEOUT \
+ errmsg=$( cman_tool -t $CMAN_QUORUM_TIMEOUT \
-q wait 2>&1 ) || return 1
fi
fi
@@ -454,7 +454,7 @@ start_cman()
stop_cman()
{
if cman_running; then
- errmsg=$( @SBINDIR@/cman_tool -t $CMAN_SHUTDOWN_TIMEOUT \
+ errmsg=$( cman_tool -t $CMAN_SHUTDOWN_TIMEOUT \
-w leave $cmanremove 2>&1 ) || return 1
fi
}
@@ -528,12 +528,12 @@ stop_cmannotifyd()
join_fence_domain()
{
- if ! @SBINDIR@/cman_tool status | grep Flags | grep 2node \
+ if ! cman_tool status | grep Flags | grep 2node \
> /dev/null 2>&1; then
- errmsg=$( @SBINDIR@/fence_tool join -w $FENCE_JOIN_TIMEOUT \
+ errmsg=$( fence_tool join -w $FENCE_JOIN_TIMEOUT \
> /dev/null 2>&1 ) || return 1
else
- errmsg=$( @SBINDIR@/fence_tool join -w $FENCE_JOIN_TIMEOUT \
+ errmsg=$( fence_tool join -w $FENCE_JOIN_TIMEOUT \
-m $FENCED_MEMBER_DELAY join \
> /dev/null 2>&1 ) || return 1
fi
@@ -542,7 +542,7 @@ join_fence_domain()
leave_fence_domain()
{
if status fenced > /dev/null 2>&1; then
- @SBINDIR@/fence_tool leave -w 10 > /dev/null 2>&1
+ fence_tool leave -w 10 > /dev/null 2>&1
return $?
fi
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-27 19:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-27 19:07 cluster: STABLE3 - cman init: stop abusing SBINDIR Fabio M. Di Nitto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).