Thomas Mathiesen’s Blog


Adding poweroff icon to Gnome desktop
April 30, 2009, 8:43 pm
Filed under: Linux

I have been trying to add a “shutdown icon” to the gnome desktop on Ubuntu 8.10. The goal is for the user to just double-click that icon, and the machine shuts down.
My issue was that triggering the /sbin/poweroff binary would only ask for my password:

myuser@mydesktop:/tmp$ sudo /sbin/poweroff
password:

So, I added myself to the /etc/sudoers file:
myuser ALL = NOPASSWD: /sbin/poweroff

and it simply DID NOT work!

I came across a post telling me why…
The reason is that /etc/sudoers is being read from the bottom and up. So, I was in a group that was mentioned on the bottom, which required passwords for everything. Now I move the line (myuser ALL = NOPASSWD: /sbin/poweroff) to the bottom of the file, and my gnome launcher works fine!


No Comments Yet so far
Leave a comment



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>