Understood .. The context in which I work does not allow me to easily to add modules to the system.
My technical questions still stand. Are my problems with the script because of the daemon code?
The script works well manually from the commandline .....