Skip to content

Commit

Permalink
Reverts #5623 and #5481 (#5675)
Browse files Browse the repository at this point in the history
* Revert "Overrides install info unconditionally (#5623)"

This reverts commit 068b60a.

* Revert "Adds installation information when using deb and rpm packages (#5481)"

This reverts commit 13ae4f8.

* Corrects step number
  • Loading branch information
mx-psi authored Jun 5, 2020
1 parent 3960319 commit e249d93
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 95 deletions.
18 changes: 0 additions & 18 deletions omnibus/package-scripts/agent/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,6 @@ if [ "$DISTRIBUTION" != "Darwin" ]; then
;;
esac
#DEBHELPER#

# Set the installation information
# This is done in posttrans for .rpm packages
if command -v dpkg >/dev/null 2>&1 && command -v dpkg-query >/dev/null 2>&1; then
tool=dpkg
tool_version=dpkg-$(dpkg-query --showformat='${Version}' --show dpkg | cut -d "." -f 1-3 || echo "unknown")
else
tool=unknown
tool_version=unknown
fi

install_info_content="---
install_method:
tool: $tool
tool_version: $tool_version
installer_version: deb_package
"
echo "$install_info_content" > $CONFIG_DIR/install_info
fi

# Set proper rights to the dd-agent user
Expand Down
4 changes: 0 additions & 4 deletions omnibus/package-scripts/agent/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ if [ -f "/etc/debian_version" ] || [ "$DISTRIBUTION" = "Debian" ] || [ "$DISTRIB
rm -rf $LOG_DIR
rm -rf $CONFIG_DIR
;;
remove)
rm $CONFIG_DIR/install_info || true
;;
*)
;;
esac
Expand All @@ -40,7 +37,6 @@ elif [ -f "/etc/redhat-release" ] || [ -f "/etc/system-release" ] || [ -f "/etc/
0)
# We're uninstalling.
# We don't delete the dd-agent user/group (see https://fedoraproject.org/wiki/Packaging:UsersAndGroups#Allocation_Strategies)
rm $CONFIG_DIR/install_info || true
;;
1)
# We're upgrading.
Expand Down
27 changes: 0 additions & 27 deletions omnibus/package-scripts/agent/posttrans
Original file line number Diff line number Diff line change
Expand Up @@ -96,33 +96,6 @@ if [ "$DISTRIBUTION_FAMILY" != "SUSE" ]; then
fi
fi


# Set the installation information
# This is done in the postinst script for .deb packages
if command -v rpm >/dev/null 2>&1; then
tool=rpm
tool_version=rpm-$(rpm -q --qf "%{VERSION}" rpm || echo "unknown")
else
tool=unknown
tool_version=unknown
fi

# Distinguish SUSE since it has a different package
if [ "$DISTRIBUTION_FAMILY" == "SUSE" ]; then
installer_version="rpm_suse_package"
else
installer_version="rpm_package"
fi

install_info_content="---
install_method:
tool: $tool
tool_version: $tool_version
installer_version: $installer_version
"
echo "$install_info_content" > $CONFIG_DIR/install_info
chown -R dd-agent:dd-agent ${CONFIG_DIR}

# TODO: Use a configcheck command on the agent to determine if it's safe to restart,
# and avoid restarting when a check conf is invalid
if [ -f "$CONFIG_DIR/datadog.yaml" ]; then
Expand Down
27 changes: 4 additions & 23 deletions omnibus/package-scripts/iot-agent/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,12 @@ if [ "$DISTRIBUTION" != "Darwin" ]; then
;;
esac
#DEBHELPER#

# Set the installation information
# This is done in posttrans for .rpm packages
if command -v dpkg >/dev/null 2>&1 && command -v dpkg-query >/dev/null 2>&1; then
tool=dpkg
tool_version=dpkg-$(dpkg-query --showformat='${Version}' --show dpkg | cut -d "." -f 1-3 || echo "unknown")
else
tool=unknown
tool_version=unknown
fi

install_info_content="---
install_method:
tool: $tool
tool_version: $tool_version
installer_version: deb_package-iot
"
echo "$install_info_content" > $CONFIG_DIR/install_info
fi

# Set proper rights to the dd-agent user
chown -R dd-agent:dd-agent ${CONFIG_DIR}
chown -R dd-agent:dd-agent ${LOG_DIR}
chown -R dd-agent:dd-agent ${INSTALL_DIR}
# Set proper rights to the dd-agent user
chown -R dd-agent:dd-agent ${CONFIG_DIR}
chown -R dd-agent:dd-agent ${LOG_DIR}
chown -R dd-agent:dd-agent ${INSTALL_DIR}

# Enable and restart the agent service here on Debian platforms
# On RHEL, this is done in the posttrans script
Expand All @@ -94,7 +76,6 @@ install_method:
echo "[ WARNING ]\tCannot detect a supported init system. The datadog-iot-agent package only provides service files for systemd and upstart."
fi


# TODO: Use a configcheck command on the agent to determine if it's safe to restart,
# and avoid restarting when a check conf is invalid
if [ -f "$CONFIG_DIR/datadog.yaml" ]; then
Expand Down
4 changes: 0 additions & 4 deletions omnibus/package-scripts/iot-agent/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ if [ -f "/etc/debian_version" ] || [ "$DISTRIBUTION" = "Debian" ] || [ "$DISTRIB
rm -rf $LOG_DIR
rm -rf $CONFIG_DIR
;;
remove)
rm $CONFIG_DIR/install_info || true
;;
*)
;;
esac
Expand All @@ -40,7 +37,6 @@ elif [ -f "/etc/redhat-release" ] || [ -f "/etc/system-release" ] || [ -f "/etc/
0)
# We're uninstalling.
# We don't delete the dd-agent user/group (see https://fedoraproject.org/wiki/Packaging:UsersAndGroups#Allocation_Strategies)
rm $CONFIG_DIR/install_info || true
;;
1)
# We're upgrading.
Expand Down
19 changes: 0 additions & 19 deletions omnibus/package-scripts/iot-agent/posttrans
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,6 @@ else
echo "[ WARNING ]\tCannot detect a supported init system. The datadog-iot-agent package only provides service files for systemd and upstart."
fi

# Set the installation information if not already present;
# This is done in the postinst script for .deb packages
if command -v rpm >/dev/null 2>&1; then
tool=rpm
tool_version=rpm-$(rpm -q --qf "%{VERSION}" rpm || echo "unknown")
else
tool=unknown
tool_version=unknown
fi

install_info_content="---
install_method:
tool: $tool
tool_version: $tool_version
installer_version: rpm_package-iot
"
echo "$install_info_content" > $CONFIG_DIR/install_info
chown -R dd-agent:dd-agent ${CONFIG_DIR}

# TODO: Use a configcheck command on the agent to determine if it's safe to restart,
# and avoid restarting when a check conf is invalid
if [ -f "$CONFIG_DIR/datadog.yaml" ]; then
Expand Down

0 comments on commit e249d93

Please sign in to comment.