SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-02-15 11:59:11

sparky
#! Member
Registered: 2011-09-22
Posts: 66

[Solved]OpenBox menu: Running a command as root?

Hi ya all.

Im trying to customize my right click menu through obmenu but im having some difficulties..
I want to be able to execute leafpad as root so i type in the execute field:

sudo leafpad

but it aint work. i also tried "sudo leafpad" and 'sudo leafpad' with no result. what am i missing?

thanks alot and sorry for the "noobish" question.

Last edited by sparky (2012-02-15 14:25:24)

Offline

Be excellent to each other!

#2 2012-02-15 12:14:30

twau
New Member
From: ~
Registered: 2012-02-13
Posts: 5

Re: [Solved]OpenBox menu: Running a command as root?

Hi, try running gksudo leafpad

Offline

#3 2012-02-15 12:15:35

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,607

Re: [Solved]OpenBox menu: Running a command as root?

Probably the blind leading da blinder ... Shrugs, but ...


Might want to google a bit about gksudo or gksu for short vs sudo, gksu is generally from what I understand encouraged when dealing with a graphical thingy vs sudo being more appropriate to the terminal and CLI applications. By way of example ( opening a file as root) ... From what I understand this is correct ...

gksu leafpad /etc/fstab

Vs. this, which will often still work, but for whatever reasons is not adviseable ...

sudo leafpad /etc/fstab


My understanding I guess, when launching something graphical as root gksudo or gksu, when doing something as root in CLI(terminal) sudo. Am just curious why someone would want to open something like a text editor as root ?

Last edited by CBizgreat! (2012-02-15 12:41:11)


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

#4 2012-02-15 12:20:25

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: [Solved]OpenBox menu: Running a command as root?

^ you'd want to open a texteditor as root because you need to edit, per your example, /etc/fstab as root, right? seems to me that's the only reason for doing that. as to why you'd want to do that from the openbox menu: maybe the OP wants to have quick access to some root-owned file, which he needs to edit often?

btw, no idea about the difference between gksudo and sudo either... would like to have someone enlighten me here smile

Offline

#5 2012-02-15 12:20:33

kowloonboy
#! Junkie
Registered: 2011-10-13
Posts: 443

Re: [Solved]OpenBox menu: Running a command as root?

Use

gksu leafpad &

Also use su for console related stuff, and GUI related use gksu.


"To me, the extraordinary aspect of martial arts lies in its simplicity. The easy way is also the right way, and martial arts is nothing at all special; the closer to the true way of martial arts, the less wastage of expression there is." - Bruce Lee

Offline

#6 2012-02-15 12:26:13

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,607

Re: [Solved]OpenBox menu: Running a command as root?

Ahhh ... obviously could be a myriad of reasons no doubt rhowaldt. smile Definitely don't claim to be a nix guru ... Was just kinda curious as to what exactly the OP's plans were for leafpad as root. Am definitely all for each persons operating system being theirs though. Think people can learn ALOT from breaking stuff too, if they desire ... Sheesh know I did often enough. One of the many great things about FOSS, a fresh start is only ever a reinstall away. wink


vll !

Last edited by CBizgreat! (2012-02-15 12:37:49)


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

#7 2012-02-15 14:00:22

Stanie
#! CrunchBanger
Registered: 2011-12-20
Posts: 225

Re: [Solved]OpenBox menu: Running a command as root?

rhowaldt wrote:

btw, no idea about the difference between gksudo and sudo either... would like to have someone enlighten me here smile

CBizgreat! is right

My understanding I guess, when launching something graphical as root gksudo or gksu, when doing something as root in CLI(terminal) sudo.

As I understand it gksu is a frontend to su and gksudo is a frontend to sudo. Their purpose is to run graphical commands that need root. Using sudo to run graphical programs can on a rare occasion mess up permissions on some files! Therefore it is strongly recommended to use gksu/gksudo for running programs with a GUI. Btw gksudo is or at least used to be symlinked to gksu. So imho su and gksu should always work but you can use sudo and gksudo only if you have added your user to sudoers - that is the case of pure debian not crunchbang obviously.

As to sparkys problem, wouldn't it be easier to just add one thunar custom action - something like

gksu "leafpad %f"

to open files in leafpad as root? Unless you want to create a file as root of course...


A secure alternative to Dropbox with complete privacy = SpiderOak. Join it using my referral and get a total of 3 GB to start with.

Offline

#8 2012-02-15 14:24:46

sparky
#! Member
Registered: 2011-09-22
Posts: 66

Re: [Solved]OpenBox menu: Running a command as root?

thank tou all for replying very good info here wink
gksu did the trick

Offline

#9 2012-02-15 14:27:02

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: [Solved]OpenBox menu: Running a command as root?

@Stanie: thanks for the explanation. still curious to know why exactly 'sudo' on a GUI-app would go wrong (i use it for Gedit all the time... maybe i've messed up my permissions smile)

@sparky: please remember to mark your thread 'Solved' by editing the first post.

Offline

#10 2012-02-15 23:01:38

CBizgreat!
#! Die Hard
Registered: 2011-07-27
Posts: 1,607

Re: [Solved]OpenBox menu: Running a command as root?

Can't really pt to anything concrete rhowaldt, but I'd seen the same thing saying, that sudo used with graphical apps could cause file permission headaches. So just seemed easier to go with gksu or gksudo

Here's a link I dug up by googling sudo vs gksudo ... This one looked good in terms of explaining the poss issues caused. Haven't actually ever encountered any problems, but mainly do try to stick with the convention of gksu or gksudo for graphical stuff and sudo etc etc for terminal and CLI use.



vll !

Last edited by CBizgreat! (2012-02-15 23:02:42)


Some common cbiz abbreviations. This will save me time and yet @ same time tell folks what the babble is supposed to mean.

Vll ! = ( Viva la gnu/Linux !)    Vl#!! = ( Viva la #! !)    Last but not least, UD ... OD ! = ( Use Debian ... or die !) tongue

Offline

#11 2012-02-16 05:25:41

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 3,257
Website

Re: [Solved]OpenBox menu: Running a command as root?

In CBizgreat!'s link, this seems to be the key issue:

These errors occur because sometimes when sudo launches an application, it launches with root privileges but uses the user's configuration file.


John     Please help us keep your forums manageable.
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo