[ 
https://issues.apache.org/jira/browse/CASSANDRA-17773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17571361#comment-17571361
 ] 

Claude Warren commented on CASSANDRA-17773:
-------------------------------------------

This is from the cassandra.in.sh in /bin (there is another one in /tools/bin/ 
but I don't see where that one gets copied to the system.
{noformat}
if [ "x$CASSANDRA_HOME" = "x" ]; then
    CASSANDRA_HOME="`dirname "$0"`/.."
fi

# The directory where Cassandra's configs live (required)
if [ "x$CASSANDRA_CONF" = "x" ]; then
    CASSANDRA_CONF="$CASSANDRA_HOME/conf"
fi

# The java classpath (required)
CLASSPATH="$CASSANDRA_CONF"

# the default location for commitlogs, sstables, and saved caches
# if not set in cassandra.yaml
cassandra_storagedir="$CASSANDRA_HOME/data"
  {noformat}
The cassandra.in.sh is copied to /usr/share/cassandra.  So CASSANDRA_HOME 
points there.  There is no conf directory under it.

the content of the /conf directory in the project is copied to /etc/cassandra.  
So I think that CASSANDRA_CONF should point to /etc/cassandra.  Optionally we 
could create a symbolic link from $CASSANDRA_HOME/conf to /etc/cassandra and 
leave the CASSANDRA_CONF alone.

cassandra_storagedir points to a directory that does not exist after install 
and before execution.  Unless Cassandra is run with root permissions it will 
not be able to create the /data directory.  I don't see anything in the debian 
install that would change the permission to create, read, or write a 
CASSANDRA_HOME/data directory, but then I could have missed it.

in the cassandra file in /bin we find this:
{noformat}
if [ "x$CASSANDRA_INCLUDE" = "x" ]; then
    # Locations (in order) to use when searching for an include file.
    for include in "`dirname "$0"`/cassandra.in.sh" \
                   "$HOME/.cassandra.in.sh" \
                   /usr/share/cassandra/cassandra.in.sh \
                   /usr/local/share/cassandra/cassandra.in.sh \
                   /opt/cassandra/cassandra.in.sh; do
        if [ -r "$include" ]; then
            . "$include"
            break
        fi
    done
# ...otherwise, source the specified include.
elif [ -r "$CASSANDRA_INCLUDE" ]; then
    . "$CASSANDRA_INCLUDE"
fi# If numactl is available, use it. For Cassandra, the priority is to
# avoid disk I/O. Even for the purpose of CPU efficiency, we don't
# really have CPU<->data affinity anyway. Also, empirically test that numactl
# works before trying to use it (CASSANDRA-3245).
NUMACTL_ARGS=${NUMACTL_ARGS:-"--interleave=all"}
if which numactl >/dev/null 2>/dev/null && numactl $NUMACTL_ARGS ls / 
>/dev/null 2>/dev/null
then
    NUMACTL="numactl $NUMACTL_ARGS"
else
    NUMACTL=""
fiif [ -z "$CASSANDRA_CONF" -o -z "$CLASSPATH" ]; then
    echo "You must set the CASSANDRA_CONF and CLASSPATH vars" >&2
    exit 1
fiif [ -f "$CASSANDRA_CONF/cassandra-env.sh" ]; then
    . "$CASSANDRA_CONF/cassandra-env.sh"
fi {noformat}
So the system installed on Debian including the 
/usr/share/cassandra/cassandra.in.sh and then later is trying to read 
cassandra-env.sh from /usr/share/cassandra/conf which does not exist so the 
cassandra-env.sh is not read.

 

> Incorrect cassandra.logdir on Debian systems
> --------------------------------------------
>
>                 Key: CASSANDRA-17773
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-17773
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Packaging
>            Reporter: Eric Evans
>            Priority: Normal
>              Labels: lhf
>             Fix For: 3.0.x, 3.11.x, 4.0.x, 4.1-rc
>
>
> The Debian packaging patches bin/cassandra to use /var/log/cassandra for 
> logs, it does so conditionally however, only if CASSANDRA_LOG_DIR is unset. 
> This occurs _after_ cassandra-env.sh is sourced though, which also sets 
> CASSANDRA_LOG_DIR if unset (to $CASSANDRA_HOME/logs).  The result is that 
> -Dcassandra.lodir is set to /usr/share/cassandra/logs on Debian systems.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to