Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B380510F29 for ; Tue, 18 Feb 2014 18:13:19 +0000 (UTC) Received: (qmail 75201 invoked by uid 500); 18 Feb 2014 18:13:04 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 75072 invoked by uid 500); 18 Feb 2014 18:13:03 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 75057 invoked by uid 99); 18 Feb 2014 18:13:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Feb 2014 18:13:02 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ozawa.tsuyoshi@gmail.com designates 74.125.82.50 as permitted sender) Received: from [74.125.82.50] (HELO mail-wg0-f50.google.com) (74.125.82.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Feb 2014 18:12:57 +0000 Received: by mail-wg0-f50.google.com with SMTP id z12so3523148wgg.17 for ; Tue, 18 Feb 2014 10:12:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2rnuv7r5xOX/QsbLdTxlln5yV3NPMNLkKR8TEVNFC0c=; b=SWC+PAh64NcldGIyw14AzSeagZ5AUF4dpnatKN3/iHDPH+wo6XTcQrEMdcdK6XAZ2q j9d5Lg5U/o/sjUGuMM2jBpv0vw63+XCtYFGtNVfWRfS46ke0f29VwQOxmq2YgEFE+fDP jlTFJjoKeGhPcAT7xz6F8djMibaMSU56z4kWexkV0pYp2R5nowvtVDFzoN+RS9ZacBMU bsv2TFKcjPmpEEgYOn1rf0iI9LoH1Vyr3gezRgsh4B5h6aqOYVq9GbiP2ANB4058RKp8 aNsF1en+0Ql165xVrn02Mgh7+c9YSpdpo5FtVG6N41802nQaRky4GDc2byDAKLyLx5jH rg5w== MIME-Version: 1.0 X-Received: by 10.180.25.46 with SMTP id z14mr19306842wif.49.1392747157028; Tue, 18 Feb 2014 10:12:37 -0800 (PST) Received: by 10.216.152.68 with HTTP; Tue, 18 Feb 2014 10:12:36 -0800 (PST) In-Reply-To: <1392704198.21464.YahooMailNeo@web163101.mail.bf1.yahoo.com> References: <1392704198.21464.YahooMailNeo@web163101.mail.bf1.yahoo.com> Date: Tue, 18 Feb 2014 10:12:36 -0800 Message-ID: Subject: Re: Yarn - Running multiple commands on container From: Tsuyoshi OZAWA To: "user@hadoop.apache.org" , Anand Mundada Cc: "yarn-dev@hadoop.apache.org" Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi Anand and YARN developers, I found that UnixShellScriptBuilder#command just concatenates each commands with space, not with ";". Therefore, you need to suffix ";" after commands you'd like to execute. UnixShellScriptBuilder { @Override public void command(List command) { line("exec /bin/bash -c \"", StringUtils.join(" ", command), "\""); } } > YARN developers Is this expected behavior? IMO, this seems to go against instinct of users. Javadoc of ContainerLaunchContext#setCommands says: "@param commands the list of commands for launching the container", so should we each commands with ";"? Thanks, - Tsuyoshi On Mon, Feb 17, 2014 at 10:16 PM, Anand Mundada wrote: > Hi all, > > I am using > containerLaunchContext.setCommands() to add different commands that I wanted > to run on container. > But only first command is getting execute. > Is there is something else I need to do? > > Code: > List commands = new ArrayList(); > commands.add(cmd1); > commands.add(cmd2); > > I can see only cmd1 is getting executed. > > Thanks, > Anand -- - Tsuyoshi