title: Switching users from root in a Rundeck job (Cannot create session: Already running in a session)
body: <p>I am trying to test a scheduled job on Rundeck by running specific commands on a 16.04 Ubuntu box, and one of those will be to switch the user from <code>root</code> to <code>nodeworker</code>.</p>
  
  <p>the sequence is:</p>
  
  <ol>
  <li>Accessing the right directory as root
  <code>cd /var/www/...</code> (Runs with no issues)</li>
  <li>Switching to user <code>nodeworker</code>, no password needed
  <code>su nodeworker</code></li>
  <li>running the command <code>git pull origin master</code></li>
  </ol>
  
  <p>I tried running it with <code>sudo su - nodeworker -c "command here"</code>, same issue, that did not work either. I ended up tailing the <code>auth.log</code> to find that <code>su</code> is giving an error for starting a session when the root session is existing, and I have no idea of a fix for it:</p>
  
  <p><code>pam_systemd(su:session): Cannot create session: Already running in a session</code></p>
  
  <p>And I found this issue reported for Debian, <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825949" rel="nofollow">https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825949</a></p>