Scripting mdm/consolekit cleanup code

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

Scripting mdm/consolekit cleanup code

Postby titetanium on Fri Jul 06, 2012 12:12 am

Hello all,

I'm having trouble writing a cleanup script for mdm. Here's my issue: after 1st boot, mdm loads LXDE and I log in, everything works fine. I log out of my LXDE session and come back to the MDM login window. Here's the problem, the login window has shifted from vt7 to vt8. Logging back in works fine, no problems.
If I edit /etc/mdm/mdm.conf and add this line:
Code: Select all
[servers]
#0=Standard vt7
it forces mdm to use vt7 after logging out, which is what I wanted. But it brings a serious bug such that once I log in, suspend/hibernate as well as being able to modify my wireless connections, power settings are all grayed out/not working. Googling around points to consolekit as the culprit as it doesn't cleanup after itself after logging out. I noticed this also happens when restarting X using crtl-alt-backspace or switching to vt1, logging in as root and issuing init 3. FYI, my system is modified, I do not use debian's default of init 2 and runlevels 2-4 have mdm set to not start. Runlevel 5 has mdm set to start.

So here's what I'm attempting to do: create a script to kill consolekit and deallocate vt7 when logging out or restarting X then restart mdm which will restart consolekit and I can log in vt7 with suspend/hibernate, wireless and power controls working. I hope I'm not confusing anyone.

Here's a sample of my script:
Code: Select all
#!/bin/sh

touch S3
fgconsole > S3
  if S3=7 then
   killall consolekit
   deallocvt $S3
   rm S3
endif


If it looks good to those of u who are better at this, then all I need to know is where to put it so when i log out or X is killed, crashed or whatever, the script gets called before mdm reloads.

Any help?
titetanium
Level 2
Level 2
 
Posts: 71
Joined: Mon Jun 18, 2012 4:26 pm

Linux Mint is funded by ads and donations.
 

[SOLVED]Re: Scripting mdm/consolekit cleanup code

Postby titetanium on Fri Jul 06, 2012 3:06 am

Guys & Gals,

Forget the script. I didn't even need it. Basically, I inserted 3 lines directly into /etc/X11/Xreset and it works perfect now.
If anyone is interested, here are the lines I put in:
Code: Select all
killall console-kit-daemon
deallocvt 7
deallocvt 8

Put it between the line fi and exit 0 near the bottom of the file. Save and log out. To test, switch to console 1 and back to console 7 and the login manager is right where it belongs. Log in as user and everything works fine.

HTH
titetanium
Level 2
Level 2
 
Posts: 71
Joined: Mon Jun 18, 2012 4:26 pm


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 3 guests