Skip to content

Commit

Permalink
fix: fix Linux package scripts
Browse files Browse the repository at this point in the history
fixes #799
  • Loading branch information
netsandbox committed Jan 17, 2025
1 parent e2502b0 commit 10c499f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion distributions/otelcol-contrib/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
if command -v systemctl >/dev/null 2>&1; then
systemctl enable otelcol-contrib.service
if [ -f /etc/otelcol-contrib/config.yaml ]; then
systemctl start otelcol-contrib.service
systemctl restart otelcol-contrib.service
fi
fi
8 changes: 5 additions & 3 deletions distributions/otelcol-contrib/preremove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if command -v systemctl >/dev/null 2>&1; then
systemctl stop otelcol-contrib.service
systemctl disable otelcol-contrib.service
if [ "$1" != "1" ]; then
if command -v systemctl >/dev/null 2>&1; then
systemctl stop otelcol.service
systemctl disable otelcol.service
fi
fi
2 changes: 1 addition & 1 deletion distributions/otelcol-otlp/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if command -v systemctl >/dev/null 2>&1; then
systemctl enable otelcol-otlp.service
if [ -f /etc/otelcol-otlp/config.yaml ]; then
systemctl start otelcol-otlp.service
systemctl restart otelcol-otlp.service
else
echo "Make sure to configure otelcol-otlp by creating /etc/otelcol-otlp/config.yaml"
fi
Expand Down
8 changes: 5 additions & 3 deletions distributions/otelcol-otlp/preremove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if command -v systemctl >/dev/null 2>&1; then
systemctl stop otelcol-otlp.service
systemctl disable otelcol-otlp.service
if [ "$1" != "1" ]; then
if command -v systemctl >/dev/null 2>&1; then
systemctl stop otelcol.service
systemctl disable otelcol.service
fi
fi
2 changes: 1 addition & 1 deletion distributions/otelcol/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
if command -v systemctl >/dev/null 2>&1; then
systemctl enable otelcol.service
if [ -f /etc/otelcol/config.yaml ]; then
systemctl start otelcol.service
systemctl restart otelcol.service
fi
fi
8 changes: 5 additions & 3 deletions distributions/otelcol/preremove.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if command -v systemctl >/dev/null 2>&1; then
systemctl stop otelcol.service
systemctl disable otelcol.service
if [ "$1" != "1" ]; then
if command -v systemctl >/dev/null 2>&1; then
systemctl stop otelcol.service
systemctl disable otelcol.service
fi
fi

0 comments on commit 10c499f

Please sign in to comment.