Well, a daemon needs to be an infinite loop internally with some way of stopping it, possibly externally via kill).
to launch one use
nohup /path/to/my/daemon &
which detaches it from the terminal (nohup) and puts it in the background (&)
you can get the pid from the internal bash var $$, then use
ps -ef|grep $$ |grep -v grep|grep -v ps
and the 2nd num returned is the parent id