Use py-setproctitle to clean up ps output in redo scripts
* Change the process title with a cleaned-up version of the script * Document the use of setproctitle in the README
This commit is contained in:
parent
2affe20fb2
commit
adbaaf38ce
2 changed files with 22 additions and 12 deletions
11
state.py
11
state.py
|
|
@ -3,6 +3,17 @@ import vars
|
|||
from helpers import unlink, close_on_exec, join
|
||||
from log import warn, err, debug2, debug3
|
||||
|
||||
# When the module is imported, change the process title.
|
||||
# We do it here because this module is imported by all the scripts.
|
||||
try:
|
||||
from setproctitle import setproctitle
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
cmdline = sys.argv[:]
|
||||
cmdline[0] = os.path.splitext(os.path.basename(cmdline[0]))[0]
|
||||
setproctitle(" ".join(cmdline))
|
||||
|
||||
SCHEMA_VER=1
|
||||
TIMEOUT=60
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue