Ask your nix questions here instead?

Chagrin:
That would die the moment the user logged out. You need to use setsid() to divorce yourself from the shell process.

I was simplifying a bit. I had been using nohup, but it sounds like setsid could be an alternative.

If I put ./foo & in the init.d does it run when someone logs on or when system boot?

The init.d stuff is for system booting. There is a script that runs on startup, that runs all the scripts in the init.d directory. Again that is simplifying a bit.