Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostSession-Script gets terminated by SIGKILL (mint 18 MATE) #188

Open
coffeelover opened this issue Sep 22, 2016 · 10 comments
Open

PostSession-Script gets terminated by SIGKILL (mint 18 MATE) #188

coffeelover opened this issue Sep 22, 2016 · 10 comments

Comments

@coffeelover
Copy link

If i use a PostSession-Script in stock Mint 18 MATE, it will be killed on shutdown or restart while it's running

Sep 22 14:16:10 alice systemd-logind[700]: System is rebooting.
Sep 22 14:16:10 alice mdm[1046]: DEBUG: Sending SESSPID == 0 for slave 1046
Sep 22 14:16:10 alice mdm[1029]: mdm[1029]: DEBUG: Got SESSPID == 0
Sep 22 14:16:10 alice mdm[1046]: DEBUG: mdm_slave_session_stop: bob on :0
Sep 22 14:16:10 alice mdm[1046]: DEBUG: mdm_slave_session_stop: Running post session script
Sep 22 14:16:10 alice mdm[1029]: DEBUG: Got SESSPID == 0
Sep 22 14:16:10 alice mdm[1046]: DEBUG: Forking extra process: /etc/mdm/PostSession/Default
Sep 22 14:16:10 alice mdm[1029]: mdm[1029]: DEBUG: mainloop_sig_callback: Got signal 17
Sep 22 14:16:10 alice mdm[1029]: mdm[1029]: WARNING: mdm_cleanup_children: child 1046 crashed of signal 1
Sep 22 14:16:10 alice mdm[1029]: mdm[1029]: WARNING: mdm_cleanup_children: Slave crashed, killing its children
Sep 22 14:16:10 alice mdm[1029]: mdm[1029]: DEBUG: mdm_sleep_no_signal 1
Sep 22 14:16:10 alice mdm[1029]: DEBUG: mainloop_sig_callback: Got signal 17
Sep 22 14:16:10 alice mdm[1029]: WARNING: mdm_cleanup_children: child 1046 crashed of signal 1
Sep 22 14:16:10 alice mdm[1029]: WARNING: mdm_cleanup_children: Slave crashed, killing its children
Sep 22 14:16:10 alice mdm[1029]: DEBUG: mdm_sleep_no_signal 1
Sep 22 14:16:10 alice systemd[1]: Stopping Session c1 of user bob.

The problem is easily reproducable on a stock system, just insert some sleep in the /etc/mdm/PostSession/Default-File:

#!/bin/bash
echo "$(date) start" >> /var/log/post_debug.log
logger -i post-session "PID: $$ - Shutting Down"
sleep 60
echo "$(date) stop" >> /var/log/post_debug.log
exit 0

The Log statement will sometimes work, but mostly the script gets killed before that.

If i comment the function call for mdm_slave_quick_exit (exit_code_to_use); in line 697 of daemon/slave.c (in function term_session_stop_and_quit) the post session scripts gets executed until it does an exit by itself.

@clefebvre
Copy link
Member

Hi,

Do you know if this is a regression? I.e. did the issue occur in Mint 17.x?

@coffeelover
Copy link
Author

Hi,

the issue did not occur in Mint 17.x.

@clefebvre
Copy link
Member

I couldn't find the cause for the regression (between Mint 17 and Mint 18).

I'd be interested to know how you came to suspect mdm_slave_quick_exit (exit_code_to_use), please share your analysis on this.

In any case I was able to reproduce the issue and confirm the fix.

I tested as many use cases as I could and couldn't find any regression.

@DronKram
Copy link

Hello.
I installed clean Mint 18 mate. Used "apt-get source" to get mdm souces. Next I comment out line 697 of daemon/slave.c, recompiled package with "debuild -us -uc". After that I try to install package with "dpkg -i", also try to replace mdm binary, but nothing changed. Reboot and Shutdown commands kills /etc/mdm/PostSession/Default script while it's running without waiting.
I do something wrong or this fix not fixes issue?

@DronKram
Copy link

DronKram commented Dec 7, 2016

Any updates?

@DronKram
Copy link

I also tried 2.0.15 package on clean Mint18 installation, but this is not fixed issue.

@DronKram
Copy link

DronKram commented Dec 18, 2016

I installed 18.1 Serena and it has this issue too.

@clefebvre clefebvre reopened this Dec 21, 2016
@clefebvre
Copy link
Member

Reopening the issue and reverting the commit then.

@Crams
Copy link

Crams commented Dec 22, 2016

Hi,

commenting out mdm_slave_quick_exit (exit_code_to_use); did not work in my tests.

I noticed that sometimes the cups-browsed.service need up to 2 minutis to stop.

In this case a /etc/mdm/PostSession/Default with a sleep of 60 seconds gets (often) executed.

I recommend a sleep higher than 120s and a disabled cups-browsed.service for the testing environment.

To disable the cups-browsed.service just do this:
sudo systemctl stop cups-browsed.service
sudo systemctl disable cups-browsed.service

@Steschil
Copy link

2.0.16 has the same issue, patching does not make it work.
To repeat, the /etc/mdm/PostSession/Default is not working as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants