The service does not need to run when no one is logged in. We are in a
kind of one off situation where Tomcat would be running on standalone
laptops when the users are not connected to internet. So we are not
running it on windows server rather on windows xp.

I saw the other reply but I am not sure if I understand how to make that
work. I just tried the option of adding --User in the service.bat
specifying my user id, but it did not work. Also as I mentioned in my
original email, the password issue will remain as a problem even if we
get past the first issue.

SS

-----Original Message-----
From: David kerber [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2008 1:27 PM
To: Tomcat Users List
Subject: Re: Reading environment variable from Tomcat

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".  
>
>  
>
> After doing some more research, it seems like I have two options to
find
> 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
that
> 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 need
> 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 the
> system when Tomcat has been started using service mechanism. Any help
in
> 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 
will run without needing to be logged on (just sitting at the logon 
prompt)...

D



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


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

Reply via email to