After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 681888 - PostSession no longer run when using gdm 3.5.x (git master)
PostSession no longer run when using gdm 3.5.x (git master)
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-14 23:39 UTC by Gert Kulyk
Modified: 2012-09-06 21:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
slave: don't prematurely set is_running to FALSE (1.75 KB, patch)
2012-09-06 17:55 UTC, Ray Strode [halfline]
committed Details | Review

Description Gert Kulyk 2012-08-14 23:39:36 UTC
While I was trying to debug something else, I recognized that after an recent update of gdm (currently 3.5.5 + git), the PostSession script is no longer executed. 

This is what simple-slave is saying when logging out (always similar):

gdm-simple-slave[29804]: DEBUG(+): GdmSession: Emitting 'session-exited' signal with exit code '0'
gdm-simple-slave[29804]: DEBUG(+): Writing logout record
gdm-simple-slave[29804]: DEBUG(+): using ut_type DEAD_PROCESS
gdm-simple-slave[29804]: DEBUG(+): using ut_tv time 1344986006
gdm-simple-slave[29804]: DEBUG(+): using ut_pid 29897
gdm-simple-slave[29804]: DEBUG(+): using ut_id :0
gdm-simple-slave[29804]: DEBUG(+): using ut_host :0
gdm-simple-slave[29804]: DEBUG(+): using ut_line :0
gdm-simple-slave[29804]: DEBUG(+): Writing wtmp logout record to /var/log/wtmp
gdm-simple-slave[29804]: DEBUG(+): GdmSimpleSlave: session exited with code 0
gdm-simple-slave[29804]: DEBUG(+): slave finished
gdm-simple-slave[29804]: DEBUG(+): GdmSimpleSlave: Stopping simple_slave
gdm-simple-slave[29804]: DEBUG(+): GdmSlave: Stopping slave
gdm-simple-slave[29804]: DEBUG(+): GdmSession: Closing session
gdm-simple-slave[29804]: DEBUG(+): GdmSession: Stopping all conversations
gdm-simple-slave[29804]: DEBUG(+): GdmSessionWorkerJob: Stopping job pid:29888
gdm-simple-slave[29804]: DEBUG(+): GdmCommon: sending signal 15 to process 29888
gdm-simple-slave[29804]: DEBUG(+): GdmSessionWorkerJob: Waiting on process 29888
gdm-simple-slave[29804]: DEBUG(+): GdmCommon: process (pid:29888) done (signal:15)
gdm-simple-slave[29804]: DEBUG(+): GdmSessionWorkerJob: SessionWorkerJob died
gdm-simple-slave[29804]: DEBUG(+): GdmSession: Disposing session
gdm-simple-slave[29804]: DEBUG(+): GdmSession: Closing session
gdm-simple-slave[29804]: DEBUG(+): GdmSession: Stopping all conversations
gdm-simple-slave[29804]: DEBUG(+): GdmServer: Stopping server
gdm-simple-slave[29804]: DEBUG(+): GdmCommon: sending signal 15 to process 29807
gdm-simple-slave[29804]: DEBUG(+): GdmServer: Waiting on process 29807
gdm-simple-slave[29804]: DEBUG(+): GdmCommon: process (pid:29807) done (status:0)
gdm-simple-slave[29804]: DEBUG(+): GdmServer: Server died
gdm-simple-slave[29804]: DEBUG(+): GdmSignalHandler: Removing handler 10: signum=11 0x80529a0
gdm-simple-slave[29804]: DEBUG(+): GdmSlave: Stopping slave
gdm-simple-slave[29804]: DEBUG(+): GdmSignalHandler: Finalizing signal handler
gdm-simple-slave[29804]: DEBUG(+): Slave finished
Comment 1 Gert Kulyk 2012-09-06 01:39:02 UTC
In daemon/gdm-simple-slave.c:

on_session_exited () self->priv->session_is_running is set to false before gdm_slave_stop () is run, where the code lives that is executing the PostSession script. When self->priv->session is false, gdm_slave_run_script () is never getting executed. So if a session exits normally, PostSession/Default is never getting executed. Is this the intended behaviour?
Comment 2 Ray Strode [halfline] 2012-09-06 17:54:23 UTC
no, we've recently reworked how stop handling is done, this is probably fall out from that.
Comment 3 Ray Strode [halfline] 2012-09-06 17:55:12 UTC
I think this should do it:

360772d slave: don't prematurely set is_running to FALSE

Please reopen if you continue to hit issues.
Comment 4 Ray Strode [halfline] 2012-09-06 17:55:14 UTC
Created attachment 223679 [details] [review]
slave: don't prematurely set is_running to FALSE

When the session ends we

1) set the session id to NULL
2) set is_running to FALSE
3) call gdm_slave_stop which
4) runs the PostSesssion script if is_running is true
5) sets is_running to FALSE

4) will always fail because of 2, and 2 is unnecessary because of 5.

This commit defers settings is_running to false until gdm_session_stop.

Spotted by Gert Kulyk
Comment 5 Gert Kulyk 2012-09-06 21:01:24 UTC
Yeah, your patch fixes the issue. Thank you!
Comment 6 Ray Strode [halfline] 2012-09-06 21:06:09 UTC
just noticed in comment 2 i wrote "no," like i was disagreeing with you, but i actually meant to write "note,"