LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-11-2015, 09:15 AM   #1
Sareth
LQ Newbie
 
Registered: Feb 2015
Distribution: Slackware 14.1
Posts: 4

Rep: Reputation: Disabled
Starting Xorg on same VT as login VT while keeping active consolekit session


Hi,

I've recently installed Slackware 14.1 on my Thinkpad using XFCE and it works great; I'm however trying to figure out how to start Xorg on the same virtual terminal I login to. Xlock isn't very effective when kids know how to switch from TTY7, and Ctrl+C xorg...

Google gave me this code snippet to put in ~/.xserverrc:

Code:
#!/bin/bash

TTY=${TTY:-$(tty)}
TTY=${TTY#/dev/}

if [[ $TTY != tty* ]]; then
  printf '==> ERROR: invalid TTY\n' >&2
  exit 1
fi

printf -v vt 'vt%02d' "${TTY#tty}"

exec /usr/bin/X -nolisten tcp "$vt" "$@"
And it works fine except that my consolekit session isn't active

Code:
ck-list-sessions
...
active = FALSE
meaning XFCE stuff like suspend buttons stop working. I've found a bug report which I'm unsure is related:

https://bugs.freedesktop.org/show_bug.cgi?id=29920

so I've modified /etc/rc.d/rc.consolekit to include

Code:
openvt -c 63 -f -- console-kit-daemon --no-daemon &
But that didn't help. I've weighed disabling consolekit and using group overrides for policykit. Disabling TTY switches seems a bit drastic, as I like using that functionality myself. Suggestions?

Thanks,
Sareth
 
Old 02-11-2015, 09:21 AM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,096

Rep: Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173
with my desktop workstation I use xlock and I launch X from the console with
Code:
exec startx
this way, switching back to the console, it can only be killed but no shell prompt is available...
 
1 members found this post helpful.
Old 02-11-2015, 09:58 AM   #3
dowelld
Member
 
Registered: Jan 2005
Location: Somerset, UK
Distribution: Slackware
Posts: 62

Rep: Reputation: 12
Xorg.conf

Option DontVTSwitch boolean

See the man page:
http://linux.die.net/man/5/xorg.conf
 
1 members found this post helpful.
Old 02-12-2015, 04:25 AM   #4
Sareth
LQ Newbie
 
Registered: Feb 2015
Distribution: Slackware 14.1
Posts: 4

Original Poster
Rep: Reputation: Disabled
I've created the following alias in ~/.bashrc

Code:
alias startx='exec startx > $HOME/.xorg.log 2>&1'
now killing Xorg returns to the login screen, and I get to keep VTSwitch. I'm still curious on ConsoleKit's odd behaviour, but I'll mark this [Solved]. Thanks for the input.
 
Old 02-15-2015, 06:13 AM   #5
Sareth
LQ Newbie
 
Registered: Feb 2015
Distribution: Slackware 14.1
Posts: 4

Original Poster
Rep: Reputation: Disabled
I've found a solution to the initial consolekit problem: issuing keeptty to xinit. I'm using a replacement startx that looks as follows:

Code:
#!/bin/sh

TTY=${TTY:-$(tty)}
TTY=${TTY#/dev/}

if [[ $TTY != tty* ]]; then
  printf '==> ERROR: invalid TTY\n' >&2
  exit 1
fi

printf -v vt 'vt%02d' "${TTY#tty}"

if [[ -r $HOME/.xinitrc ]]; then
  client=$HOME/.xinitrc
else
  client=/etc/X11/xinit/xinitrc
fi

exec xinit $client -- -keeptty -nolisten tcp "$vt" "$@" 2>> $HOME/.xsession-errors
ftp://www.x.org/pub/X11R6.8.0/doc/Xorg.1.html

Last edited by Sareth; 02-15-2015 at 06:17 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
starting new session / login screen from terminal Cinematography Linux - Software 10 10-10-2019 11:43 PM
[SOLVED] Slackware 13.1 beta1 "Cannot open ConsoleKit session: Unable to open session..." fl0 Slackware 2 05-13-2010 09:37 AM
Apache - Tomcat How to use session ID to confirm an active user session? klroller Linux - Server 4 10-08-2009 09:43 PM
Boot hangs at starting X11 session after changing mouse settings in xorg.conf drlouis Slackware 9 09-10-2004 12:02 AM
Keeping my screen active Stephanie Linux - General 9 07-15-2002 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration