Installation

Error starting Splunk6 after install

_gkollias
Builder

I'm unable to start Splunk 6 after installing in /opt/splunk/

After trying to start splunk via ./splunk start, or check status with ./splunk status, I get this message:

"Couldn't determine $SPLUNK_HOME, perhaps it should be set in environment"

Your help with getting passed this would be much appreciated.

Thanks!

Tags (2)
0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

Hi KolGr001,

did you ran ./splunk with the user account which was used for the install? Usually you will find something like this in your user .profile|.bash_profile (change this to your users matching shell):

source /opt/splunk/bin/setSplunkEnv

This will take care of all the needed enviroment setting for your user. Also check on the file permission, if you installed Splunk with your root account, make sure your Splunk service user has the permission to read/write into /opt/splunk.

update:
Just tested and if you cannot access or worse, if the file /opt/splunk/etc/splunk-launch.conf does not exits you get exactly this message:

open("/opt/splunk/bin/../etc/splunk-launch.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/opt/splunk/bin/../etc/splunk-launch.conf.default", O_RDONLY) = -1 ENOENT (No such file or directory)
write(1, "Couldn't determine $SPLUNK_HOME,"..., 73Couldn't determine $SPLUNK_HOME, perhaps it should be set in environment) = 73

hope this helps ...

cheers, MuS

View solution in original post

MuS
SplunkTrust
SplunkTrust

Hi KolGr001,

did you ran ./splunk with the user account which was used for the install? Usually you will find something like this in your user .profile|.bash_profile (change this to your users matching shell):

source /opt/splunk/bin/setSplunkEnv

This will take care of all the needed enviroment setting for your user. Also check on the file permission, if you installed Splunk with your root account, make sure your Splunk service user has the permission to read/write into /opt/splunk.

update:
Just tested and if you cannot access or worse, if the file /opt/splunk/etc/splunk-launch.conf does not exits you get exactly this message:

open("/opt/splunk/bin/../etc/splunk-launch.conf", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/opt/splunk/bin/../etc/splunk-launch.conf.default", O_RDONLY) = -1 ENOENT (No such file or directory)
write(1, "Couldn't determine $SPLUNK_HOME,"..., 73Couldn't determine $SPLUNK_HOME, perhaps it should be set in environment) = 73

hope this helps ...

cheers, MuS

_gkollias
Builder

I was thinking the same thing - thanks!!

0 Karma

MuS
SplunkTrust
SplunkTrust

looks like your install is messed up. I can reproduce this on my two servers like this in the $SPLUNK_HOME/bin directory ...

  • good server, Splunk works

    cd bin/
    bin]$ source setSplunkEnv
    bin]$

  • bad server, simply deleted almost everything in /opt/splunk

    cd bin/
    bin]$ source setSplunkEnv
    -bash: eval: line 38: unexpected EOF while looking for matching `''
    -bash: eval: line 39: syntax error: unexpected end of file

Since this a new setup I suggest to download a fresh copy of Splunk and re-install Splunk.

_gkollias
Builder

Hi MuS,

Thanks for your response. I did run ./splunk as splunk user which is the account I installed it on. I tried what you first suggested and got this message [splunk@serverName bin]$ source /opt/splunk/splunk/bin/setSplunkEnv
-bash: eval: line 38: unexpected EOF while looking for matching `''
-bash: eval: line 39: syntax error: unexpected end of file

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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...