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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...