I'm trying to profile a fcgi
application (C++) that runs within apache
with mod_fascgi
with perftools
. SO is Centos 6 x86_64.
The problem is the following. According to gperftools documentation
"For security reasons, CPU profiling will not write to a file -- and is thus not usable -- for setuid programs."
Apache must be launched as root
, and then uses setuid to use apache
as user, thus using setuid
. Then gperftools
won't write to the file.
And running Apache as root
is also disabled.
Any solution?
So far I thought about 3 solutions:
- Create a test within the application to simulate some requests and mock FCGI classes.
- Recompile Apache with flag -DBIG_SECURITY_HOLE to allow to run apache as root.
- Recomplie gperftools removing the check of suid.