Ask your nix questions here instead?

http://wiki.debian.org/BootProcess

Your software package should include an init script that would be placed in /etc/init.d (look at other examples in that directory) and also create symlinks from /etc/rc*.d directories. There are plenty of pre-existing examples that you can poke around at to help understand everything. For example try "ls -l /etc/rc*.d/anacron" to see how the Anacron daemon is configured within the various /etc/rcX.d directories.

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

Here's a good tutorial on creating a daemon: Unix Daemon Server Programming