diff options
author | Dim-P <Dim-P@users.noreply.github.com> | 2023-01-27 15:51:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 15:51:04 +0000 |
commit | 081dbc6cedbc7c035d8e3bc7bcb1845db656bacf (patch) | |
tree | c5133783b74b489be006c65def83aa6ec6353d8f /netdata-installer.sh | |
parent | 3338acf0824565ae1a2163d9b6aab77ea5b5ed11 (diff) |
Use "getent group" instead of reading "/etc/group" to get group information (#14316)
* Use getent group instead of /etc/group to search groups
* Fallback to 'cat /etc/groups' if no getent exists
* Use group_exists() in netdata-installer.sh
* Rename group_exists() to get_group()
Diffstat (limited to 'netdata-installer.sh')
-rwxr-xr-x | netdata-installer.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/netdata-installer.sh b/netdata-installer.sh index 314a1967e7..e45eead14b 100755 --- a/netdata-installer.sh +++ b/netdata-installer.sh @@ -1200,8 +1200,8 @@ run chmod 770 "${NETDATA_CLAIMING_DIR}" if [ "$(id -u)" -eq 0 ]; then # find the admin group admin_group= - test -z "${admin_group}" && getent group root > /dev/null 2>&1 && admin_group="root" - test -z "${admin_group}" && getent group daemon > /dev/null 2>&1 && admin_group="daemon" + test -z "${admin_group}" && get_group root > /dev/null 2>&1 && admin_group="root" + test -z "${admin_group}" && get_group daemon > /dev/null 2>&1 && admin_group="daemon" test -z "${admin_group}" && admin_group="${NETDATA_GROUP}" run chown "${NETDATA_USER}:${admin_group}" "${NETDATA_LOG_DIR}" |