LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-06-2009, 05:02 AM   #1
snoopy1
Member
 
Registered: Jun 2007
Posts: 44

Rep: Reputation: 15
Logging off KDE. How hard can it be?


I'm having a little problem and it's DOING MY NUT ...

I maintain a school network of Slack (current), KDE 4.22.
I need to be able to logoff all PC's at a certain time.

I set up SSHd with no root password authenticated to the server, so I can auto login to each workstation and exec commands.

KDE 4 can be logged off via the dbus-send command. This will only execute as the current user. I tried exporting the dbus session but it didn't work. Then I used who | cut etc to grab the user name and su'do'd the dbus command. This worked.

Phew I thought. Cracked it.

Except if a unsaved document is open it will ask the user what they want to do and they can cancel the logoff. ARGHHHHHHHH.

So how can I terminate/destroy/force logoff the X/KDE session, putting it back to KDM?

Your advice will be mucho appreciated

Andrew
 
Old 05-06-2009, 06:25 AM   #2
dxangel
Member
 
Registered: Nov 2008
Location: London, UK
Distribution: CentOS, RedHat, Ubuntu
Posts: 79

Rep: Reputation: 18
Quote:
Originally Posted by snoopy1 View Post
I'm having a little problem and it's DOING MY NUT ...

I set up SSHd with no root password authenticated to the server, so I can auto login to each workstation and exec commands.

Andrew
um do you think thats wise?

as for your other problem, i guess you could kill the window manager completely,but that would suck for the people actually using the pc's at the time.
 
Old 05-06-2009, 06:30 AM   #3
snoopy1
Member
 
Registered: Jun 2007
Posts: 44

Original Poster
Rep: Reputation: 15
Regarding SSH, it's authenticated (certs) in a secure envir so no problem.

Yes I have to terminate the session if they haven't logged off. I'm using Wall to issue reminders every minute then at 5 it should terminate.

So how do I terminate the KDE session and go back to KDM without any errors? If I terminate X then KDM fails as well.

Andrew
 
Old 05-06-2009, 11:34 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Well, if you have given your users adequate warning that the system is going down in 5,4,3,2,1 minutes, the sure-fire way to stop KDE3 is /etc/init.d/kdm stop as root. Users will loose data if they have "unsaved documents" and the like.

Then they'll only be left with a terminal login. Maybe you'll want to disable terminal logins as well?

To start KDE up again, as root, do /etc/init.d/kdm start

As I said, the above is for KDE3, I expect it's much the same for KDE4.
 
Old 05-06-2009, 12:58 PM   #5
snoopy1
Member
 
Registered: Jun 2007
Posts: 44

Original Poster
Rep: Reputation: 15
Do you know what the equivalent is for Slackware?

I'm close now, I do "killall kdm" and that works nicely, though I'd prefer to terminate properly if there is a way.
 
Old 05-06-2009, 01:06 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
Do you know what the equivalent is for Slackware?
Slack is just another distro like the rest (ducks!) so most startup / shutdown scripts should be the same or very similar (eg maybe a different path to the equivalent executable).

There should be something in /etc/init.d/* that refers to the KDM

Doesn't /etc/init.d/kdm stop work?

What happens if you issue that command (and I am not sure that it is at all "nice", but you warned your users about an imminent shutdown. Yes?)
 
Old 05-06-2009, 01:18 PM   #7
snoopy1
Member
 
Registered: Jun 2007
Posts: 44

Original Poster
Rep: Reputation: 15
Slackware has init scripts in /etc/rc.d, closest I can find is rc.4 (runlevel 4) which exec's KDM, but there is no stop command.

I did try "KDM stop" as root and nothing happened / no error/output.
 
Old 05-06-2009, 01:19 PM   #8
senseproof
Member
 
Registered: May 2009
Distribution: Fedora 10
Posts: 31
Blog Entries: 5

Rep: Reputation: 16
It may seem strange, but I get hung up on "doing things properly" too. Really what you are doing is wasting your time. killall kdm works fine, you might want to follow with a -9 if it doesn't die. Your task is to kill kde. Using kill to kill kde is a very appropriate solution.
 
Old 05-06-2009, 01:51 PM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
I did try "KDM stop" as root ...
I think you mean "I did try /etc/init.d/kdm stop" which is different.
Quote:
...and nothing happened / no error/output.
Then it worked
 
Old 05-06-2009, 02:35 PM   #10
snoopy1
Member
 
Registered: Jun 2007
Posts: 44

Original Poster
Rep: Reputation: 15
No, in slackware "kdm stop" doesn't do anything. Also, there is nothing in /etc/init.d as slackware doesn't use Fedora style init scripts.

I'm happy with "killall kdm" then.
 
  


Reply



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
Logging in to KDE FreeTinker Slackware 2 03-02-2008 08:52 PM
Files Acessed From Hard Drive logging Gary987 Linux - Software 3 07-31-2006 07:55 PM
kde logging problem matrixon Linux - Software 1 06-26-2005 12:24 AM
problem logging into KDE 3.1 tmaly SUSE / openSUSE 3 04-04-2005 02:19 PM
Logging into KDE, Debian Chris H Linux - General 17 02-22-2004 02:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:33 AM.

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