Skip to content

Commit

Permalink
изменено: modem.py
Browse files Browse the repository at this point in the history
	изменено:      upstart/smsd.conf
  • Loading branch information
alex-eri committed Jun 16, 2016
1 parent 187d763 commit 3173c32
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
__pycache__
config.py
nohup.out
*conf~
4 changes: 3 additions & 1 deletion modem.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from gsmmodem.modem import GsmModem
from gsmmodem.exceptions import TimeoutException

import threading
import time
import logging
Expand All @@ -16,7 +18,7 @@ def run(self):
while True:
try:
self.modem.connect()
except IOError:
except (TimeoutException,IOError) as e:
exc_type, exc_value, exc_traceback = sys.exc_info()
logging.debug(traceback.format_tb(exc_traceback))
time.sleep(10)
Expand Down
7 changes: 3 additions & 4 deletions upstart/smsd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ respawn
respawn limit 15 5
start on runlevel [2345]
stop on runlevel [06]
script
cd /opt/smsd/
python2 /opt/smsd/server.py 2>&1 >> /var/log/eri/smsd.log
end script
console log
exec python2 /opt/smsd/server.py

11 changes: 11 additions & 0 deletions upstart/smsd.conf~
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pre-start script
mkdir -p /var/log/eri
end script
respawn
respawn limit 15 5
start on runlevel [2345]
stop on runlevel [06]
script
cd /opt/smsd/
python2 /opt/smsd/server.py 2>&1 >> /var/log/eri/smsd.log
end script

0 comments on commit 3173c32

Please sign in to comment.