stop/start KDE from the command line (Terminal)

hi

Howto stop/start KDE from the command line (Terminal) on opensuse 11.4?

I fail to understand your question. When one is in a GUI session that uses KDE as desktop environment, one stops using it by loging out. Is loging out not using the icons, but with a command from a started Konsole what you want?

No, I mean to stop/start KDE from the command line using CTRL-ALT-F1.


qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout 0 0 0

from a terminal like konsole or xterm will do it.


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.5 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.5 | nVidia
ION | 3GB Ram

martin_helm wrote:

>


> qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout 0 0 0
> 

> from a terminal like konsole or xterm will do it.
>
or if you speak about a tty doing “init 3” as root will terminate kde (but
this is brute force it is not the same as a clean logout) and “init 5” as
root will restart kdm.


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.5 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.5 | nVidia
ION | 3GB Ram

Using Ctrl-Alt-F1 does not stop and certainly not start KDE. It is interpreted by the X server and changes your view to logical console #1. Nothing is done to your KDE session (when you have one running at logical screen #7). It is unharmed, you only can not see it (until you do Ctrl-Alt-F7).

Your question does not seem to be in line with the facts. Maybe you can explain better what you want, or even why you want it. This will give us a change to think together with you about a solution (when one is available).

On 07/10/2011 03:06 PM, upiter wrote:
>
> No, I mean to stop/start KDE from the command line using CTRL-ALT-F1.

ok, i think i might have guessed what you want…

is this close to what you want to do: while logged into KDE as yourself,
you want to log out of KDE and then back in either as yourself or as
another user? and, you wish to do that without using the easy KDE menus
to Leave > Logout (which is the very very easy way to stop/start KDE
without going to the command line)…

is that what you want to do?

ok, try this:

-use Ctrl+Alt+F1

-in the resulting terminal log in as root

-once logged in and before you do anything else use Ctrl+Alt+F7 to get
back to KDE to prove to yourself that KDE is still running

-then use Ctrl+Alt+F1 to get back to the terminal where you are still
logged in as root, and

-type in and enter this code to stop KDE


init 3

NOTE: everything you had open in the KDE session has now been closed,
and if you were in the midst of a download, or writing a letter to Aunt
Tillie they have been interrupted and probably spoiled.

-when everything has stopped moving you may have to press enter once to
get back to roots command line…

-then again use Ctrl+Alt+F7 and confirm that KDE is dead…

-then, go back with Ctrl+Alt+F1 to root’s command line and type in and
enter this code to start KDE again


init 5

KDE will open up in front of your eyes and you can then use Ctrl+Alt+F1
to go back and see your root command line (and, if it were me i’d type
“exit” and enter just to close it) and Ctrl+Alt+F7 to get back to KDE…

remember the GUI’s Leave > Logout is a lot easier!


DD
-Caveat-Hardware-Software-

Sorry my questions was not so clear, I’d like to kill KDE, for example on Ubuntu I can do it using this simple command to stop and start Gnome:


# /etc/init.d/gdm stop
# /etc/init.d/gdm start

upiter wrote:

>
> DenverD;2362952 Wrote:
>>
>>
>> remember the GUI’s Leave > Logout is a lot easier!
>>
>>
>
>
> Sorry my questions was not so clear, I’d like to kill KDE, for example
> on Ubuntu I can do it using this simple command to stop and start Gnome:
> Code:
> --------------------
>
> # /etc/init.d/gdm stop
> # /etc/init.d/gdm start
> --------------------
>


sudo /usr/sbin/rckdm stop
sudo /usr/sbin/rckdm start


PC: oS 11.3 64 bit | Intel Core2 Quad Q8300@2.50GHz | KDE 4.6.5 | GeForce
9600 GT | 4GB Ram
Eee PC 1201n: oS 11.4 64 bit | Intel Atom 330@1.60GHz | KDE 4.6.5 | nVidia
ION | 3GB Ram

May I take the freedom to addd something to tthis?

Please next time when you want to ask something take the time to explain extensive what you want to do and why, what your situation is and what you tried and did not work. Illustrated with computer output like error messages, etc. Never assume that what you do is a logical thing to do that others do all the time and thus that those others will understand your problem with a scanty description.

And a little warning. I do not know why you want to stop the Display Manager (and with it a posibly running X session) so abruptly, but most people here never ever got the idea to do this. It is something you do only in very exceptional circumstances. Thus it might be usefull for you to explain why you have the need to do this. It may leed to advising you a more normal solution for your real problem.

On Mon, 11 Jul 2011 13:36:02 +0530, hcvv <hcvv@no-mx.forums.opensuse.org>
wrote:

>
> May I take the freedom to addd something to tthis?
>
> Please next time when you want to ask something take the time to
> explain extensive what you want to do and why, what your situation is
> and what you tried and did not work. Illustrated with computer output
> like error messages, etc. Never assume that what you do is a logical
> thing to do that others do all the time and thus that those others will
> understand your problem with a scanty description.
>
> And a little warning. I do not know why you want to stop the Display
> Manager (and with it a posibly running X session) so abruptly, but most
> people here never ever got the idea to do this. It is something you do
> only in very exceptional circumstances. Thus it might be usefull for you
> to explain why you have the need to do this. It may leed to advising you
> a more normal solution for your real problem.
>

i also don’t understand why, in what situation, the OP wants to stop his
KDE session via the command line. communication problem, most likely.

i was in that situation a few times, when i was logged into a KDE session
remotely via SSH and wanted to restart the affected processes after an
update that included many KDE libraries. i neither wanted to reboot the
machine, nor take the trouble to restart all affected processes manually,
and looked for a command line solution. i found the same that martin helm
already stated in this thread:


qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout 0 0 0

which works fine. another solution, also provided by martin helm here, may
do things more abruptly, but works as well:


sudo /usr/sbin/rckdm stop
sudo /usr/sbin/rckdm start

so me thinks this problem is solved, whatever reasons the OP may have to
want this solution instead of simply logging out of his graphical
session…


phani.

On Mon, 11 Jul 2011 14:25:39 +0530, phanisvara <listmail@phanisvara.com>
wrote:

>
>


> qdbus org.kde.ksmserver /KSMServer org.kde.KSMServerInterface.logout 0 0
> 0
> 

>

by the way, a handy utility to find such qdbus commands, which wasn’t
known to me at the time, is

qdbusviewer

it allows to browse the properties & functions qdbus makes available to
the command line. specially interesting since these seem to change with
every (?) KDE release.


phani.

I’d like to do this, because I need to run Xorg -configure to create xorg.conf and cannot if X windows is running.
The solution of my problem seems to be init 3 to stop X windows.

On 07/11/2011 04:36 PM, upiter wrote:
>
> I’d like to do this, because I need to run Xorg -configure to create
> xorg.conf

then your first post could have asked: How do i create xorg.conf?

or even: maybe i need to create xorg.conf because [fill in details],
what do you think, and how should i do it or what?


DD
-Caveat-Hardware-Software-

Yes, as you now redefine youre problem you have the correct solution to it also.
Also trying to use the correct expressions (like you want to stop X and not to log out of KDE) will help enormously in the understanding. I admit that not knowing the correct words is not unusual for a beginner, but nevertheless, try it.

I hope you see that in being more talkative and telling more about what you realy want might have helped us in helping you.

It could still be the case that telling why you want to make an xorg.conf will bring forward a good solution for your real problem. The more while one day or another xorg.conf might vanish.

The main problem is, after 10 minutes I cannot correct my postings to give some more informations, ask in other way, even correct the subject.
Maybe I don’t like my first posting by my self and really would like to correct my question, try to ask in other way, that people who help can correctly understand what I want to do.
If I every time must answer to my postings with other questions or different informations can sometimes provide some confusion.
In my opinion the main posting should be clearly enough, so other people, I mean those not answering these questions, know what this posting mainly intended.
Second problem, if English is not mother language and you cannot find a good forum in your language, then is sometimes difficult to find the correct words.

I understand your frustration, but think of it another way.
You can edit your post for about five minutes after you posted. That should be enough for correcting some typos you did not see while making the post.
When you use the advanced editor, you can allways let show you a preview of what you did and thus, with some effort, correct your post until it fits you.

You should anyhow think before you start a thread about what your problem is and how to describe it to others who do not know you, nor your knowledge level, nor your system. That starts with choosing the most fitting forum. Then comes a good descriptive title that will draw the attention of the correct people. Then comes the problem description, which normaly should contain three things:
1 ) what did you do;
2) what did you expect to happen;
3) what happened in reality.
This should be accompanied by real computer text, idealy the complete CLI session of what you did. Make only short comments and let the computer speak for the facts. GUI problems are more difficult, bu there are possibilities to post links to screen capture images. In short provide information, do not jump to conclusions, but let the others come to conclusions.

This almost never can only cover one and a half line as you started this one. English may not be your first langauge (it isn’t mine also), do not be afraid of making errors. Make short but usefull sentences and again: let the computer speak for itself.

I often first compose my text with an editor localy, reading it again and again, trying to understand how somebody not in the least involved in my environment would read and understand it. After I am satisfied, I will post and enter the text with copy/past.

Once you have started a thread, a discussion starts. Such a discussion may be read in a year time by somebody searching the forums for the same or a similar problem. I hope it is clear to you that changing say your post #1 will make the whole sequence of postings unintelligable by any newcomer to the thread. This is the main reason that the forums do not allow changes.

Now when you think you want to reformulate a new problem (how much it may be related to this one), do so. Do not stick to this one because you need a new, fitting title to draw different people to look in to your new problem.

I hope this helps in your understanding of how these forums work.

On 07/13/2011 01:36 PM, upiter wrote:

> The main problem is, after 10 minutes I cannot correct my postings to
> give some more informations, ask in other way, even correct the subject.
> Maybe I don’t like my first posting by my self and really would like
> to correct my question, try to ask in other way, that people who help
> can correctly understand what I want to do.

no, the problem is not that you can’t edit more than 10 minutes after
you post! the problem is that you don’t edit before you post…

use LibreOffice (or KWrite, or whatever you want) to write, edit,
rewrite, reedit, think, translate, spell check, rethink and rewrite some
more and THEN open a forum reply window and copy in and paste the edited
message…

fini, no need to edit even one minute after posting.


DD
Caveat-Hardware-Software

openSUSE®, the BMW® of operating systems!

I try my best, but If the first posting is not clear enough, perhaps forgotten or missing some explaination, or you didn’t understand my question, next time pls do not wonder, just go ahead and write what’s not clear.
Even if the posting subject is not clear enough, the forum admin should correct it.
Sometimes, something clear for me couldn’t be clear for someone who reads a posting…

Thank you so much for this. I have been looking for how to do this as well. In my case, with certain settings in ~/.kde4/share/config/kwinrc which I have not been able to identify exactly, KDE just freezes upon login. I have to go to ctrl+alt+f1 and delete ~/.kde4/share/config/kwinrc and logout/login, and since KDE is unresponsive I could not log out, and I have been rebooting, which is a pain. $ init 3 -> $ init 5 worked like a charm!

-Joon