<?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 Re: Root Can't Create /var/log files in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303301#M166340</link>
    <description>&lt;P&gt;Looks to me like there was a problem with the initial installation, or someone installed the forwarder as a different runtime user, and then restarted it as root.&lt;/P&gt;

&lt;P&gt;You can try fixing permissions first, &lt;STRONG&gt;chown -R splunk:splunk /opt/splunkforwarder&lt;/STRONG&gt;, then sudo to the splunk user and try running /opt/splunkforwarder/bin/splunk start.&lt;/P&gt;

&lt;P&gt;See if you get those errors still. Count to that you can chown that to root:root, and run splunk start as root and see if you get the same errors.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2017 14:28:20 GMT</pubDate>
    <dc:creator>esix_splunk</dc:creator>
    <dc:date>2017-08-28T14:28:20Z</dc:date>
    <item>
      <title>Root Can't Create /var/log files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303300#M166339</link>
      <description>&lt;P&gt;This is the first time this has come up:&lt;/P&gt;

&lt;P&gt;When running the following command as root:&lt;/P&gt;

&lt;P&gt;(10:07:49) root@servername:/opt/splunkforwarder/bin&lt;BR /&gt;
--&amp;gt; ./splunk enable boot-start -user splunk&lt;/P&gt;

&lt;P&gt;Warning: cannot create "/opt/splunkforwarder/var/log/splunk"&lt;/P&gt;

&lt;P&gt;Warning: cannot create "/opt/splunkforwarder/var/log/introspection"&lt;BR /&gt;
First-time-run has not finished.  Ignore this error when previewing migration - exiting.&lt;/P&gt;

&lt;P&gt;Any idea what could be causing this? Root permissions should have what's needed to create the var/log/ files &lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 14:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303300#M166339</guid>
      <dc:creator>heats</dc:creator>
      <dc:date>2017-08-28T14:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Root Can't Create /var/log files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303301#M166340</link>
      <description>&lt;P&gt;Looks to me like there was a problem with the initial installation, or someone installed the forwarder as a different runtime user, and then restarted it as root.&lt;/P&gt;

&lt;P&gt;You can try fixing permissions first, &lt;STRONG&gt;chown -R splunk:splunk /opt/splunkforwarder&lt;/STRONG&gt;, then sudo to the splunk user and try running /opt/splunkforwarder/bin/splunk start.&lt;/P&gt;

&lt;P&gt;See if you get those errors still. Count to that you can chown that to root:root, and run splunk start as root and see if you get the same errors.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 14:28:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303301#M166340</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2017-08-28T14:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Root Can't Create /var/log files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303302#M166341</link>
      <description>&lt;P&gt;Apparently someone has set the permissions on /opt/splunkforwarder so that only the owner of the directory can write files/folders under it.&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;chmod 700 /opt/splunkforwarder
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;would make it so that only the owner can read/write/execute it.  &lt;/P&gt;

&lt;P&gt;You can do the following to get around this but ultimately your permissions need to be fixed.  &lt;/P&gt;

&lt;P&gt;1st stop Splunk if it's running&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/opt/splunkforwarder/bin/splunk stop
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2nd, make root the owner of the Splunk dir:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;chown -Rf root. /opt/splunkforwarder
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;3rd, run the same boot start command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/opt/splunkforwarder/bin/splunk enable boot-start -user splunk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;4th, change ownership back to splunk user&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;chown -Rf splunk. /opt/splunkforwarder
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;5th, switch to Splunk user&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;su splunk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;6th, restart Splunk&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/opt/splunkforwarder/bin/splunk start
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Aug 2017 14:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303302#M166341</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-08-28T14:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Root Can't Create /var/log files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303303#M166342</link>
      <description>&lt;P&gt;Absolutely brilliant. I have been searching for this answer for quite some time. Thanks so much. The only extra step I had to do what kill the pid running splunk at the very end before su to splunk and starting splunk, b/c I couldn't stop splunk at the beginning of this sequence of commands due to the "unable to create introspection, var/log/splunk, and this was even as the root user! This all started from an improper clone of a server. Thanks again!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 16:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303303#M166342</guid>
      <dc:creator>joshualemoine</dc:creator>
      <dc:date>2019-06-17T16:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Root Can't Create /var/log files</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303304#M166343</link>
      <description>&lt;P&gt;anytime, thanks for the upvote(s)!&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 00:22:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Root-Can-t-Create-var-log-files/m-p/303304#M166343</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2019-06-18T00:22:50Z</dc:date>
    </item>
  </channel>
</rss>

