fixing some bugs like starting new iteration before ending the old one; building DB connection string with taking into account what username and password may be empty
adding init.d file and added documentation for ubuntu