summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/utils
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-06-08 07:18:18 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-06-09 09:13:23 -0700
commit5b90d71324802e88c72947b807884036cfd32b78 (patch)
tree0ece47d73d0f7a909c67a104c34f603d8f035f52 /xlators/mount/fuse/utils
parent7c42fd0f2059329d620225962146cdd0414a8f69 (diff)
Print PID after daemonizing glusterfs.
PID used to be printed before glusterfs became a daemon, which is incorrect since becoming a daemon involves forking and thus the PID changes. Fixes bug #8. Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'xlators/mount/fuse/utils')
-rwxr-xr-xxlators/mount/fuse/utils/mount.glusterfs.in16
1 files changed, 10 insertions, 6 deletions
diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in
index 4d6e602b0..2b43f834b 100755
--- a/xlators/mount/fuse/utils/mount.glusterfs.in
+++ b/xlators/mount/fuse/utils/mount.glusterfs.in
@@ -18,7 +18,7 @@
-_init ()
+function _init ()
{
# log level definitions
LOG_NONE=NONE;
@@ -27,12 +27,13 @@ _init ()
LOG_WARNING=WARNING;
LOG_NORMAL=NORMAL
LOG_DEBUG=DEBUG;
+ LOG_TRACE=TRACE;
- # set default log level to ERROR
+ # set default log level to NORMAL
log_level=$LOG_NORMAL;
}
-start_glusterfs ()
+function start_glusterfs ()
{
prefix="@prefix@";
exec_prefix=@exec_prefix@;
@@ -55,6 +56,9 @@ start_glusterfs ()
"WARNING")
log_level=$LOG_WARNING;
;;
+ "TRACE")
+ log_level=$LOG_TRACE;
+ ;;
"NONE")
log_level=$LOG_NONE;
;;
@@ -106,7 +110,7 @@ start_glusterfs ()
}
-main ()
+function main ()
{
options=$(echo "$@" | sed -n 's/.*\-o[ ]*\([^ ]*\).*/\1/p');
new_log_level=$(echo "$options" | sed -n 's/.*log-level=\([^,]*\).*/\1/p');
@@ -150,11 +154,11 @@ main ()
mount_point="$2";
# Simple check to avoid multiple identical mounts
- if grep -q " $mount_point fuse.glusterfs " /etc/mtab; then
+ if grep -q "glusterfs.* $mount_point fuse" /etc/mtab; then
echo "$0: according to mtab, GlusterFS is already mounted on $mount_point"
exit 1
fi
-
+
fs_options=$(echo "$fs_options,$new_fs_options");
start_glusterfs;