Posts: 253
mariel77
Joined: 13 Sep 2007

18 Sep 2007, 17:29 #1

Is there a way to use macondo's"sudo and ratpoison compilation" technique to shutdown using sudo directly from the fluxbox menu or a rox desktop icon?
See this thread:

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.mepislovers.org/forums/showthread.php?t=8954"
linktext was:"http://www.mepislovers.org/forums/showthread.php?t=8954"
====================================
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#2
This has been added to the upcoming beta3.
This is what I did. I think it works better for a livecd, but it also works on installed antiX.

Edit /etc/sudoers file as root to add:

%users ALL=(root) NOPASSWD: /sbin/halt
%users ALL=(root) NOPASSWD: /sbin/reboot

Then add these two lines to the fluxbox menu:

[exec] (Reboot) {sudo reboot}
[exec] (Shutdown) {sudo halt}

You will probably need to restart fluxbox or X for it to work (maybe even reboot)
Posts: 253
mariel77
Joined: 13 Sep 2007
#3
Thanks! This works great. A restart was all that was needed.
anticapitalista wrote: Edit /etc/sudoers file as root to add:
%users ALL=(root) NOPASSWD: /sbin/halt
%users ALL=(root) NOPASSWD: /sbin/reboot
I was missing"(root)" in my addition to /etc/sudoers.
Posts: 319
impuwat
Joined: 13 Sep 2007
#4
__{{emoticon}}__ Works for me as well! Took a little googling to figure out the"^" meant Control key for saving changes in Nano. Then discovered I had to temporarily edit out my fluxbox key line for Opera (Control O) so I could save the changes to sudoers in Nano.

All in all another good lesson. Thanks for all the tips and patience. You guys are so advanced I feel like the annoying little brother that's always tagging along. But still tagging along and continuing to learn.
Posts: 253
mariel77
Joined: 13 Sep 2007
#5
Yeah, I had to learn to use nano too, but I like it a whole lot more than vi. __{{emoticon}}__

You can use a gui editor to edit config files this way:
Open Terminal.
Enter"sux" instead of"su" - no quote marks.
Enter root password.
Enter the name of the gui editor (or any program),"leadfpad" for instance.
Then you can edit and save the config file.

I added an AdminLeafpad line to my fluxbox menu too., as anticapitalista suggested in the MepisLovers forum.
Posts: 319
impuwat
Joined: 13 Sep 2007
#6
Thanks for the great tip __{{emoticon}}__ Just tried it out.

I will go back and dig around for the tip on adding an AdminLeafpad line to my fluxbox menu.
Posts: 253
mariel77
Joined: 13 Sep 2007
#7
I should have said how.

Add this line to /etc/sudoers:
%users ALL=(root) NOPASSWD: /usr/bin/leafpad

Right click to get the fluxbox menu and select Fluxbox > File Editing > Menu.
Add this line somewhere; I added mine to the top section:
[exec] (AdminLeafpad) {sudo leafpad}
Posts: 319
impuwat
Joined: 13 Sep 2007
#8
I assumed that was the procedure but wanted to check the forum to make sure.

AntiX is humming along like a Swiss watch surrounded by sundials. I'm a little torn between wanting to maintain that solidity as opposed to jumping in the middle and tinkering to continue my ongoing education.

I finally settled on saving my personal data to a USB drive (with Fluxbox hot key access thanks to another great Anticapitalista tip) so I can play and experiment with AntiX with a little more peace of mind. Will probably just put AntiX on several computers, when the latest final version is released, and use one for fiddling with and experimenting with the latest Beta's.

Thank you for saving me a little digging. Appreciate all the help.
anticapitalista
Posts: 5,955
Site Admin
Joined: 11 Sep 2007
#9
Here's another way to do it, if you like to edit files via rox-riler.

Add this line to /etc/sudoers
%users ALL=(root) NOPASSWD: /usr/bin/rox

Add to .fluxbox/menu or .fluxbox/keys ie for .fluxbox/keys (hit F10)
None F10 :ExecCommand sudo rox

Restart fluxbox (in menu)

Now when you hit F10 key, rox-filer should open as root.
Then go to a file you like to edit ie /etc/X11/xorg.conf
Right-click on it and"set run action" to whatever app you like ie either type leafpad for gui or aterm -e nano for cli in the space (don't forget to leave a gap/space before the"$@")