Hans, At first you can try doing something like Apache does. It starts a father daemon owned by root which spawns other processes for connection handling. These processes when created, change the uid and gid to ones with lower privileges on the system. The father controls all the other processes...
You can start your program running SECURE tasks as root and then drop its privileges before going on... It's just an idea of how to do it... take a look to the 6th chapter of the Secure Programming for Linux and Unix HOWTO. It describes some ways of working with these. http://www.linuxdocs.org/HOWTOs/Secure-Programs-HOWTO/ William Zanatta
