[PATCH] mkcephfs.in: Use $user when copying files using scp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Theodore Ts'o <tytso@xxxxxxxxxx>

The use of $user was missing in a few places.  This was needed so I
could run as a different userid than the userid than is used to install
and run the Ceph daemons.

Signed-off-by: "Theodore Ts'o" <tytso@xxxxxxxxxx>
---
 src/mkcephfs.in |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/src/mkcephfs.in b/src/mkcephfs.in
index 9359118..6bb3b3c 100644
--- a/src/mkcephfs.in
+++ b/src/mkcephfs.in
@@ -185,9 +185,15 @@ for name in $what; do
     check_host || continue
 
     if [ -n "$ssh" ] && ( echo $pushed_to | grep -v -q " $host " ); then
-	scp -q $conf $host:$conf
-	scp -q $osdmap $host:$osdmap
-	scp -q $monmap $host:$monmap
+	if [ -n "$user" ]; then
+	  scp -q $conf $user@$host:$conf
+	  scp -q $osdmap $user@$host:$osdmap
+	  scp -q $monmap $user@$host:$monmap
+        else
+	  scp -q $conf $host:$conf
+	  scp -q $osdmap $host:$osdmap
+	  scp -q $monmap $host:$monmap
+        fi
 	pushed_to="$pushed_to $host "
     fi
 
@@ -239,7 +245,13 @@ for name in $what; do
 	    do_root_cmd "umount $btrfs_path ; for f in $btrfs_devs ; do umount \$f ; done ; modprobe btrfs ; mkfs.btrfs $btrfs_devs ; modprobe btrfs ; btrfsctl -a ; mount -t btrfs $btrfs_opt $first_dev $btrfs_path ; chown $osd_user $btrfs_path ; chmod +w $btrfs_path "
 	fi
 
-	[ -n "$ssh" ] && scp $monmap $host:$monmap
+	if [ -n "$ssh" ]; then
+          if [ -n "$user" ]; then
+            scp $monmap $user@$host:$monmap
+          else
+            scp $monmap $host:$monmap
+          fi
+        fi
 	do_cmd "$BINDIR/cosd -c $conf --monmap $monmap -i $num --mkfs --osd-data $osd_data"
 
 	if [ -n "$keyring" ]; then
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux