You are not logged in.
So I've got an eclipse project that makes heavy use of pacman and thus needs to have root permissions.
Finding VM's to CPU intense I bought a small computer specifically for this project and remotely connect to it using NX.
The project (and thus eclipse) is installed and run on the remote computer.
The three options for running an eclipse project with root permissions I have come across so far are:
Don't
Run eclipse with `gksu`
Run sudo with external tools.
The first one is not an option.
The second one I've had success running the project with.
However, this causes the problem that I also run other applications with it that specifically needs a non-root user to run
which is impossible if I can run the application only by root.
The third one I am currently trying out, but run into the wall with.
My external tools settings:
When I try to run this I get the following error message in the console:
sudo: no tty present and no askpass program specifiedI've tried solving this problem by adding a no password exception for the script I'm trying to run in the sudoers config files, but to no avail.
/etc/sudoers.d/arkos.sudo
folatt ALL=(ALL) NOPASSWD:/home/folatt/workspace/arkos/kraken/krakendMod note: Converted img to url, Please see the Community Code of Conduct for acceptable image sizes -- WorMzy
Last edited by folatt (2016-06-12 14:52:46)
Offline
Did you try replacing /usr/bin/sudo with /usr/bin/gksu
Offline
Did you try replacing /usr/bin/sudo with /usr/bin/gksuGreat! I think this works, but I probably need to adjust my arguments.
...
Got it!:
"python2 krakend -e dev --config /etc/arkos/settings.json"Last edited by folatt (2016-06-11 12:51:32)
Offline
Can't you mock out pacman with a wrapper for development, and just run integration tests to make sure the real implementation works?
Offline
Can't you mock out pacman with a wrapper for development, and just run integration tests to make sure the real implementation works?
The project is an app store, so no.
I quickly figured out that I could run the subprocess.Popen pacman function with an added "gksu", as well. So now I can run the project in debug mode
.
I didn't make the project and I haven't gotten an answer yet from the author what his intentions are, but I can leave it like this, because the piece of code below is not part of the subproject I intend to work on.
def pacman(flags, pkgs=[], eflgs=[]):
# Subprocess wrapper, get all data
if not pkgs:
cmd = ["gksu", "pacman --noconfirm %s" % (flags)]
elif type(pkgs) == list:
cmd = ["gksu", "pacman --noconfirm %s" % flags]
cmd += pkgs
else:
cmd = ["gksu", "pacman --noconfirm %s %s" % (flags, pkgs)]
if eflgs and any(eflgs):
eflgs = [x for x in eflgs if x]
cmd += eflgs
p = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
data = p.communicate()
data = {"code": p.returncode, "stdout": data[0],
"stderr": data[1].rstrip('\n')}
return data[UPDATE]
I just discovered that this doesnt work and returns the gksu help message as if it were asked to run `gksu -h`.
[UPDATE]
I think I've got it fixed now by treating gksu as the main program and pacman as an argument.
Last edited by folatt (2016-06-12 14:52:29)
Offline