You are not logged in.

Krasu

Beginner

  • "Krasu" started this thread

Posts: 30

Location: Republic of Belarus

  • Send private message

1

Tuesday, May 10th 2005, 5:14pm

shutdown command

which console command is analog of "KMenu->Logout->Turn off computer" ?

jacek

Trainee

Posts: 105

Location: Warsaw, Poland

Occupation: Student

  • Send private message

2

Tuesday, May 10th 2005, 7:06pm

RE: shutdown command

Source code

1
# shutdown -h now

Krasu

Beginner

  • "Krasu" started this thread

Posts: 30

Location: Republic of Belarus

  • Send private message

3

Tuesday, May 10th 2005, 9:34pm

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 ?

wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

4

Tuesday, May 10th 2005, 11:18pm

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.
Live and let live - use the search engine.
"Use the docs Luke, use the docs!"

Krasu

Beginner

  • "Krasu" started this thread

Posts: 30

Location: Republic of Belarus

  • Send private message

5

Tuesday, May 10th 2005, 11:38pm

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)


wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

6

Tuesday, May 10th 2005, 11:54pm

Quoted

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.
Live and let live - use the search engine.
"Use the docs Luke, use the docs!"

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

7

Wednesday, May 11th 2005, 2:11pm

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

Krasu

Beginner

  • "Krasu" started this thread

Posts: 30

Location: Republic of Belarus

  • Send private message

8

Wednesday, May 11th 2005, 3:43pm

Thanks :)