I want run a simple script on web2py startup,that listen on a tcp port the script is the following "example.py". The file in the "applications/myapp/cron" folder
*import SocketServer* *import logging* *class MyTCPHandler(SocketServer.BaseRequestHandler):* * # handle syslog event message* * def handle(self):* * self.logger = logging.getLogger("web2py.app.easylog")* * self.logger.setLevel(logging.DEBUG)* * messagelog = self.request.recv(1024).strip()* * self.logger.info(messagelog)* *if __name__ == "__main__":* * HOST, PORT = "0.0.0.0", 514* * servertcp = SocketServer.TCPServer((HOST, PORT), MyTCPHandler)* * servertcp.serve_forever()* i have created into the "cron" folder the crontab file with the following content: *@reboot root *applications/easylog/cron/example.py* *i run web2py with the following shell command "sudo python web2py.py -Y"* *The first time web2py is running everything works fine and i am able to connect with telnet on port 514* *If i kill web2py and restart it the no more open port on 514* *The question is.... Why? * -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.