From def09c4fbb2805618715c5a125ddf482d7e53de3 Mon Sep 17 00:00:00 2001 From: hari gowtham Date: Tue, 25 Jul 2017 18:07:05 +0530 Subject: Infra to indentify process Problem: currently we can't identify which process is running and how many instances of it are available. Fix: name the process when its spawned and send it to the server and save it in the client_t The processes that abide by this change from this patch are: 1) fuse mount, 2) rebalance, 3) selfheal, 4) tier, 5) quota, 6) snapshot, 7) brick. 8) gfapi (by default. gfapi. if processname is found) Note: fuse gets a process name as native-fuse-client by default. If the user gives a name for the fuse and spawns it, it will be of this type --process-name native-fuse-client.. This can be made use by the process like aux mount done by quota, geo-rep, etc by adding another option in the aux mount " -o process-name=gsync_mount" Updates: #178 Signed-off-by: hari gowtham Change-Id: Ie4d02257216839338043737691753bab9a974d5e Reviewed-on: https://review.gluster.org/17957 Smoke: Gluster Build System Tested-by: hari gowtham Reviewed-by: Amar Tumballi CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Aravinda VK Reviewed-by: Niels de Vos --- xlators/mount/fuse/utils/mount.glusterfs.in | 9 +++++++++ xlators/mount/fuse/utils/mount_glusterfs.in | 9 +++++++++ 2 files changed, 18 insertions(+) (limited to 'xlators/mount/fuse') diff --git a/xlators/mount/fuse/utils/mount.glusterfs.in b/xlators/mount/fuse/utils/mount.glusterfs.in index 826991ba402..216d03c4182 100755 --- a/xlators/mount/fuse/utils/mount.glusterfs.in +++ b/xlators/mount/fuse/utils/mount.glusterfs.in @@ -257,6 +257,12 @@ start_glusterfs () cmd_line=$(echo "$cmd_line --xlator-option=$xlator_option"); fi + if [ -n "$process_name" ]; then + cmd_line=$(echo "$cmd_line --process-name fuse.$process_name"); + else + cmd_line=$(echo "$cmd_line --process-name fuse"); + fi + # if trasnport type is specified, we have to append it to # volume name, so that it fetches the right client vol file @@ -510,6 +516,9 @@ with_options() "halo-min-replicas") halo_min_replicas=$value ;; + "process-name") + process_name=$value + ;; x-*) # comments or userspace application-specific options, drop them ;; diff --git a/xlators/mount/fuse/utils/mount_glusterfs.in b/xlators/mount/fuse/utils/mount_glusterfs.in index eca84557e87..d3571dea706 100755 --- a/xlators/mount/fuse/utils/mount_glusterfs.in +++ b/xlators/mount/fuse/utils/mount_glusterfs.in @@ -234,6 +234,12 @@ start_glusterfs () cmd_line=$(echo "$cmd_line --xlator-option=$xlator_option"); fi + if [ -n "$process_name" ]; then + cmd_line=$(echo "$cmd_line --process-name fuse.$process_name"); + else + cmd_line=$(echo "$cmd_line --process-name fuse"); + fi + # for rdma volume, we have to fetch volfile with '.rdma' added # to volume name, so that it fetches the right client vol file volume_id_rdma=""; @@ -398,6 +404,9 @@ with_options() [ $value = "false" ] ; then no_root_squash=1; fi ;; + "process-name") + process_name=$value + ;; *) warn "Invalid option: $key" exit 1 -- cgit