<div dir="ltr"><div>Hello i have question, how run in background bash script in spank plugin ?</div><div><br></div><div>in my spank plugin in function : slurm_spank_task_init_privileged</div><div><br></div><div>i want to run this script :</div><div>
<pre><span class="gmail-n">system</span><span class="gmail-p">(</span><span class="gmail-s">"nohup bash -c 'sleep 10 ; touch /tmp/newfile.txt' &"</span><span class="gmail-p">);<br><br></span></pre><pre><span class="gmail-p">i want to run in independant process this bash script, i don't want wait 10 seconde in my slurm plugin<br><br></span></pre><pre><span class="gmail-p">i have this code :<br>int slurm_spank_task_init_privileged (spank_t sp, int ac, char **av) {
<pre><span class="gmail-n">system</span><span class="gmail-p">(</span><span class="gmail-s">"nohup bash -c 'sleep 10 ; touch /tmp/newfile.txt' &"</span><span class="gmail-p">);</span></pre></span></pre><pre><span class="gmail-p">return 0;<br></span></pre><pre><span class="gmail-p">}<br><br></span></pre><pre><span class="gmail-p">actualy it's not work, when slurm ending to run my job, he kill my nohup command<br><br></span></pre><pre><span class="gmail-p">if i had in my c code sleep 12, my bash script work<br><br>
<pre><span class="gmail-p">int slurm_spank_task_init_privileged (spank_t sp, int ac, char **av) {
<pre><span class="gmail-n">system</span><span class="gmail-p">(</span><span class="gmail-s">"nohup bash -c 'sleep 10 ; touch /tmp/newfile.txt' &"</span><span class="gmail-p">);<br></span></pre><pre><span class="gmail-p">sleep(12);<br></span></pre></span></pre><pre><span class="gmail-p">return 0;<br></span></pre><pre><span class="gmail-p">}<br><br></span></pre><pre><span class="gmail-p">but i don't want to wait, i want to run my bash script in independant process<br><br></span></pre><pre><span class="gmail-p">thanks for advance for your help<br></span></pre>
<br></span></pre>
<br></div></div>