Installation

Scripted Install fails for Splunk 5 due to End User License Agreement acceptance

dbrown_sfdc
New Member

Our company has an Enterprise License for Splunk. We have scripted the install for upgrade and for fresh implementations of Splunk 5. However, the acceptance of the End User License agreement is causing our scripts to fail.

In versions prior to Splunk 5 we used the following commands from a shell script:

$SPLUNK_HOME/bin/splunk start --accept-license --answer-yes

Now it fails to accept the license during script run time.

Is there an updated command set to continue past the license acceptance?
Or..
Does anyone know of a scripted method to work around this problem?

Thank you!

0 Karma

jay007ant
Explorer

Hi,
In versions prior to Splunk 5 I used the following commands from a shell script:
$SPLUNK_HOME/bin/splunk start --accept-license --answer-yes --auto-ports --no-prompt

0 Karma

tbarnard
Explorer

This is what I use for my scripted installs.

/sbin/service splunk start --answer-yes --no-prompt --accept-license

dbrown_sfdc
New Member

Does this work in version 5?

0 Karma

jcoates_splunk
Splunk Employee
Splunk Employee

here's my new-splunk.sh...

#!/bin/sh

# Support goofy Splunk homes... 
APPS=`echo $SPLUNK_HOME | awk 'BEGIN { FS="/"} {printf "/"; for(i=2;i<=NF-1;i++) printf $i "/"; printf "\n"}'`

#Download directory
. set_demo_home.sh
DOWNLOADS="$DEMO_SCRIPT_HOME/Downloads/"
LICENSE=`ls $DOWNLOADS*.license | sort -n | tail -n 1`

# get the latest version
if [ -e "/tmp/latestsplunkserver" ]
    then SPLUNK=`cat /tmp/latestsplunkserver`
fi

if [ ! -e $DOWNLOADS$SPLUNK ]
    then echo "Can't find Splunk at $DOWNLOADS$SPLUNK!"
    exit 1
fi

# Do the extraction
tar xzf $DOWNLOADS$SPLUNK -C $APPS

# if SPLUNK is not supposed to live in a folder called "splunk" we'll need to
# deal with that.
SPLUNK_FOLDER=`echo $SPLUNK_HOME | awk 'BEGIN { FS="/"} {print $NF}'`
if [ ! $SPLUNK_FOLDER = "splunk" ]
    then mv $APPS/splunk $SPLUNK_HOME
fi

DIR="$SPLUNK_HOME/etc"

# Need to uncomment and change SPLUNK_HOME from /opt/splunk to /Applications/splunk
sed 's/# SPLUNK_HOME/SPLUNK_HOME/g' < $DIR/splunk-launch.conf.default > $DIR/splunk-launch.conf
sed 's/opt/Applications/g' < $DIR/splunk-launch.conf.default > $DIR/splunk-launch.conf

# let's change a few default settings
fix-splunk-defaults.sh

# don't need deployment apps or Getting Started
rm -rf $DIR/deployment-apps
rm -rf $DIR/apps/gettingstarted
rm -rf $DIR/apps/sample_app

BIN="$SPLUNK_HOME/bin/splunk"

# handle licensing
$BIN start --accept-license
$BIN login -auth admin:changeme 
$BIN add licenses $LICENSE

echo "Splunk is refreshed now (NOTE: it still needs a restart)."

jcoates_splunk
Splunk Employee
Splunk Employee

yes, I'm using it in automated builds for some demo and test environments.

0 Karma

dbrown_sfdc
New Member

This seemed to work. Does it work for version 5 in your environment?

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...