Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename process to program name #50

Merged
merged 5 commits into from Aug 18, 2022
Merged

Rename process to program name #50

merged 5 commits into from Aug 18, 2022

Conversation

paulbovbel
Copy link
Member

@paulbovbel paulbovbel commented Feb 4, 2020

#51 works fine, but changing the process name seems to bork something about how the virtualenv is loaded (see test results).

Replaced bash exec with python magic, this makes python process names very similar to native processes for monitoring purposes.

Replaced shebang tweaking with bash and python magic.

@paulbovbel paulbovbel changed the title Rename process to node name Rename process to program name Feb 4, 2020
@paulbovbel paulbovbel marked this pull request as ready for review February 4, 2020 16:34
@@ -1,2 +1,9 @@
#!/usr/bin/env bash
${${PROJECT_NAME}_VENV_DEVEL_DIR}/bin/python ${program_path} "$@"
#!${${PROJECT_NAME}_VENV_DEVEL_DIR}/bin/python
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I wonder, did you test this with just this change (no setproctitle)? I was under the impression this might be enough but have never tried it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interpreter name will still end up as part of sys.argv[0], so yeah, setproctitle (or similar) is still needed.

@paulbovbel paulbovbel changed the title Rename process to program name WIP Rename process to program name Feb 4, 2020
@paulbovbel
Copy link
Member Author

Marking this WIP due to xenial packaging issue

@paulbovbel paulbovbel changed the title WIP Rename process to program name Rename process to program name Aug 5, 2021
@paulbovbel
Copy link
Member Author

paulbovbel commented Nov 19, 2021

The setproctitle approach would fail because shebang size exceed 128 chars in Jenkins CI.

@paulbovbel paulbovbel force-pushed the rename-process branch 2 times, most recently from 6ef1103 to 17b8531 Compare August 18, 2022 17:58
@paulbovbel
Copy link
Member Author

Fixed by leveraging heredoc with exec rather than touching the shebang

@paulbovbel paulbovbel merged commit 3f70b4d into master Aug 18, 2022
@paulbovbel paulbovbel deleted the rename-process branch July 28, 2023 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants