datastax / diagnostic-collection

Diagnostic Collector for Apache Cassandra
Apache License 2.0
28 stars 36 forks source link

Package installation detection failure #13

Closed yabinmeng closed 2 years ago

yabinmeng commented 4 years ago

The detection of packaged installation for both OSS C* and DSE fails.

# COSS package install
        if [ -z "$ROOT_DIR" ] && [ -d "/etc/cassandra" ] && [ -d "/usr/share/cassandra" ]; then
            IS_PACKAGE="true"
... ...
# DSE install
    elif [ "$TYPE" == "dse" ]; then
        IS_DSE="true"
        # DSE package install
        debug "DSE install: Checking install type..."
        if [ -z "$ROOT_DIR" ] && [ -d "/etc/dse" ] && [ -f "/etc/default/dse" ] && [ -d "/usr/share/dse/" ]; then
            IS_PACKAGE="true"

In the first if condition ([ -z "$ROOT_DIR" ]), "-z" should be "-d".

alexott commented 4 years ago

-z is used here to use if the root directory was explicitly passed or not, if not, then try to automatically detect if it's a package as opposite to the tarball install