title: Session loogging in /etc/profile
body: <p>The session logging we have in {{/etc/profile}} can interfere with services that launch sub-shells as new users - specifically, it <em>always</em> launches an interactive terminal, regardless of the context, which can cause certain key processes (e.g. Jenkins) from being able to perform critical tasks.</p>
  
  <p>We had a Jenkins version upgrade and after hte upgrade, Jenkins seems to not be able to restart.  Here’s what’s happening </p>
  
  <p>```ubuntu@hoatname:~$ sudo service jenkins status</p>
  
  <p>Correct java version found</p>
  
  <p>Jenkins Automation Server is not running</p>
  
  <p>ubuntu@hostname:~$ sudo service jenkins start</p>
  
  <p>Correct java version found</p>
  
  <ul>
  <li>Starting Jenkins Automation Server jenkins                                                                                                                             jenkins@hostname:~$ </li>
  </ul>
  
  <p>jenkins@hostname:~$ </p>
  
  <p>jenkins@hostname:~$ sudo service jenkins status</p>
  
  <p>[sudo] password for jenkins: </p>
  
  <p>jenkins@hostname:~$ exit</p>
  
  <p>exit</p>
  
  <pre><code>                                                                                                                                                               [fail]
  </code></pre>
  
  <p>ubuntu@hostname:~$</p>
  
  <p>```</p>
  
  <p>Essentially, it seems that “service jenkins start” is somehow causing a session to be created, which dumps it into a script.  I <em>suspect</em> this is due to how <code>/etc/profile</code> contains a script-based session logger, and i <em>suspect</em> that Jenkins is attempting to execute this script when it su’s into its own jenkins user</p>
  
  <p>What should I do to alleviate this?</p>