we need to be able to specify a wrapper in an environment variable in /etc/conf.d/whatever to cause start-stop-daemon to run the daemon under the wrapper. for example WRAPPER="systrace -a" for systrace or WRAPPER="run_init" for selinux
Zack, mind having a look? I think this might be a bit beyond my C skills.
Martin, I talked with Method and pebenito in irc, and I'll happily take this one off your todo list.
Now just waiting for the clear requirements to be posted here, seems there was still some confusion on exactly what is required here.
Lets say we have an env var SSD_WRAPPER. Check main() ... just before it does the exec(whatever), it must: 1) break SSD_WRAPPER up in parts (if applicable), meaning binary and flags ('strace -a' for instance). 2) Change argv to have argv[0] the binary in SSD_WRAPPER, and move all the original stuff in argv up to make space for stuff in SSD_WRAPPER. 3) Now do the exec(whatever). Should be a simplification.
Method and I decided to put this on the deep back burner for now.