-
Notifications
You must be signed in to change notification settings - Fork 229
Prevent service being started/enabled on install for rpms #1335
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
f47fdd0
40829ec
b2b99b1
77a600b
f19a46b
ba61b13
3a9d5cd
0a7f2de
4119fe3
5b07f4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Use this changelog template to create an entry for release notes. | ||
|
|
||
| # One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
| change_type: "breaking" | ||
|
|
||
| # The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) | ||
| component: "packaging" | ||
|
|
||
| # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
| note: "Prevent service being started/enabled upon install for rpms" | ||
|
|
||
| # One or more tracking issues or pull requests related to the change | ||
| issues: [1334] | ||
|
|
||
| # (Optional) One or more lines of additional information to render under the primary note. | ||
| # These lines will be padded with 2 spaces and then inserted directly into the document. | ||
| # Use pipe (|) for multiline entries. | ||
| subtext: "This brings behaviour inline with usual expectations for rpm packages which usually leave this up to the system administrator." | ||
|
|
||
| # Optional: The change log or logs in which this entry should be included. | ||
| # e.g. '[user]' or '[user, api]' | ||
| # Include 'user' if the change is relevant to end users. | ||
| # Include 'api' if there is a change to a library API. | ||
| # Default: '[user]' | ||
| change_logs: [] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Copyright The OpenTelemetry Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if command -v systemctl >/dev/null 2>&1; then | ||
| if [ -d /run/systemd/system ]; then | ||
| systemctl daemon-reload | ||
| fi | ||
| if [ -f /etc/opampsupervisor/config.yaml ]; then | ||
| if [ -d /run/systemd/system ]; then | ||
| systemctl try-restart opampsupervisor.service | ||
| fi | ||
| fi | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Copyright The OpenTelemetry Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if command -v systemctl >/dev/null 2>&1; then | ||
| if [ -d /run/systemd/system ]; then | ||
| systemctl daemon-reload | ||
| fi | ||
| if [ -f /etc/otelcol-contrib/config.yaml ]; then | ||
|
||
| if [ -d /run/systemd/system ]; then | ||
| systemctl try-restart otelcol-contrib.service | ||
| fi | ||
| fi | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Copyright The OpenTelemetry Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if command -v systemctl >/dev/null 2>&1; then | ||
| if [ -d /run/systemd/system ]; then | ||
| systemctl daemon-reload | ||
| fi | ||
| if [ -f /etc/otelcol-otlp/config.yaml ]; then | ||
| if [ -d /run/systemd/system ]; then | ||
| systemctl try-restart otelcol-otlp.service | ||
| fi | ||
| else | ||
| echo "Make sure to configure otelcol-otlp by creating /etc/otelcol-otlp/config.yaml" | ||
| fi | ||
| fi |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Copyright The OpenTelemetry Authors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| if command -v systemctl >/dev/null 2>&1; then | ||
| if [ -d /run/systemd/system ]; then | ||
| systemctl daemon-reload | ||
| fi | ||
| if [ -f /etc/otelcol/config.yaml ]; then | ||
| if [ -d /run/systemd/system ]; then | ||
| systemctl try-restart otelcol.service | ||
| fi | ||
| fi | ||
| 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 changelog doesn't reflect the changes. You seem to be checking for systemd presence in the system.
Please clarify this changelog.
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.
I believe this is an accurate description of the change in behaviour for end users - please also refer to #1334 for more expansion on the motivation here.
All of the logic in the scripts that I am adding already exists in the base
postinstall.shscripts - my change merely creates specific versions with slightly different outcomes for rpms.For example, for the plain otelcol distribution, the diff between the existing script and my rpm specific override:
If you think there's a better approach then I'm happy to adjust.
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.
OK I see. There is boilerplate on that script you can strip away imo ; remove the check for the config file presence. Is checking for
/run/systemd/systempresence even necessary?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.
I agree, have removed.