From patchwork Thu Oct 21 22:54:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 272511 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9LMsMWX022308 for ; Thu, 21 Oct 2010 22:54:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758587Ab0JUWy0 (ORCPT ); Thu, 21 Oct 2010 18:54:26 -0400 Received: from thunk.org ([69.25.196.29]:52474 "EHLO thunker.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758569Ab0JUWy0 (ORCPT ); Thu, 21 Oct 2010 18:54:26 -0400 Received: from root (helo=tytso-glaptop) by thunker.thunk.org with local-esmtp (Exim 4.50 #1 (Debian)) id 1P941h-0002wP-6N; Thu, 21 Oct 2010 18:54:25 -0400 Received: from tytso by tytso-glaptop with local (Exim 4.71) (envelope-from ) id 1P941g-0001oY-I1; Thu, 21 Oct 2010 18:54:24 -0400 From: "Theodore Ts'o" To: ceph-devel@vger.kernel.org Cc: "Theodore Ts'o" Subject: [PATCH] mkcephfs.in: Use $user when copying files using scp Date: Thu, 21 Oct 2010 18:54:24 -0400 Message-Id: <1287701664-6945-1-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 1.7.1 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on thunker.thunk.org); SAEximRunCond expanded to false Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 21 Oct 2010 22:54:34 +0000 (UTC) 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