Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Windows NT / Setup / February 2004

Tip: Looking for answers? Try searching our database.

Relation of srvany'd application and logon

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dale - 13 Feb 2004 21:47 GMT
Given an application started through srvany, why would it 'care' if an
active user session ended?

Here's what I'm seeing.  An application (it happens to be LWS (Lite
Web Server)) is started using srvany under the default account.  It
serves pages just fine.  Now I log-off the user account.  Suddenly the
pages no longer get served.  When I log back on, the service still
says its running, but still, no pages get served.  If I stop and
restart the service, the pages start getting served again.  The
service is set to autostart.  If I restart the machine, it will
happily serve pages for days, but ceases if I log on and log off the
machine. Is this weird, or what?  What the H-E double hockey stick is
going on here?

--Dale--
David Jenkins - 18 Feb 2004 01:28 GMT
> Given an application started through srvany, why would it 'care' if an
> active user session ended?
[quoted text clipped - 11 lines]
>
> --Dale--

Taken from srvany.wri
---------------------------
For WIN32 graphical applications: when the currently logged-in user is
logging-off, all WIN32 top-level windows receive WM_QUERYENDSESSION and
WM_ENDSESSION messages. Some WIN32 applications choose to terminate upon
receipt of such messages. In order for your WIN32 application to survive
logoff, it must not do that: instead, your windows procedure should call
the default windows procedure on these messages.

For WIN32 Console (i.e. character-mode) applications: when the currently
logged-in user is logging-off, all Console applications receive a
CTRL_LOGOFF_EVENT event from the Console.
If your Console application has registered a Console event handler (via
SetConsoleCtrlHandler), it must ignore CTRL_LOGOFF_EVENT in order  to
survive the logoff.
Dale - 23 Feb 2004 14:57 GMT
> > Given an application started through srvany, why would it 'care' if an
> > active user session ended?

> Taken from srvany.wri
> ---------------------------

> For WIN32 Console (i.e. character-mode) applications: when the currently
> logged-in user is logging-off, all Console applications receive a
> CTRL_LOGOFF_EVENT event from the Console.
> If your Console application has registered a Console event handler (via
> SetConsoleCtrlHandler), it must ignore CTRL_LOGOFF_EVENT in order  to
> survive the logoff.

David, Thanks for the reply to someone who clearly should have RTFM.
Based on your insight, I think now that the solution will almost
certainly be run "javaw" instead of "java" to start the web server.
The former does not provide a console window.

Thanks again.

--Dale--
Dale - 23 Feb 2004 15:48 GMT
> > Given an application started through srvany, why would it 'care' if an
> > active user session ended?

> Taken from srvany.wri
> ---------------------------

> For WIN32 Console (i.e. character-mode) applications: when the currently
> logged-in user is logging-off, all Console applications receive a
> CTRL_LOGOFF_EVENT event from the Console.
> If your Console application has registered a Console event handler (via
> SetConsoleCtrlHandler), it must ignore CTRL_LOGOFF_EVENT in order  to
> survive the logoff.

In case someone else comes across this later, let me say that my
earlier suggestion that "javaw.exe" instead of "java.exe" would keep
the process alive through a logoff was incorrect.

The key is to add a parameter "-Xrs" to the java parameter list.  
Type "java -X" for disclaimers (apparently this set of "X" parameters
is subject to change without warning).  But it seems to work, so I'm
good.

--Dale--
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.