tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sureka, Sushil" <>
Subject RE: Reading environment variable from Tomcat
Date Wed, 13 Aug 2008 18:45:18 GMT
I responded to this in another email. Youssef, I would appreciate if you
can provide your input (I am just trying to consolidate my answer in one
email for better readability)

-----Original Message-----
From: Youssef Mohammed [] 
Sent: Wednesday, August 13, 2008 1:33 PM
To: Tomcat Users List
Subject: Re: Reading environment variable from Tomcat

exactly!  you can even login with two different users (if you are using
windows server) none of them would be running the service unless you
the logged on option.

On Wed, Aug 13, 2008 at 9:27 PM, David kerber <>

> Sureka, Sushil wrote:
>> Hi,
>> I have run into an issue related to starting tomcat as a service.
>> we were starting tomcat from the command line, we were able to just
>> System.getProperty("" ) to retrieve the logged in user id.
>> now that we start tomcat using a service, the get property call
>> "SYSTEM".
>> After doing some more research, it seems like I have two options to
>> out the login id.
>> 1.       Start the service using logged on option.
>> 2.       Use System.getEnv()
>> It seems like the first option may not work for us as our passwords
>> expires periodically, and setting the logon/password account means
>> we would have to have manual intervention. Additionally, when I tried
>> use my user id as logon id, it won't let me do that ( I imagine I
>> to have system admin turn the privilege on for or something on those
>> lines)
>> The second option did not work either. Calling the
>> System.getEnv("USERNAME") in a program started from the command line
>> returns the logged in user name, but it returns null when tomcat was
>> started using service approach.
>> I am not sure  if there is a way to find out who is logged in into
>> system when Tomcat has been started using service mechanism. Any help
>> this matter would be great help
> Somewhat related to this: what do you want it to return when nobody is
> logged on?  When it's a service and set to automatic start, the system
> run without needing to be logged on (just sitting at the logon
> D
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Regards, Youssef

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message