From 6a18634f9fcfb2abc14b56af3d904de9dcd1ac25 Mon Sep 17 00:00:00 2001 From: Shlomi Livne Date: Wed, 23 Mar 2016 17:39:01 +0200 Subject: [PATCH] scylla_io_setup import scylla-server env args scylla_io_seup requires the scylla-server env to be setup to run correctly. previously scylla_io_setup was encapsulated in scylla-io.service that assured this. extracting CPUSET,SMP from SCYLLA_ARGS as CPUSET is needed for invoking io_tune Signed-off-by: Shlomi Livne Message-Id: --- dist/common/scripts/scylla_io_setup | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dist/common/scripts/scylla_io_setup b/dist/common/scripts/scylla_io_setup index ff54e93721..b8e9e3d703 100755 --- a/dist/common/scripts/scylla_io_setup +++ b/dist/common/scripts/scylla_io_setup @@ -30,10 +30,17 @@ output_to_user() logger -p user.err "$1" } +. /etc/os-release +if [ "$NAME" = "Ubuntu" ]; then + . /etc/default/scylla-server +else + . /etc/sysconfig/scylla-server +fi + if [ `is_developer_mode` -eq 0 ]; then + SMP=`echo $SCYLLA_ARGS|grep smp|sed -e "s/^.*smp\(\s\+\|=\)\([0-9]*\).*$/\2/"` + CPUSET=`echo $SCYLLA_ARGS|grep cpuset|sed -e "s/^.*\(--cpuset\(\s\+\|=\)[0-9\-]*\).*$/\1/"` if [ $AMI -eq 1 ]; then - SMP=`echo $SCYLLA_ARGS|grep smp|sed -e "s/^.*smp\(\s\+\|=\)\([0-9]*\).*$/\2/"` - CPUSET=`echo $SCYLLA_ARGS|grep cpuset|sed -e "s/^.*\(--cpuset\(\s\+\|=\)[0-9\-]*\).*$/\1/"` NR_CPU=`cat /proc/cpuinfo |grep processor|wc -l` NR_DISKS=`lsblk --list --nodeps --noheadings | grep -v xvda | grep xvd | wc -l` TYPE=`curl http://169.254.169.254/latest/meta-data/instance-type|cut -d . -f 1`