Running as root [message #271010] |
Thu, 21 May 2009 16:24  |
Eclipse User |
|
|
|
I'm using Eclipse to run code on Linux that does ethernet capture (calling
libpcap) -similar to Wireshark. This means that the code must be running
as root since capture (promiscuous mode) isn't possible on Linux unless
the process is running as root. But I run other code in Eclipse that
doesn't require Root privileges; I'd prefer to run as user (ie not Root)
except when root is absolutely necessary.
HERE'S THE PROBLEM:
If I start Eclipse as Root for the capture and then later try to invoke
eclipse as a non-root user, Eclipse crashes. The reason is that it
attempts to write config or log files in the <workspace>/.metadata/
directory and when these writes fail, it ends up with a "null pointer
exception" or similar error -without informing the user - it just hangs or
crashes.
POSSIBLE SOLUTIONS:
1. Does anyone know for sure if it's possible to start Eclipse as a
non-root user and then start the process it's debugging as root?
2. It seems that clean solution to this problem would be to have the
root/superuser projects all in one workspace. Then -assuming that all
config information is written to the <workspace>/.metadata/ tree - all the
root permission file/directory issues would be in this workspace only and
other workspaces would have non-root-user permissions. Does anyone know
if it's correct to assume that all the config file writes happen only in
the workspace/.metadata/ tree.
I know I could try it out but I don't want to find out the hard way four
months from now (after I've forgotten about this whole issue) that it
doesn't really work because of some oddball file that is written outside
of the workspace tree under some rare circumstances.
Does anyone know for sure of a clean way of getting this capability of
debugging a process with root permission and then having the capability of
running as a non-root user later ?
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09149 seconds