<div dir="ltr">Hi Hugh,<div><br></div><div>Thanks for your answer,</div><div>What is happening is that if you issue commands like &quot;ls -la&quot;, it works perfectly.</div><div>If you issue a StarCluster command like &quot;starcluster listclusters&quot;... it works.</div>
<div>but if you try to use&quot;Starcluster start -c cluster_template cluster_name&quot;... it doesn´t show any output and $output returns empty.</div><div>If you try to do another example, this is what is going to happen.</div>
<div><br></div><div>1. Try $ starcluster listclusters &gt; output.txt (the file will have all output)</div><div>2. if you try $ starcluster start -c cluster_template cluster_name &gt; output.txt (the file will be 0 bytes)</div>
<div><br></div><div>All best,</div><div><br></div><div>Sergio</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 25, 2014 at 9:40 AM, MacMullan, Hugh <span dir="ltr">&lt;<a href="mailto:hughmac@wharton.upenn.edu" target="_blank">hughmac@wharton.upenn.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Hi Sergio:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">If it’s not running ‘like expected’, how is it running? What version of PHP are you using? Does this script work for you:<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#00b050">&lt;?php<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#00b050">$shellCommand = &#39;ls -lart&#39;;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#00b050">$output = shell_exec($shellCommand);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#00b050">echo &quot;&lt;pre&gt;$output&lt;/pre&gt;&quot;;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Courier New&quot;;color:#00b050">?&gt;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">For that function to work (in 5.3.X or earlier), you
<u>must</u> turn off ‘safe_mode’ in your php.ini file. See manual <a href="http://www.php.net/manual/en/function.shell-exec.php" target="_blank">
http://www.php.net/manual/en/function.shell-exec.php</a>, and <a href="http://www.php.net/manual/en/ini.sect.safe-mode.php#ini.safe-mode" target="_blank">
http://www.php.net/manual/en/ini.sect.safe-mode.php#ini.safe-mode</a> for details on safe modes.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Beyond that, you need to make sure apache user (or whatever you’re running as) has access to everything it needs. Be secure.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">-Hugh<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"> <a href="mailto:starcluster-bounces@mit.edu" target="_blank">starcluster-bounces@mit.edu</a> [mailto:<a href="mailto:starcluster-bounces@mit.edu" target="_blank">starcluster-bounces@mit.edu</a>]
<b>On Behalf Of </b>Sergio Mafra<br>
<b>Sent:</b> Friday, April 25, 2014 7:31 AM<br>
<b>To:</b> <a href="mailto:starcluster@mit.edu" target="_blank">starcluster@mit.edu</a><br>
<b>Subject:</b> [StarCluster] Simple Web interface for StarCluster<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi fellows,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">We use StarCluster for managing our clusters for running eletrical engineering purporses. The engineers want to deploy the clusters in AWS by themselves and we think that letting them access the StarCluster line interface and modifying
 the config file for expandig/reducing the number of nodes in a cluster could be dangerous and not so intuitive.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">So, we decided to build a very simple web interface using Apache and PHP aiming to read the config file, expose the clusters and letting them increase or decrease the number of nodes among limits and starting or terminating the cluster
 with the new parameters.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">We are not expert in PHP and could be not the best tool, but it´s proven to be a quick development. We will study other options like Python and Django in the near future.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The question is: how to execute a command like &quot;starcluster start -c cluster_template cluster_name in PHP? We are trying to use a command like $output = shell_exec($shellCommand);where $shellCommand is &quot;starcluster start -c ...&quot; but it
 doesn´t run like expected. Any ideas?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">All best,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br>
Sergio<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></div></div>
</div>

</blockquote></div><br></div>