title: Why does "Local System" account lack permissions to NTFS Filesystem (running java as windows service)
body: <p>I have a problem running a java process as a windows service due to NTFS permissions.
  (http://community.jboss.org/wiki/RunJBossAsAServiceOnWindows).</p>
  
  <p>The service installs successfully, but has problems starting due to file permissions. </p>
  
  <ul>
  <li>If I change the windows-service "login" to my account (e.g. domain/login), the service runs fine.</li>
  <li>If I change the filesystem permisisons from 755 to 777, the service runs fine.</li>
  </ul>
  
  <p><strong>Example log</strong></p>
  
  <pre><code>08:58:02,250 ERROR [MainDeployer] Could not make local copy for file:/J:/projects/devtools/pe64-jboss-4.2.2.GA/server/solr/conf/jboss-service.xml
  java.io.IOException: Access is denied
      at java.io.WinNTFileSystem.createFileExclusively(Native Method)
  </code></pre>
  
  <p><em><strong>"Yo No Comprende".</em></strong> I thought the "Local System" account was "root". ("Local System" is the default account)</p>
  
  <p>"chmod -R 777  &lt;>"  is not an option. (security hole)</p>
  
  <p><strong>So to summarize:</strong></p>
  
  <ul>
  <li>What is the deal with "Local System" and windows NTFS file permissions?</li>
  <li>Can you add "Local System" to "My group"</li>
  <li>Is my local build process doing something wrong? (e.g. the windows version of UMask is bad? )</li>
  <li>Any other gotchas running java as a windows service?</li>
  <li>After 15+ years of windows NT-based OS, why are services still such a pain?</li>
  </ul>
  
  <p><strong>Update/Solution</strong></p>
  
  <p>It turn out that in later Windows (Vista and Window 7), MSFT closed a security hole which allowed a service to get at anyone's "temp" files. </p>
  
  <p>"Local System" account just doesn't  have access to any common/pre-created "temp" directory.</p>
  
  <p>The solution, in the java world: </p>
  
  <ul>
  <li>create your own temp directory. Grant it adequate permisions)</li>
  <li>pass "-Djava.io.tmpdir=/path/to/my/temp/dir" as a jvm argument. </li>
  </ul>
  
  <p>thanks</p>
  
  <p>will</p>