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
Legend

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
Legend

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
Legend

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
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 ...