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:
Daniele Varrazzo 2018-10-11 08:43:59 +01:00 committed by Avery Pennarun
commit adbaaf38ce
2 changed files with 22 additions and 12 deletions

View file

@ -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