You are not logged in.

#1 2004-05-06 08:18:42

Moritz
Member
From: Cologne, NRW, Germany
Registered: 2002-10-12
Posts: 166

Shutdown the system directly out of gnome

(Sorry for the long subject!)

I currently use gnome 2.6.1 and gdm 2.6. My gdm is allowed to shut down the system, but I need to logout of gnome before. Is there a chance to shutdown the system directly out of gnome?
BTW: I'm not able to configure the gdm out of gnome (the link at the startmenue doesn't work. If I remember correctly it says: no gdm running/found)

Regards,
Moritz

Offline

#2 2004-05-06 09:19:00

markj
Member
From: Wales, UK
Registered: 2004-03-02
Posts: 10

Re: Shutdown the system directly out of gnome

You could just open a terminal su then type shutdown -h 0 that will shut your system down

Offline

#3 2004-05-06 09:45:59

Moritz
Member
From: Cologne, NRW, Germany
Registered: 2002-10-12
Posts: 166

Re: Shutdown the system directly out of gnome

Well, that could work (right are not set, so it currently doesn't), but I want to create a gnome-box for a friend with no idea about computers... best would be a gnome-integrated button. lol

Offline

#4 2004-05-06 20:27:59

zezaz
Member
From: Bordeaux, France
Registered: 2004-04-26
Posts: 80
Website

Re: Shutdown the system directly out of gnome

Hi Moritz,

I have setup this on my ArchLinux box some time ago.

You may have remarked that, when you exit from a gnome session for the root login, 3 options are proposed (end of session, reboot, shutdown). I had seen on other distros that single users (not only root) can be proposed these 3 choices.

This is not the case on ArchLinux, to my knowledge it is a rather undocumented feature. I had to dig in the source code to find how to do it.

From what i remember, if you want to allow a login (say 'joecool') to shutdown/reboot your host, there are 2 steps:

1) enable joecool to halt your computer. He must be able to properly execute the 'poweroff' and 'reboot' commands, which in Arch are symlinks to /sbin/halt'. If you are in a hurry:

 chmod a+s /sbin/halt 

However, if you need more security, you could do things more properly.

2) type as root:

 mkdir -p /var/lock/console/joecool 

After that, joecool will be proposed the three choices (close session, reboot, shutdown) at the end of his gnome session.

To be complete, i guessed this from the code of logout.c in the gnome-session package.

I hope that i forgot nothing (i did this weeks ago), and that it did not change in gnome 2.6.1 (i am sticking with 2.6.0 at the moment).

Happy gnoming!

Offline

#5 2004-05-06 20:51:31

zezaz
Member
From: Bordeaux, France
Registered: 2004-04-26
Posts: 80
Website

Re: Shutdown the system directly out of gnome

zezaz wrote:

2) type as root:

 mkdir -p /var/lock/console/joecool 

Woops, 1 line was too short  smile . What i really did on my PC was:

 
mkdir -p /var/lock/console
touch joecool

Sorry   roll

Offline

#6 2004-05-07 01:24:57

ganlu
Member
From: ChongQing, China
Registered: 2004-01-04
Posts: 360

Re: Shutdown the system directly out of gnome

I did this way:
chmod +s /sbin/halt
mkdir /var/run/console
cd /var/run/console
touch yourusername
I don't know  why it's a little different with previous one, but it works.

Offline

#7 2004-05-07 07:39:26

zezaz
Member
From: Bordeaux, France
Registered: 2004-04-26
Posts: 80
Website

Re: Shutdown the system directly out of gnome

ganlu wrote:

chmod +s /sbin/halt
mkdir /var/run/console
cd /var/run/console
touch yourusername

The point is to create either /var/run/console/yourusername or /var/lock/console/yourusername, both work smile

Offline

#8 2004-05-07 09:38:39

Moritz
Member
From: Cologne, NRW, Germany
Registered: 2002-10-12
Posts: 166

Re: Shutdown the system directly out of gnome

hmm... I wonder why, but I still can't choose it:

[moritz@axis moritz]$ ls -l /var/lock/console/
insgesamt 0
-rw-r--r--  1 root root 0 2004-05-07 11:45 moritz
[moritz@axis moritz]$ ls -l /var/run/console/
insgesamt 0
-rw-r--r--  1 root root 0 2004-05-06 23:22 moritz
[moritz@axis moritz]$ ls -l /sbin/halt
-rwsr-sr-x  1 root root 8920 2003-09-29 18:51 /sbin/halt

Offline

#9 2004-05-08 23:38:11

ganlu
Member
From: ChongQing, China
Registered: 2004-01-04
Posts: 360

Re: Shutdown the system directly out of gnome

I notice you login as moritz, but under /var/lock/console there is "insgesam". What if you login as insgesam?

Offline

#10 2004-05-09 09:49:39

Moritz
Member
From: Cologne, NRW, Germany
Registered: 2002-10-12
Posts: 166

Re: Shutdown the system directly out of gnome

Oooopps... :oops:
Insgesamt means "total".

[root@axis root]# ls -al /var/lock/console/moritz
-rw-r--r--  1 root root 0 May  7 11:45 /var/lock/console/moritz
[root@axis root]# ls -al /var/run/console/moritz
-rw-r--r--  1 moritz users 0 May  6 23:22 /var/run/console/moritz
[root@axis root]# ls -al /sbin/halt
-rwsr-sr-x  1 root root 8920 Sep 29  2003 /sbin/halt

This should be better... sorry lol

Offline

#11 2004-05-10 20:14:46

zezaz
Member
From: Bordeaux, France
Registered: 2004-04-26
Posts: 80
Website

Re: Shutdown the system directly out of gnome

Sorry Moritz, it have no more hint on why you can't shutdown on your host.
However, regarding the following point:

Moritz wrote:

BTW: I'm not able to configure the gdm out of gnome (the link at the startmenue doesn't work. If I remember correctly it says: no gdm running/found)

i have had the same problem, when the package erroneously overwrote the /var/run/gdm.pid.

You should check if /var/run/gdm.pid is properly generated by the gdm daemon. On my setup it gives:

[zezaz@archie downloads]$ ls -l /var/run/gdm.pid
-rw-r--r--  1 root root 4 2004-05-10 20:55 /var/run/gdm.pid
[zezaz@archie downloads]$ cat /var/run/gdm.pid
401

401 being the process id of your gdm daemon.
If gdm.pid is not properly written by gdm, no app can dialog with the daemon, so you can't configure it with windowed applications.

Offline

Board footer

Powered by FluxBB