Splunk Search

error loading shared libraries running as non root user

ajs07635
Explorer

I am trying to run splunk as a non-root user, but every time i start splunk I get the error "splunkd: error while loading shared libraries: libxslt.so.1: cannot open shared object file: No such file or directory"

I have created a user and group named "splunk" to run the server as. I have given it rights to read/write /opt/splunk. Even if I do:

$ sudo -u splunk bash
bash$ source /opt/splunk/bin/setSplunkEnv
bash$ /opt/splunk/bin/splunk start

I still get that error. As long as i set the $SPLUNK_HOME using setSplunkEnv, ldd correctly finds all the libraries on the system or in the /opt/splunk/lib/ directory.

It does work fine when I start it as root.

To make things more complicated, my sysadmins tell me that having /opt/splunk/lib in /etc/ld.so.conf breaks their Red Hat Network update stuff so they removed it. So, I tried the following before starting splunk:

export LD_LIBRARY_PATH=/opt/splunk/lib

which also results in ldd finding all the libraries, but I still get the error when starting splunkd.

$ sudo -u splunk bash
bash$ export LD_LIBRARY_PATH=/opt/splunk/lib
bash$ source /opt/splunk/bin/setSplunkEnv
bash$ /opt/splunk/bin/splunk start
Splunk> All batbelt. No tights.

Checking Prerequisites...
        Checking http port [8000]: open
        Checking mgmt port [8089]: open
        Checking configuration...  Done.
        Checking index directory...  Done.
        Checking databases...
        Validated databases: _audit, _blocksignature, _internal, _thefishbucket, history, main, sample, summary, test
        Checking for SELinux
All Preliminary checks passed.

splunkd: error while loading shared libraries: libxslt.so.1: cannot open shared object file: No such file or directory
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

You shouldn't need to do any of this stuff, much less mess with the system /etc/ld.so.conf. What I would do is:

  • Make sure that the ownership of the entire /opt/splunk hierarchy is owned by the running user (use chown -R)
  • re-extract/re-install the Splunk files (say, using tar -xf). It's possible that some files weren't extracted correctly.

There's not really very much more to it.

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

You shouldn't need to do any of this stuff, much less mess with the system /etc/ld.so.conf. What I would do is:

  • Make sure that the ownership of the entire /opt/splunk hierarchy is owned by the running user (use chown -R)
  • re-extract/re-install the Splunk files (say, using tar -xf). It's possible that some files weren't extracted correctly.

There's not really very much more to it.

ajs07635
Explorer

I had a sysadmin reinstall splunk and then upgrade it to 4.2 and it seems to be working fine, so I guess that must have been the issue. Thanks.

ajs07635
Explorer

chown -R splunk:splunk was run on /opt/splunk and everything is owned by the running user. I'll have the sysadmins reinstall the rpm and see if that makes a difference

0 Karma

ajs07635
Explorer

Oh, and if its helpful to anyone, the OS is RHEL6 x86_64

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...