I've determined that the Python process is failing because it can't create a connection to MySQL. I logged my output from rc.local like this:
Code:
/usr/bin/python /var/www/python/Main.py > /var/log/mylog/log/log 2>&1
Output after restarting:
Code:
Traceback (most recent call last):
File "/var/www/python/Main.py", line 10, in <module>
queue_handler = QueueHandler.QueueHandler()
File "/var/www/python/QueueHandler.py", line 19, in __init__
passwd = 'password123', db = 'test')
_mysql_exceptions.OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")
I also put the following in my /etc/rc.local and it printed nothing:
Code:
ls /var/run/mysqld > /var/log/mylog/log/log 2>&1
However, when I run it after I SSH in:
Code:
localaccount@sosms:~$ ls /var/run/mysqld > /var/log/mylog/log/log 2>&1
localaccount@sosms:~$ cat /var/log/mylog/log/log
mysqld.pid
mysqld.sock
localaccount@sosms:~$
Again, when the machine is already up and I SSH in and execute the rc.local script manually, it comes up and runs fine.
Does anyone have some advice?
Bookmarks