Welcome to Gaia! :: Ubuntu 9.10 (See 7th post for current question.) | Forum

Register FaceBook Login Login

 

 
GST

Welcome to Gaia's forums, where millions of members gather to discuss random stuff, make new friends,
complain about life, argue about nothing, laugh at dumb pictures, discuss serious issues and/or curse like sailors.

Lurking is creepy. Quit skulking in the shadows and join the conversation!

Register to reply

Advertisement
Tags: ubuntu  always  counts  down  untill 
Share:  
forum:43, topic:55834981
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"?
     
Dream Avatar


Seriously, don't PM me for tech help and don't offer me rewards. I don't want your gold, and I'm mainly a lurker that helps with limited topics.
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.

http://img402.imageshack.us/img402/7052/bildschirmfotok.th.png

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?
     
Random PMs will be deleted and senders added to my ignore list. That includes posters in threads I participate in. If I don't know you, ignored. Period.

v4sw7+8CFHJMPRSUY$hw6/8ln5pr7FOPS$ck6ma7u8FLOw5GVm5l7DGUi20e4t3ABDEFGMNSTVb6DHMORTen7aNs0Br2p-5.62/-4.26g8ACGHMOPRTVZ hackerkey.com
http://imagegen.last.fm/lastfmblue/recenttracks/4/greyfade.gif
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 ...
 
     
 
Bump?
     

---
Much thanks to Daddy Long Legs for the Fausto's Bottle
while its counting down just click *shut down*
 
     

Quick Reply

Enter both words below, separated by a space:

Can't read the text? Click here

Submit

We will be phasing out support for your browser soon.

Please upgrade to one of these more modern browsers.