centreon / centreon-archived

Centreon is a network, system and application monitoring tool. Centreon is the only AIOps Platform Providing Holistic Visibility to Complex IT Workflows from Cloud to Edge.
https://www.centreon.com
GNU General Public License v2.0
574 stars 241 forks source link

Script install.sh - Could not create user #5785

Open ghost opened 7 years ago

ghost commented 7 years ago

BUG REPORT INFORMATION

Centreon Web version: 2.8.x

Centreon Engine version: 1.7

Centreon Broker version: 2.12

OS: Ubuntu 16.04 LTS

Steps to reproduce the issue:

  1. Clone and Install Centreon Clib, Centreon Engine, Centreon Broker from Git.
  2. Clone Centreon from Git and launch "install.sh".

Describe the results you received: Do you want me to create this user ? [centreon] [y/n], default to [n]:

y useradd: invalid home directory '' Could not create user centreon FAIL The user centreon does not exist. CRITICAL

lpinsivy commented 6 years ago

This patch should correct this issue:

--- libinstall/functions.origin 2017-11-15 11:13:09.417910995 +0100
+++ libinstall/functions    2017-11-15 11:31:14.251508075 +0100
@@ -1837,7 +1838,7 @@
        fi
    fi
    if [ -z "$CENTREON_USER" ] ; then
-       answer_with_createuser "$(gettext "What is the Centreon user ?") [$DEFAULT_CENTREON_USER]" "$DEFAULT_CENTREON_USER" "CENTREON_USER"
+       answer_with_createuser "$(gettext "What is the Centreon user ?") [$DEFAULT_CENTREON_USER]" "$DEFAULT_CENTREON_USER" "CENTREON_USER" "$groups" "$description" "$home"
    fi
    log "INFO" "$(gettext "Centreon user") : $CENTREON_USER"
    return 0
adr-mo commented 6 years ago

If user centreon does not exist then script asks if it needs to be created. Answering yes lets the script create the user. The user is created OK

Looks good to me