Skip to content

Commit

Permalink
Merge pull request #325 from simonsobs/set-title
Browse files Browse the repository at this point in the history
ocs-agent-cli renames itself in process list
  • Loading branch information
BrianJKoopman committed Apr 12, 2023
2 parents 91c51d5 + 919b966 commit d6e95ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ocs/agent_cli.py
@@ -1,6 +1,7 @@
import argparse
import importlib
import os
import setproctitle
import sys
import warnings

Expand Down Expand Up @@ -182,6 +183,10 @@ def main(args=None):

mod = importlib.import_module(_module)

title = f'ocs-agent:{instance.data["instance-id"]}'
print(f'Renaming this process to: "{title}"')
setproctitle.setproctitle(title)

start = getattr(mod, entrypoint) # This is the start function.
start(args=post_args)

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Expand Up @@ -3,6 +3,7 @@ twisted
deprecation
PyYAML
importlib_metadata
setproctitle

# InfluxDB Publisher
influxdb
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -49,6 +49,7 @@
'influxdb',
'numpy',
'importlib_metadata;python_version<"3.10"',
'setproctitle',
],
extras_require={
"so3g": ["so3g"],
Expand Down

0 comments on commit d6e95ec

Please sign in to comment.