fix installation for ubuntu 14.04 (#7690)
* fix systemd for ubuntu 14.04 * Rename review workflow * Use consistent workflow and job names Co-authored-by: James Mills <prologic@shortcircuit.net.au>
Dylan Wang committed
Mar 9, 2020 at 19:44 UTC
fd343ac0c262cd6a1535b67e7894d06760e10259
1 file changed
+15
-1
packaging/installer/functions.sh
+15
-1
@@ -114,7 +114,7 @@ fetch_and_verify() {
114
local override=${5}
115
116
if [ -z "${override}" ]; then
117
- get "${url}" > "${tmp}/${base_name}"
117
+ get "${url}" > "${tmp}/${base_name}"
118
else
119
progress "Using provided ${component} archive ${override}"
120
run cp "${override}" "${tmp}/${base_name}"
@@ -407,6 +407,16 @@ install_netdata_service() {
407
local uname
408
uname="$(uname 2> /dev/null)"
409
410
+ local key="unknown"
411
+ if [ -f /etc/os-release ]; then
412
+ # shellcheck disable=SC1091
413
+ source /etc/os-release || return 1
414
+ key="${ID}-${VERSION_ID}"
415
+
416
+ elif [ -f /etc/redhat-release ]; then
417
+ key=$(< /etc/redhat-release)
418
+ fi
419
+
420
if [ "${UID}" -eq 0 ]; then
421
if [ "${uname}" = "Darwin" ]; then
422
@@ -446,6 +456,10 @@ install_netdata_service() {
456
SYSTEMD_DIRECTORY="/etc/systemd/system"
457
fi
458
459
+ if [[ ${key} =~ ^devuan* ]] || [ "${key}" = "debian-7" ] || [ "${key}" = "ubuntu-12.04" ] || [ "${key}" = "ubuntu-14.04" ]; then
460
+ SYSTEMD_DIRECTORY="/etc/systemd/system"
461
+ fi
462
+
463
if [ "${SYSTEMD_DIRECTORY}x" != "x" ]; then
464
ENABLE_NETDATA_IF_PREVIOUSLY_ENABLED="run systemctl enable netdata"
465
IS_NETDATA_ENABLED="$(systemctl is-enabled netdata 2> /dev/null || echo "Netdata not there")"