tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier ...@ice-sa.com>
Subject Re: Reading environment variable from Tomcat
Date Thu, 14 Aug 2008 19:59:51 GMT
David kerber wrote:
> Sureka, Sushil wrote:
>> Hi,
>>
>>  
>>
>> I have run into an issue related to starting tomcat as a service. When
>> we were starting tomcat from the command line, we were able to just say
>> System.getProperty("user.name" ) to retrieve the logged in user id. But
>> now that we start tomcat using a service, the get property call returns
>> "SYSTEM". 
>>  
I saw all the other answers, but I would just like to point out clearky 
that what you mention above is *normal*.
System.getProperty("user.name") will return "SYSTEM" when you start 
Tomcat as a service under Windows, because "SYSTEM" is the user name 
under which Tomcat then starts.
Right-click on the "My computer" icon, then "Manage.." then "services 
and applications", then "services".
Locate the Tomcat service in the list on the right, and right-click on 
it, choose "Properties".  The second tab shows under which user-id the 
Tomcat Service is started.  By default, it will say something like 
"LocalSystem" (which is an alias for "SYSTEM").  That is the user-id 
under which the service is running.
In the same tab, you can change it, and set it to the user-id you want.

Now, if you want to run Tomcat as a different user each time someone 
logs on to the laptop, that's a different story, for which you already 
got tips from other people.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message