这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jsirianni
Copy link
Member

@jsirianni jsirianni commented Aug 20, 2025

Proposed Change

Updated Linux package scripts and install script to support user defined username and group.

  • BDOT_USER: Defaults to bdot
  • BDOT_GROUP: Defaults to bdot

These options are intended to be used during first install. We do not support modifying these options after initial install.

The updater did not require changes as it already dynamically sets the Systemd group based on the group configured in the install unit file. It does not set the user, nor does it need to. We use a systemd override when running as non root, the updater does not touch this override file.

Testing

Defaults

Local install and Test Kitchen are passing fine. All files that should be owned by bdot:bdot were verified successfully.

Custom user / group

I configured /etc/default/observiq-otel-collector.

BDOT_USER=otelu
BDOT_GROUP=otelg
BDOT_UNPRIVILEGED=true

After installing with the install script, permissions are set correctly:

$ sudo ls -la /opt/observiq-otel-collector/

total 324120
drwxr-xr-x 5 otelu otelg      4096 Aug 20 15:01 .
drwxr-xr-x 4 root  root       4096 Aug 20 15:01 ..
-rw-r--r-- 1 otelu otelg     11339 Mar  3 13:43 LICENSE
-rw-r--r-- 1 otelu otelg        44 Aug 20 14:59 VERSION.txt
-rw-r----- 1 otelu otelg      1293 Aug 20 14:59 config.yaml
drwxr-x--- 2 otelu otelg      4096 Aug 20 15:01 log
-rw-r----- 1 otelu otelg       232 Aug 20 14:59 logging.yaml
-rwxr-xr-x 1 otelu otelg 323416248 Aug 20 14:59 observiq-otel-collector
drwxr-x--- 2 otelu otelg      4096 Aug 20 15:01 plugins
drwxr-x--- 2 otelu otelg      4096 Aug 20 15:00 storage
-rwxr-xr-x 1 otelu otelg   8429752 Aug 20 14:59 updater

The process is running as otelu user.

$ sudo ps aux | grep otelu

otelu       7029  0.0  1.9 1544084 156892 ?      Ssl  15:01   0:00 /opt/observiq-otel-collector/observiq-otel-collector --config config.yaml

The systemd unit file and override** look correct:

sudo systemctl cat observiq-otel-collector
# /lib/systemd/system/observiq-otel-collector.service
[Unit]
Description=observIQ's distribution of the OpenTelemetry collector
After=network.target
StartLimitIntervalSec=120
StartLimitBurst=5
[Service]
Type=simple
User=root
Group=otelg
....

# /etc/systemd/system/observiq-otel-collector.service.d/10-package-customizations-username.conf
[Service]
User=otelu

**The systemd override logic was implemented previously, here #2443. This PR updates the postinall script to use the configured user instead of bdot.. defaulting to bdot.

Checklist
  • Changes are tested
  • CI has passed

@jsirianni jsirianni force-pushed the joesirianni/plat-257-bdot-v1-support-configurable-username-and-group branch from f2b6a74 to 32a8e56 Compare August 20, 2025 16:14
@jsirianni jsirianni marked this pull request as ready for review August 20, 2025 16:14
@jsirianni jsirianni requested review from a team and dpaasman00 as code owners August 20, 2025 16:14
@github-actions
Copy link

⚠️ Stale PR Warning

This PR has been inactive for 7 days and will be automatically closed in 7 days.

To keep this PR open:

  • Add a comment with an update
  • Push new commits
  • Request a review
  • Or add the `do-not-merge` label if you need more time

Let us know if you're still working on this! 🚀

@github-actions github-actions bot added the Stale label Aug 28, 2025
@github-actions
Copy link

github-actions bot commented Sep 5, 2025

🤖 Auto-closing stale PR

This PR has been inactive for 7+ days and is being automatically closed to keep our backlog manageable.

If you'd like to continue working on this:

  • Feel free to reopen this PR
  • Or create a new PR with your latest changes

Thanks for your contribution! 🙏

@github-actions github-actions bot closed this Sep 5, 2025
@jsirianni jsirianni reopened this Sep 5, 2025
@jsirianni jsirianni force-pushed the joesirianni/plat-257-bdot-v1-support-configurable-username-and-group branch from 32a8e56 to 27dc74c Compare September 5, 2025 13:22
@github-actions github-actions bot removed the Stale label Sep 6, 2025
Copy link
Contributor

@dpaasman00 dpaasman00 left a comment

Choose a reason for hiding this comment

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

Working well in testing

@jsirianni jsirianni force-pushed the joesirianni/plat-257-bdot-v1-support-configurable-username-and-group branch from 27dc74c to bfba4cc Compare September 9, 2025 13:36
@jsirianni jsirianni merged commit 0cae31a into main Sep 9, 2025
14 checks passed
@jsirianni jsirianni deleted the joesirianni/plat-257-bdot-v1-support-configurable-username-and-group branch September 9, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants