title: posix_openpt() - error - Cant access tty, job control turned off
body: <p>I'm using a psuedo terminal, /bin/sh -i, by calling normal commands for posix_openpty() then fork(), in language C.</p>
  
  <p>When I run from command line GUI terminal like this</p>
  
  <pre><code>$ ./MyTerminal
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$ sudo ./MyTerminal
  </code></pre>
  
  <p>or as root like this</p>
  
  <pre><code># ./MyTerminal
  </code></pre>
  
  <p>all works very good and as expected, no problems.</p>
  
  <p>However, when I make a systemd service file like this, it works fine</p>
  
  <pre><code>[Service]
  User=root
  </code></pre>
  
  <p>But when I try to get systemd to run it as normal user like this</p>
  
  <pre><code>[Service]
  User=debian
  </code></pre>
  
  <p>THe first output for /bin/sh -i is</p>
  
  <pre><code>/bin/sh: 0: can't access tty; job control turned off $
  </code></pre>
  
  <p>And the terminal does not really work.</p>
  
  <p>When I run /bin/bash, fork() w/posix_openpty() is returns me this, but the terminal generally works ok</p>
  
  <pre><code> bash: cannot set terminal process group (-1): Inappropriate ioctl for device 
   bash: no job control in this shell
  </code></pre>
  
  <p>Is such a weird prolem because when running outside of systemd everything works perfect. I see this problem in 1 other question but no clear solution. So what I have to change to make systemd run my file perfectly? Thanks for your help.</p>