-
Notifications
You must be signed in to change notification settings - Fork 45
chore(v2): Rename observiq-otel-collector user to bdot #2652
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
chore(v2): Rename observiq-otel-collector user to bdot #2652
Conversation
| fi | ||
|
|
||
| # Script Constants | ||
| COLLECTOR_USER="bdot" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This var is used by the chown command below, after package install / upgrade. The migrated user will already be in place.
| # Remove supervisor.yaml from staging if it already exists in target | ||
| # to avoid overwriting the existing file. | ||
| if [ -f "${BDOT_CONFIG_HOME}/supervisor.yaml" ]; then | ||
| rm -f "${stage_dir}/supervisor.yaml" || true | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a bug previously introduced by the "stage dir" implementation. We need to avoid clobbering the supervisor.yaml config as it contains the opamp config. Upgrades caused the collector to lose its connection to the OpAMP server.
| mkdir -p "${BDOT_CONFIG_HOME}" | ||
| chmod 0755 "${BDOT_CONFIG_HOME}" | ||
| chown bindplane-otel-collector:bindplane-otel-collector "${BDOT_CONFIG_HOME}" | ||
| rm -f "${BDOT_CONFIG_HOME}/bindplane-otel-collector" || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things
- Deleting and re-creating the binary is required if its executed by a process (or an atomic move, see below)
- We were missing the supervisor binary here. This is a bug resolved by this PR.
See the new implementation below starting at line 46.
| # Perform atomic moves for binary files to replace running binaries | ||
| mv "${BDOT_CONFIG_HOME}/opampsupervisor.new" "${BDOT_CONFIG_HOME}/opampsupervisor" | ||
| mv "${BDOT_CONFIG_HOME}/bindplane-otel-collector.new" "${BDOT_CONFIG_HOME}/bindplane-otel-collector" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mv is atomic and will preserve the previous binary until the move operation is finished. Its also much faster to move the binary vs copying it.
This will prevent a situation where the binary does not exist on disk (because it was deleted) and the service crashes and restarts, failing again because the binary is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR renames the user and group from observiq-otel-collector/bindplane-otel-collector to bdot across installation scripts to standardize the naming convention for the v2 collector.
- Introduces user migration logic to handle the transition from legacy username to new username during package upgrades
- Updates all script references to use the new
bdotusername and group - Improves binary replacement logic during installation to handle file locking issues
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/package/preinstall.sh | Adds migration functions to rename legacy user/group to bdot before package operations |
| scripts/package/postinstall.sh | Updates username references and improves binary file handling during installation |
| scripts/install/install_unix.sh | Changes hardcoded username reference to use COLLECTOR_USER variable set to "bdot" |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Proposed Change
bdotuser and groupbindplane-otel-collectortobdotYou can reference merged the V1 PR here #2436
Testing
/opt/bindplane-otel-collectorare owned bybindplane-otel-collectorls -la /opt/bindplane-otel-collector total 361936 drwxr-xr-x 5 bindplane-otel-collector bindplane-otel-collector 4096 Sep 15 13:39 . drwxr-xr-x. 13 root root 4096 Sep 15 13:39 .. -rwxr-xr-x 1 bindplane-otel-collector bindplane-otel-collector 339480760 Aug 4 11:51 bindplane-otel-collector -rw-r--r-- 1 bindplane-otel-collector bindplane-otel-collector 11339 Aug 4 11:44 LICENSE -rwxr-xr-x 1 bindplane-otel-collector bindplane-otel-collector 31086146 Aug 4 11:47 opampsupervisor drwxr-x--- 2 bindplane-otel-collector bindplane-otel-collector 4096 Sep 15 13:39 plugins drwxr-x--- 2 bindplane-otel-collector bindplane-otel-collector 4096 Aug 4 12:04 storage -rw-r--r-- 1 root bindplane-otel-collector 610 Sep 15 13:39 supervisor.log drwxr-x--- 2 bindplane-otel-collector bindplane-otel-collector 4096 Sep 15 13:39 supervisor_storage -rw------- 1 bindplane-otel-collector bindplane-otel-collector 825 Sep 15 13:39 supervisor.yaml -rw-r--r-- 1 bindplane-otel-collector bindplane-otel-collector 14 Aug 4 11:46 VERSION.txtbdotls -la /opt/bindplane-otel-collector total 365112 drwxr-xr-x 5 bdot bdot 4096 Sep 15 13:40 . drwxr-xr-x. 13 root root 4096 Sep 15 13:40 .. -rwxr-xr-x 1 bdot bdot 339484856 Sep 15 13:35 bindplane-otel-collector -rw-r--r-- 1 bdot bdot 11339 Mar 3 2025 LICENSE -rwxr-xr-x 1 bdot bdot 34329661 Sep 15 13:35 opampsupervisor drwxr-x--- 2 bdot bdot 4096 Sep 15 13:40 plugins drwxr-x--- 2 bdot bdot 4096 Sep 15 13:36 storage -rw-r--r-- 1 root bdot 610 Sep 15 13:39 supervisor.log drwxr-x--- 2 bdot bdot 4096 Sep 15 13:36 supervisor_storage -rw------- 1 bdot bdot 825 Sep 15 13:39 supervisor.yaml -rw-r--r-- 1 bdot bdot 15 Sep 15 13:34 VERSION.txtChecklist