Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion MongoDB Windows service shuts down after logoff the windows os user session

Received: by 10.52.28.16 with SMTP id x16mr530008vdg.8.1347554052233;
        Thu, 13 Sep 2012 09:34:12 -0700 (PDT)
X-BeenThere: mongodb-user@googlegroups.com
Received: by 10.220.155.6 with SMTP id q6ls3007792vcw.3.gmail; Thu, 13 Sep
 2012 09:34:03 -0700 (PDT)
Received: by 10.52.37.74 with SMTP id w10mr398398vdj.8.1347554042985;
        Thu, 13 Sep 2012 09:34:02 -0700 (PDT)
Date: Thu, 13 Sep 2012 09:34:02 -0700 (PDT)
From: Tad Marshall <t...@10gen.com>
To: mongodb-user@googlegroups.com
Message-Id: <29bf3920-c61f-4135-9407-c57bc2ff8b16@googlegroups.com>
In-Reply-To: <7a41aa5a-b86d-4b65-9c88-983332e67962@googlegroups.com>
References: <d9d2250c-1c9a-4451-aa1c-9e63a4e668f3@googlegroups.com>
 <692de723-7d23-4b40-8043-3eb31c1ddd8e@googlegroups.com>
 <7a41aa5a-b86d-4b65-9c88-983332e67962@googlegroups.com>
Subject: Re: MongoDB Windows service shuts down after logoff the windows os
 user session
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_3621_28696343.1347554042649"

------=_Part_3621_28696343.1347554042649
Content-Type: multipart/alternative; 
	boundary="----=_Part_3622_21592454.1347554042649"

------=_Part_3622_21592454.1347554042649
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

This may be OS-specific or may be changed behavior from earlier OS versions=
=20
or may be different if running Windows Terminal Server.  I seem to find=20
conflicting stories when I Google for CTRL_LOGOFF_EVENT.  For example,

http://publib.boulder.ibm.com/infocenter/idshelp/v117/index.jsp?topic=3D%2F=
com.ibm.gen_busug.doc%2Fc_fgl_programs_016.htm

suggests that IBM=C2=AE Informix=C2=AE Genero, Version 2.40 needs to be con=
figured to=20
prevent CTRL_LOGOFF_EVENT from shutting down the service on Windows when an=
=20
Administrator logs off.

The Microsoft online documentation suggests that I should be able to=20
reproduce this easily:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms683242%28v=3Dvs.8=
5%29.aspx

CTRL_LOGOFF_EVENT: A signal that the system sends to all console processes=
=20
when a user is logging off. This signal does not indicate which user is=20
logging off, so no assumptions can be made.  Note that this signal is=20
received only by services. Interactive applications are terminated at=20
logoff, so they are not present when the system sends this signal.

If you can give me enough information to reproduce this, I can try to=20
change the code to fix it.

On Thursday, September 13, 2012 12:17:03 PM UTC-4, Tad Marshall wrote:
>
> I can't duplicate this in Windows 7.  I created a mongod service using=20
> --install, rebooted to get a fresh start, logged in to my user account,=
=20
> verified that mongod.exe was running as a service, then logged out of my=
=20
> user account.  Logging back in, the service was still running, showing=20
> uptime of 22 minutes and no SERVER RESTARTED messages except the first on=
e=20
> from creating the service and then letting it start after a reboot.
>
> There should be no console associated with a service (since we don't=20
> allocate one but would inherit one if started from the console) so=20
> the CTRL_LOGOFF_EVENT should not be sent to us.
>
> 1)  What OS are you running?
> 2)  How did you set up the Windows service?  Can you post the command lin=
e=20
> you used?
> 3)  Did you configure the service to run under a particular login id, or=
=20
> check "Allow service to interact with desktop", or do some other=20
> configuration change?
> 4)  Can you reproduce this on other machines?
> 5)  Anything else that might enable me to reproduce your problem?
>
> If this is more than a misunderstanding or misconfiguration, we should=20
> probably move this to a Jira ticket.
>
> On Thursday, September 13, 2012 7:49:45 AM UTC-4, Tad Marshall wrote:
>>
>> This may be a bug in mongod.exe, but I need to play with it to see what'=
s=20
>> going on.
>>
>> We once had a bug where logging out while mongod.exe was running in a=20
>> console window caused the process to be terminated by the system, leadin=
g=20
>> to an unclean shutdown.  I fixed that by reacting to the logout callback=
.=20
>>  Maybe we need to ignore it when we are running as a service.
>>
>> If you want, file a Jira ticket about it or let me know and I will file=
=20
>> one.
>>
>> Is the service running as LOCAL_SERVICE or as something else?
>>
>> On Wednesday, September 12, 2012 7:54:21 AM UTC-4, ajduke wrote:
>>>
>>> i installed 2.2 mongodb  as windows service, it installed and started=
=20
>>> properly.=20
>>> As windows session is logged off, mongodb also got killed .=20
>>>
>>> This should not be case, as it is running as daemon/bg service then it=
=20
>>> should not be halted, even after all sessions are logged off.
>>> (This is not done in production environment, as client of ours wants=20
>>> session to be closed,  once finished with work )=20
>>>
>>> Further, I see from mongo logs that=20
>>> that mongo service is listening onto various event such as=20
>>> CTRL_LOGOFF_EVENT, CTRL_C_EVENT. which may be the cause=20
>>>
>>> Please help with this , or any thing i am missing ?
>>>
>>
------=_Part_3622_21592454.1347554042649
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

This may be OS-specific or may be changed behavior from earlier OS versions=
 or may be different if running Windows Terminal Server. &nbsp;I seem to fi=
nd conflicting stories when I Google for&nbsp;CTRL_LOGOFF_EVENT. &nbsp;For =
example,<div><br></div><div>http://publib.boulder.ibm.com/infocenter/idshel=
p/v117/index.jsp?topic=3D%2Fcom.ibm.gen_busug.doc%2Fc_fgl_programs_016.htm<=
/div><div><br></div><div>suggests that&nbsp;IBM=C2=AE Informix=C2=AE Genero=
, Version 2.40 needs to be configured to prevent CTRL_LOGOFF_EVENT from shu=
tting down the service on Windows when an Administrator logs off.</div><div=
><br></div><div>The Microsoft online documentation suggests that I should b=
e able to reproduce this easily:</div><div><br></div><div>http://msdn.micro=
soft.com/en-us/library/windows/desktop/ms683242%28v=3Dvs.85%29.aspx<br></di=
v><div><br></div><div>CTRL_LOGOFF_EVENT: A signal that the system sends to =
all console processes when a user is logging off. This signal does not indi=
cate which user is logging off, so no assumptions can be made. &nbsp;Note t=
hat this signal is received only by services. Interactive applications are =
terminated at logoff, so they are not present when the system sends this si=
gnal.<br></div><div><br></div><div>If you can give me enough information to=
 reproduce this, I can try to change the code to fix it.<br><br>On Thursday=
, September 13, 2012 12:17:03 PM UTC-4, Tad Marshall wrote:<blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #c=
cc solid;padding-left: 1ex;">I can't duplicate this in Windows 7. &nbsp;I c=
reated a mongod service using --install, rebooted to get a fresh start, log=
ged in to my user account, verified that mongod.exe was running as a servic=
e, then logged out of my user account. &nbsp;Logging back in, the service w=
as still running, showing uptime of 22 minutes and no SERVER RESTARTED mess=
ages except the first one from creating the service and then letting it sta=
rt after a reboot.<div><br></div><div>There should be no console associated=
 with a service (since we don't allocate one but would inherit one if start=
ed from the console) so the&nbsp;CTRL_LOGOFF_EVENT should not be sent to us=
.</div><div><br></div><div>1) &nbsp;What OS are you running?</div><div>2) &=
nbsp;How did you set up the Windows service? &nbsp;Can you post the command=
 line you used?</div><div>3) &nbsp;Did you configure the service to run und=
er a particular login id, or check "Allow service to interact with desktop"=
, or do some other configuration change?</div><div>4) &nbsp;Can you reprodu=
ce this on other machines?</div><div>5) &nbsp;Anything else that might enab=
le me to reproduce your problem?</div><div><br></div><div>If this is more t=
han a misunderstanding or misconfiguration, we should probably move this to=
 a Jira ticket.<br><br>On Thursday, September 13, 2012 7:49:45 AM UTC-4, Ta=
d Marshall wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin=
-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">This may be a bug =
in mongod.exe, but I need to play with it to see what's going on.<div><br><=
/div><div>We once had a bug where logging out while mongod.exe was running =
in a console window caused the process to be terminated by the system, lead=
ing to an unclean shutdown. &nbsp;I fixed that by reacting to the logout ca=
llback. &nbsp;Maybe we need to ignore it when we are running as a service.<=
/div><div><br></div><div>If you want, file a Jira ticket about it or let me=
 know and I will file one.</div><div><br></div><div>Is the service running =
as LOCAL_SERVICE or as something else?<br><br>On Wednesday, September 12, 2=
012 7:54:21 AM UTC-4, ajduke wrote:<blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
>i installed 2.2 mongodb &nbsp;as windows service, it installed and started=
 properly.&nbsp;<div>As windows session is logged off, mongodb also got kil=
led .&nbsp;</div><div><br></div><div>This should not be case, as it is runn=
ing as daemon/bg service then it should not be halted, even after all sessi=
ons are logged off.</div><div>(This is not done in production environment, =
as client of ours wants session to be closed, &nbsp;once finished with work=
 )&nbsp;<br></div><div><br></div><div>Further, I see from mongo logs that&n=
bsp;</div><div>that mongo service is listening onto various event such as C=
TRL_LOGOFF_EVENT, CTRL_C_EVENT. which may be the cause&nbsp;</div><div><br>=
</div><div>Please help with this , or any thing i am missing ?</div></block=
quote></div></blockquote></div></blockquote></div>
------=_Part_3622_21592454.1347554042649--

------=_Part_3621_28696343.1347554042649--