Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

impr

  • Loading branch information...
commit 427f17f2defc92590710bca42a2a224dc874a1bc 1 parent 9dcd30e
eugene authored
Showing with 12 additions and 3 deletions.
  1. +9 −1 chrome_killer.py
  2. BIN  old.zip
  3. +3 −2 testx
View
10 chrome_killer.py
@@ -1,5 +1,10 @@
#!/usr/bin/env python
+import logging
+LOG_FILENAME = '/home/eugene/vzabote-xinetd.log'
+logging.basicConfig(filename=LOG_FILENAME,
+ level=logging.ERROR,
+ )
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):
if t2 - t1 > elapsed_time:
from subprocess import call
+ _t = time.strftime("%a, %d %b %Y %H:%M:%S +06", time.gmtime())
+ logging.error('%s long delay. restart browser' % _t)
call([command_to_execute, command_arg])
+
if __name__ == '__main__':
file_path = '/home/eugene/t'
- elapsed_time = 25
+ elapsed_time = 2
command_to_execute = 'touch'
command_arg = '/home/eugene/t2'
kill_chrome(file_path, elapsed_time, command_to_execute, command_arg)
View
BIN  old.zip
Binary file not shown
View
5 testx
@@ -6,7 +6,8 @@ service test
protocol = tcp
port = 10000
wait = no
-only_from = 127.0.0.1 localhost
+ log_type = FILE /home/eugene/xnetd.log
+ only_from = 127.0.0.1 localhost
user = eugene
-server = /home/eugene/simple_server.py
+ server = /home/eugene/simple_server.py
}
Please sign in to comment.
Something went wrong with that request. Please try again.