<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Splunk forwarder on Linux - ./splunk &amp;quot;commands&amp;quot; just hang in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489434#M16955</link>
    <description>&lt;P&gt;It has been a while since I have worked with Linux, but doing my best to refresh my knowledge. Successfully installed the latest forwarder on Ubuntu and it has actually phoned home and the deployment server has pushed config to it. But now it has stopped working. I have configured it to run as user 'splunk', not as root. This has caused some issue, for instance when I just now did run &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@myserver:~$ ./bin/splunk display deploy-client
Pid file "/opt/splunkforwarder/var/run/splunk/splunkd.pid" unreadable.: Permission denied
Pid file "/opt/splunkforwarder/var/run/splunk/splunkd.pid" unreadable.: Permission denied
Operation "ospath_fopen" failed in /opt/splunk/src/libzero/conf-mutator-locking.c:337, conf_mutator_lock(); Permission denied
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Did sudo to root and &lt;BR /&gt;
    /opt/splunkforwarder# chown -R splunk:splunk *&lt;BR /&gt;
Error did go away, but now when running the same command  (as Splunk) nothing happens. I must CTRL+C to "get out of it"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@myserver:~$ ./bin/splunk display deploy-client
^C
splunk@myserver:~$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Most likely more a basic Linux quesiton, but still, anyone who has an idea of what could be wrong?&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Update&lt;/EM&gt;&lt;BR /&gt;
And now I did try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@myserver:~$ ./bin/splunk list forward-server
Cannot initialize: /opt/splunkforwarder/etc/apps/learned/metadata/local.meta: Permission denied
Cannot initialize: /opt/splunkforwarder/etc/apps/learned/metadata/local.meta: Permission denied
Cannot initialize: /opt/splunkforwarder/etc/apps/learned/metadata/local.meta: Permission denied
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since I did do the chown, this &lt;EM&gt;should&lt;/EM&gt; not happen, so quite sure that I've done something not totally correct when installing as root and then switching to Splunk as described here &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/Admin/ConfigureSplunktostartatboottime#Enable_boot-start_as_a_non-root_user"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/Admin/ConfigureSplunktostartatboottime#Enable_boot-start_as_a_non-root_user&lt;/A&gt; - well, it is simply just the chown-command, but since &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@myserver:~$ ls -la /opt/splunkforwarder/etc/apps/learned/metadata/local.meta
-rw------- 1 root root 531 Mar  8 19:15 /opt/splunkforwarder/etc/apps/learned/metadata/local.meta
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Something is not correct on the server.&lt;/P&gt;</description>
    <pubDate>Sun, 08 Mar 2020 18:13:23 GMT</pubDate>
    <dc:creator>rune_hellem</dc:creator>
    <dc:date>2020-03-08T18:13:23Z</dc:date>
    <item>
      <title>Splunk forwarder on Linux - ./splunk "commands" just hang</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489434#M16955</link>
      <description>&lt;P&gt;It has been a while since I have worked with Linux, but doing my best to refresh my knowledge. Successfully installed the latest forwarder on Ubuntu and it has actually phoned home and the deployment server has pushed config to it. But now it has stopped working. I have configured it to run as user 'splunk', not as root. This has caused some issue, for instance when I just now did run &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@myserver:~$ ./bin/splunk display deploy-client
Pid file "/opt/splunkforwarder/var/run/splunk/splunkd.pid" unreadable.: Permission denied
Pid file "/opt/splunkforwarder/var/run/splunk/splunkd.pid" unreadable.: Permission denied
Operation "ospath_fopen" failed in /opt/splunk/src/libzero/conf-mutator-locking.c:337, conf_mutator_lock(); Permission denied
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Did sudo to root and &lt;BR /&gt;
    /opt/splunkforwarder# chown -R splunk:splunk *&lt;BR /&gt;
Error did go away, but now when running the same command  (as Splunk) nothing happens. I must CTRL+C to "get out of it"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@myserver:~$ ./bin/splunk display deploy-client
^C
splunk@myserver:~$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Most likely more a basic Linux quesiton, but still, anyone who has an idea of what could be wrong?&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Update&lt;/EM&gt;&lt;BR /&gt;
And now I did try &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@myserver:~$ ./bin/splunk list forward-server
Cannot initialize: /opt/splunkforwarder/etc/apps/learned/metadata/local.meta: Permission denied
Cannot initialize: /opt/splunkforwarder/etc/apps/learned/metadata/local.meta: Permission denied
Cannot initialize: /opt/splunkforwarder/etc/apps/learned/metadata/local.meta: Permission denied
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since I did do the chown, this &lt;EM&gt;should&lt;/EM&gt; not happen, so quite sure that I've done something not totally correct when installing as root and then switching to Splunk as described here &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.2/Admin/ConfigureSplunktostartatboottime#Enable_boot-start_as_a_non-root_user"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.2/Admin/ConfigureSplunktostartatboottime#Enable_boot-start_as_a_non-root_user&lt;/A&gt; - well, it is simply just the chown-command, but since &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@myserver:~$ ls -la /opt/splunkforwarder/etc/apps/learned/metadata/local.meta
-rw------- 1 root root 531 Mar  8 19:15 /opt/splunkforwarder/etc/apps/learned/metadata/local.meta
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Something is not correct on the server.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2020 18:13:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489434#M16955</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2020-03-08T18:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk forwarder on Linux - ./splunk "commands" just hang</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489435#M16956</link>
      <description>&lt;P&gt;Did you stop Splunk before running chown?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2020 20:41:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489435#M16956</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-08T20:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk forwarder on Linux - ./splunk "commands" just hang</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489436#M16957</link>
      <description>&lt;P&gt;Splunk service might be running under root user. First as splunk user try to stop service. If this doesn't work, then stop it as sudo or root user.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;/opt/splunkforwarder/bin/splunk stop&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Then Change home path permissions to splunk:splunk.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;chown -R splunk:splunk /opt/splunkforwarder&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Then start splunk and check permissions of the files.&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;/opt/splunkforwarder/bin/splunk start&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sun, 08 Mar 2020 20:43:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489436#M16957</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-08T20:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk forwarder on Linux - ./splunk "commands" just hang</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489437#M16958</link>
      <description>&lt;P&gt;the fact, that you get permission denied error after you ran chown indicate some other process modified the files afterwards, this could be just a running as root splunk process. You must frist stop spunk and then run the chown command.&lt;/P&gt;

&lt;P&gt;But... scratch that! Instead of tinker with linux permissions do it right from the beginning: the only command(*) you need to execute as root during splunk administration is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk enable boot-start -user splunk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;optionally with "-systemd-managed 1" if you run it on a systemd-enabled system.&lt;BR /&gt;
After that, you have to use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;su - splunk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to switch to splunk user (or similar command) and work as a restricted splunk user only.&lt;/P&gt;

&lt;P&gt;Why not login as splunk user directly from the start? Many splunkd admins do so, but it is better to leave this account without OS password so nobody except root can login. By doing so you effectively reducing the attack surface. &lt;/P&gt;

&lt;P&gt;(*) - of course you need modify file permissions, disable THP, adjust limits etc as root before and during you work with splunk, but it is linux admin operation, not splunk administration &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2020 20:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489437#M16958</guid>
      <dc:creator>PavelP</dc:creator>
      <dc:date>2020-03-08T20:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk forwarder on Linux - ./splunk "commands" just hang</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489438#M16959</link>
      <description>&lt;P&gt;Did check that, if I try to stop/start as user Splunk and permissions are wrong it will fail. I then sudo to root, change the owership and retry as user Splunk. It will then manage to stop and start. But still&lt;BR /&gt;
    splunk display deploy-client&lt;BR /&gt;
will just hang. &lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 09:55:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489438#M16959</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2020-03-09T09:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk forwarder on Linux - ./splunk "commands" just hang</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489439#M16960</link>
      <description>&lt;P&gt;I did a complete uninstall, and then instead of &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sudo su
dpkg -i /tmp/splunkforwarder-8.0.2-a7f645ddaf91-linux-2.6-amd64.deb
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I did &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sudo dpkg -i /tmp/splunkforwarder-8.0.2-a7f645ddaf91-linux-2.6-amd64.deb
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Result was not that messy, but still &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk@myserver:~/bin$ ./splunk  list forward-server
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it still hangs &lt;/P&gt;

&lt;P&gt;And btw - I do not know the password for the Splunk-user, so I have to &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sudo su splunk
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Mar 2020 11:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489439#M16960</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2020-03-09T11:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk forwarder on Linux - ./splunk "commands" just hang</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489440#M16961</link>
      <description>&lt;P&gt;I have not yet found the answer to my question, but I am quite sure that I have nailed it down to the cli not showing the prompt for the username/password - as it does whenever I try the same commands on Windows boxes where we have installed the forwarder. &lt;/P&gt;

&lt;P&gt;Therefore i have created a &lt;A href="https://answers.splunk.com/answers/809385/splunk-forwarder-on-linux-wont-show-login-when-req.html?minQuestionBodyLength=80+"&gt;new question with more precise information&lt;/A&gt;. &lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2020 13:23:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489440#M16961</guid>
      <dc:creator>rune_hellem</dc:creator>
      <dc:date>2020-03-09T13:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk forwarder on Linux - ./splunk "commands" just hang</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489441#M16962</link>
      <description>&lt;P&gt;"complete uninstall" can still leave some files in /opt/splunkforwarder. Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sudo /etc/init.d/SplunkForwarder stop # OR systemctl stop SplunkForwarder
ps aux|grep -i splunk # to be 100% sure there are no splunk processes running
sudo rm -r /opt/splunkforwarder # or any other folder where you've had it installed
sudo apt-get install /tmp/splunkforwarder*deb
/opt/splunkforwarder/bin/splunk enable boot-start -user splunk -systemd-managed 1
systemctl start SplunkForwarder
sudo su - splunk
/opt/splunkforwarder/bin/splunk add forward-server &amp;lt;splunk&amp;gt;:9997 # or use deployment server / deploy an app
/opt/splunkforwarder/bin/splunk list forward-server
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let us know if it worked&lt;/P&gt;</description>
      <pubDate>Tue, 10 Mar 2020 11:55:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Splunk-forwarder-on-Linux-splunk-quot-commands-quot-just-hang/m-p/489441#M16962</guid>
      <dc:creator>PavelP</dc:creator>
      <dc:date>2020-03-10T11:55:33Z</dc:date>
    </item>
  </channel>
</rss>

