Dear visitor, welcome to KDE-Forum.org.
If this is your first visit here, please read the Help. It explains in detail how this page works.
To use all features of this page, you should consider registering.
Please use the registration form, to register here or read more information about the registration process.
If you are already registered, please login here.
shutdown command
which console command is analog of "KMenu->Logout->Turn off computer" ?
RE: shutdown command
|
Source code
|
1
|
# shutdown -h now
|
RE: shutdown command
I mean KDE command, which will run KMenu->Logout->Turn off computer
'shutdown' brings the system down even if there is no DE running. I tried
|
Source code
|
1
|
dcop kdesktop KDesktopIface logoutWithoutConfirmation
|
but it only restarts KDE ... Any ideas ?
DCOP probably (and hopefully) doesn't allow that. This way any KDE application could shut down your computer. I don't know how about you, but I'd be angry if something like that happened to me.
Hmm ... But programs can still call something like
|
Source code
|
1
2
3
|
KProcess pr;
pr << "shutdown" << "-h" << "now";
pr.start(KProcess::Block);
|
So, it doesn't make sense what to call - DCOP method or 'shutdown'
OK, as I understood, I cann't do what I want
Thanks.
This post has been edited 1 times, last edit by "Krasu" (May 10th 2005, 11:39pm)
Originally posted by Krasu
Hmm ... But programs can still call something like
|
Source code
|
1
2
3
|
KProcess pr;
pr << "shutdown" << "-h" << "now";
pr.start(KProcess::Block);
|
Yes, but they (the user that runs such a program) have to be allowed by the sysadmin to do that, but KDE probably does that as root or something like that and if you used dcop, it would probably execute with kwin owner's rights or even as root (again) so it would (again probably) be unstoppable.
|
Source code
|
1
|
dcop ksmserver ksmserver logout 0 0 0
|
Or use different values instead of 0 0 0
(Hint: API documentation of KApplication)
Cheers,
_
Qt/KDE Developer
Debian User
Thanks