Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

impr

  • Loading branch information...
commit 427f17f2defc92590710bca42a2a224dc874a1bc 1 parent 9dcd30e
eugene authored

Showing 3 changed files with 12 additions and 3 deletions. Show diff stats Hide diff stats

  1. +9 1 chrome_killer.py
  2. BIN  old.zip
  3. +3 2 testx
10 chrome_killer.py
... ... @@ -1,5 +1,10 @@
1 1 #!/usr/bin/env python
2 2
  3 +import logging
  4 +LOG_FILENAME = '/home/eugene/vzabote-xinetd.log'
  5 +logging.basicConfig(filename=LOG_FILENAME,
  6 + level=logging.ERROR,
  7 + )
3 8
4 9
5 10 def kill_chrome(file_path, elapsed_time, command_to_execute, command_arg):
@@ -9,11 +14,14 @@ def kill_chrome(file_path, elapsed_time, command_to_execute, command_arg):
9 14
10 15 if t2 - t1 > elapsed_time:
11 16 from subprocess import call
  17 + _t = time.strftime("%a, %d %b %Y %H:%M:%S +06", time.gmtime())
  18 + logging.error('%s long delay. restart browser' % _t)
12 19 call([command_to_execute, command_arg])
  20 +
13 21
14 22 if __name__ == '__main__':
15 23 file_path = '/home/eugene/t'
16   - elapsed_time = 25
  24 + elapsed_time = 2
17 25 command_to_execute = 'touch'
18 26 command_arg = '/home/eugene/t2'
19 27 kill_chrome(file_path, elapsed_time, command_to_execute, command_arg)
BIN  old.zip
Binary file not shown
5 testx
@@ -6,7 +6,8 @@ service test
6 6 protocol = tcp
7 7 port = 10000
8 8 wait = no
9   -only_from = 127.0.0.1 localhost
  9 + log_type = FILE /home/eugene/xnetd.log
  10 + only_from = 127.0.0.1 localhost
10 11 user = eugene
11   -server = /home/eugene/simple_server.py
  12 + server = /home/eugene/simple_server.py
12 13 }

0 comments on commit 427f17f

Please sign in to comment.
Something went wrong with that request. Please try again.