Welcome to Gaia! ::

Hello.
Installed Ubuntu 9.10 yesterday. It always counts down 60 seconds before it shuts down/reboots/whatever if i use the menu from the upper panel.

Can i change that?

(I'd add a picture to show what menu i am talking about but Photobucket doesn't seem to like it.)
imgshack it.

sudo shutdown -h now

Doesn't it give you a prompt and you can click "shut down now"?
Locrian Lucero
imgshack it.

sudo shutdown -h now

Doesn't it give you a prompt and you can click "shut down now"?
Yea, but i'd like a one-click (or perhaps one-double-click) option.

I always had the impression safety is for Windows and Linux is for real men (or women) people who know what they are doing.

User Image - Blocked by "Display Image" Settings. Click to show.

Edit: that sounded stupid, small change.
it should give you a window with options. click the "shut down" option. otherwise, it will wait the minute before shutting down on its own.

oh, and you should be able to add a better shut down button to the panel than the one in the screenshot.
LANth3r0
it should give you a window with options. click the "shut down" option. otherwise, it will wait the minute before shutting down on its own.

oh, and you should be able to add a better shut down button to the panel than the one in the screenshot.
Well, i do click the Shut Down option in the menu, and it counts down.
With the "better shut down button", do you mean that one that opens a dialog to shut down, reboot or whatever the last option was?

If this was Windows i would have added a shortcut to shutdown.exe by now and all would be well ...


Edit:
Oh, by the way, is there a possibility to run scripts that need elevated rights (sudo) by double-clicking them?
The20
Edit:
Oh, by the way, is there a possibility to run scripts that need elevated rights (sudo) by double-clicking them?
Yes, but it's considered a security risk to do so.

Normally, you should run a script or program with "gksudo" or "kdesudo". They have the same effect as "sudo" but give you a popup dialog.

You can run these commands on a script:
sudo chown root: scriptname.sh
sudo chmod u+s scriptname.sh
sudo chmod a+rx scriptname.sh

This (second command) sets the "sticky user" bit on the file permissions, so that when the file is executed (allowed by the third command) by an unprivileged user, it "sticks" to the permissions of the owner (first command) of the file.

This is how programs like sudo are able to temporarily give you root privileges. They're "sticky" as root, and then when they run the command they're given, the command is executed with an "effective" user ID of 0 or "root".

Again, it's a huge security problem because there's nothing keeping evil persons from taking advantage of it.

A better approach would be to edit your sudoers file:
sudo visudo
(This basically runs "vim /etc/sudoers" as root, but with a special secure configuration.)
Go down to the bottom of the file (you can press shift-G or use the arrow keys or the 'j' key to scroll down) then press 'o' to edit a new line and then add this line:
%admin ALL=NOPASSWD: /usr/bin/scriptname.sh
(Or, instead of %admin, your username. See "man sudoers" for syntax details.)
Press escape, then ZZ (or :wq) to save and quit. Then, the next time you type:
sudo scriptname.sh
it won't prompt for a password for this specific command.
Of course, this assumes you've given the script execute permissions and have given it the owner root with sane permissions: 0555

But I thought the logout dialog had a "shutdown now" button on it?
psychic stalker
The20
Edit:
Oh, by the way, is there a possibility to run scripts that need elevated rights (sudo) by double-clicking them?
Yes, but it's considered a security risk to do so.

Normally, you should run a script or program with "gksudo" or "kdesudo". They have the same effect as "sudo" but give you a popup dialog.

You can run these commands on a script:
sudo chown root: scriptname.sh
sudo chmod u s scriptname.sh
sudo chmod a rx scriptname.sh

This (second command) sets the "sticky user" bit on the file permissions, so that when the file is executed (allowed by the third command) by an unprivileged user, it "sticks" to the permissions of the owner (first command) of the file.

This is how programs like sudo are able to temporarily give you root privileges. They're "sticky" as root, and then when they run the command they're given, the command is executed with an "effective" user ID of 0 or "root".

Again, it's a huge security problem because there's nothing keeping evil persons from taking advantage of it.

A better approach would be to edit your sudoers file:
sudo visudo
(This basically runs "vim /etc/sudoers" as root, but with a special secure configuration.)
Go down to the bottom of the file (you can press shift-G or use the arrow keys or the 'j' key to scroll down) then press 'o' to edit a new line and then add this line:
­min ALL=NOPASSWD: /usr/bin/scriptname.sh
(Or, instead of ­min, your username. See "man sudoers" for syntax details.)
Press escape, then ZZ (or :wq) to save and quit. Then, the next time you type:
sudo scriptname.sh
it won't prompt for a password for this specific command.
Of course, this assumes you've given the script execute permissions and have given it the owner root with sane permissions: 0555

But I thought the logout dialog had a "shutdown now" button on it?
Thanks for the detailed answer smile

The first part would suffice. I don't mind putting in the password, but i didn't manage to run the script outside of a terminal yet.
But it doesn't seem work how i used it in the example below, does it?
gksudo <line break>
mount ...
mount ...
mount ...

(Come to think of it, this can't work, i need to sudo every single mount! Yea, don't mind me, i'm just being stupid here ...)

However, this doesn't seem to work either:
gksudo mount ...
gksudo mount ...

Two dialogs or windows are shown in the task bar for a split second, one after each other, but nothing seems to happen.

Currently i use a script that calls the script that does the mounting, that way it works like a charm.

script v1
mount ...
mount ...
...

script v2 (the file i double-click on)
gksudo /home/.../v1




Hm, with that other way i could add a script to shut the computer down and place it on the desktop, would solve those problems...

What exactly does "halted" mean in the quote below?
man shutdown
-h Requests that the system be either halted or powered off after it has been brought down, with the choice as to which left up to the system.


Oh, and how do i get out of the manpages in the terminal? Closing the terminal always gives me a warning that a process is running and pressing the usual buttons (ESC, Enter, Return, END, Space, CTRL C, etc.) doesn't seem to do anything. Nevermind that, 'q', who wouldn't have thought of it ...
while its counting down just click *shut down*

Quick Reply

Submit
Manage Your Items
Other Stuff
Get Items
Get Gaia Cash
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff