title: How do I run nohup as a different user without spawning two processes?
body: <p>I'm trying to nohup a command and run it as a different user, but every time I do this two processes are spawned.</p>
  
  <p>For example:</p>
  
  <pre><code>$ nohup su -s /bin/bash nobody -c "my_command" &gt; outfile.txt &amp;
  </code></pre>
  
  <p>This definitely runs my_command as nobody, but there's an extra process that I don't want to shown up:</p>
  
  <pre><code>$ ps -Af
  .
  .
  .
  root ... su -s /bin/bash nobody my_command
  nobody ... my_command
  </code></pre>
  
  <p>And if I kill the root process, the nobody process still lives... but is there a way to not run the root process at all? Since getting the id of my_command and killing it is a bit more complicated.</p>