On Thu, Dec 03, 2009 at 07:15:38AM -0800, aucword2 wrote:
> I have an application that I am working on.  This application is a service.  
> For now, I "su" and run, but I would like to run this under my normal user 
> account.    
> 
> I can continue to run this as root, but here is the next question...
> 
> I am using NetBeans as a development IDE.  I would like to debug the 
> application with NetBeans/gdb.   (Because it is a service started by root, I 
> can't attach the debugger to it with my user account).
> 
> How do I run the application and debug as non-root?

Why does your application need to run as root?  Is it just that it
binds to a privileged port?

The easiest thing to do would be to add a "run in regular user mode" command
line flag, which makes the program change its setup so that it doesn't need
privileges.  Then, you can easily debug it as yourself.

Alternatively, you can figure out which privileges your application needs
in order to run (net_privaddr is an obvious one), and use ppriv to give
netbeans and one of your shells that privilege.  Then, you can run the
service as yourself, and attach to it using gdb from netbeans.

Cheers,
- jonathan

_______________________________________________
tools-discuss mailing list
tools-discuss@opensolaris.org

Reply via email to