<?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: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot? in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195433#M7327</link>
    <description>&lt;P&gt;By default most modern UNIX systems have pam_limits enabled, and &lt;STRONG&gt;/etc/security/limits.d/&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Instead of editing &lt;STRONG&gt;/etc/security/limits.conf&lt;/STRONG&gt;, create a file  &lt;STRONG&gt;/etc/security/limits.d/99-splunk.com&lt;/STRONG&gt; with the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; splunk    hard   nofile   20240
 splunk    soft    nofile   10240
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This just makes it easier to add/remove via any automation (puppet, chef..) or included in your own packages. This will also work if you for some reason chose to run anything splunk as 'root' too  &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; But that is an entirely different problem&lt;/P&gt;

&lt;P&gt;(RBAC and facls) are your friend &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Aug 2015 17:54:26 GMT</pubDate>
    <dc:creator>oxdeadbeef</dc:creator>
    <dc:date>2015-08-26T17:54:26Z</dc:date>
    <item>
      <title>Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195428#M7322</link>
      <description>&lt;P&gt;I am running Ubuntu version 14 with Splunk version 6.2.2 and have noticed some strangeness with the Ulimits not being respected when the server is rebooted and Splunk is restarted by the OS. &lt;/P&gt;

&lt;P&gt;The following edits were made to the /etc/security/limits.conf file:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk    hard   nofile   20240
splunk    soft    nofile   10240
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The /etc/pam.d/sudo and /etc/pam.d/su files were also edited to add:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;session  required  pam_limits.so
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Upon starting Splunk manually (i.e. running splunk start from the CLI), the splunkd logs clearly show a limits setting of 20240. However, after a reboot of the server, these limits are not respected and the splunkd logs show an open file limit number of 4096.&lt;/P&gt;

&lt;P&gt;Note - I ran the following after installing Splunk to ensure Splunk restarts after a reboot of the server.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk enable boot-start
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Mar 2015 19:11:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195428#M7322</guid>
      <dc:creator>pj</dc:creator>
      <dc:date>2015-03-25T19:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195429#M7323</link>
      <description>&lt;P&gt;It would appear that there is a bug/issue with Ubuntu and perhaps similar Linux OS's where the ulimits settings are not respected, resulting in the above characteristics.&lt;/P&gt;

&lt;P&gt;Upon running the &lt;STRONG&gt;splunk enable boot-start&lt;/STRONG&gt; command, a Splunk script is added to the /etc/init.d/ directory. A verified fix for this issue involves editing the Splunk script and hard-coding in the hard and soft ulimits to the Splunk script as follows:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Edit: /etc/init.d/splunk&lt;/LI&gt;
&lt;LI&gt;Modify the script so that is looks like the below code segment, adding in the high and low limits&lt;/LI&gt;
&lt;LI&gt;Reboot the server: sudo shutdown -r now&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;&lt;STRONG&gt;Script Modification:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk_start() {
 echo Starting Splunk...
 ulimit -Hn 20240
 ulimit -Sn 10240
 "/opt/splunk/bin/splunk" start --no-prompt --answer-yes
 RETVAL=$?
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; The init.d Splunk script is created only AFTER you have installed Splunk and run the splunk enable boot-start command.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 19:22:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195429#M7323</guid>
      <dc:creator>pj</dc:creator>
      <dc:date>2015-03-25T19:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195430#M7324</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;As per your configuration for hardlimit and softlimit, you are setting ulimit for splunk user &amp;amp; you are running splunk as splunk user. &lt;/P&gt;

&lt;P&gt;So can you please setup a bootscript with below command &lt;STRONG&gt;if you are running splunk as splunk user&lt;/STRONG&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$SPLUNK_HOME/bin/splunk enable boot-start -user splunk
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I hope this solves your issue.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Harshil&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 19:38:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195430#M7324</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2015-03-25T19:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195431#M7325</link>
      <description>&lt;P&gt;I was running it as a splunk user - just forgot to add that line. Even if you add this - it makes no difference. The issue even affects the root user (if you run splunk as root). The only solution I have found to date is the edit to the script.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 19:48:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195431#M7325</guid>
      <dc:creator>pj</dc:creator>
      <dc:date>2015-03-25T19:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195432#M7326</link>
      <description>&lt;P&gt;Typo - the last command should have been -&lt;BR /&gt;
     splunk enable boot-start -user splunk&lt;/P&gt;

&lt;P&gt;I am running Splunk as the Splunk user, but this issue also appears to affect the root user for those running Splunk as root.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 19:52:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195432#M7326</guid>
      <dc:creator>pj</dc:creator>
      <dc:date>2015-03-25T19:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195433#M7327</link>
      <description>&lt;P&gt;By default most modern UNIX systems have pam_limits enabled, and &lt;STRONG&gt;/etc/security/limits.d/&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Instead of editing &lt;STRONG&gt;/etc/security/limits.conf&lt;/STRONG&gt;, create a file  &lt;STRONG&gt;/etc/security/limits.d/99-splunk.com&lt;/STRONG&gt; with the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; splunk    hard   nofile   20240
 splunk    soft    nofile   10240
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This just makes it easier to add/remove via any automation (puppet, chef..) or included in your own packages. This will also work if you for some reason chose to run anything splunk as 'root' too  &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; But that is an entirely different problem&lt;/P&gt;

&lt;P&gt;(RBAC and facls) are your friend &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Aug 2015 17:54:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195433#M7327</guid>
      <dc:creator>oxdeadbeef</dc:creator>
      <dc:date>2015-08-26T17:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195434#M7328</link>
      <description>&lt;P&gt;We ran into this same issue on RHEL 7.  After some digging, we found that daemons loaded by systemd ignore anything in /etc/security/limits.conf AND limits.d/*&lt;/P&gt;

&lt;P&gt;We wound up extending the service with a file in /etc/systemd/system that sets the limits.&lt;/P&gt;

&lt;P&gt;Here are the steps we followed:&lt;/P&gt;

&lt;P&gt;First, create directory /etc/systemd/system/splunk.service.d/ if it does not exist.&lt;BR /&gt;
Then create a file in that directory called "filelimit.conf"&lt;/P&gt;

&lt;P&gt;The contents of filelimit.conf should look like this (replacing the limit with whatever value you need):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Service]
LimitNOFILE=65535
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We found this better than trying to modify the init.d script on systems that utilize systemd for startup.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2016 14:29:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195434#M7328</guid>
      <dc:creator>brian_rampley</dc:creator>
      <dc:date>2016-08-16T14:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195435#M7329</link>
      <description>&lt;P&gt;Is this file overwritten every time you upgrade?  We are also experiencing this issue and looking for the most practical solution.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jun 2017 18:11:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195435#M7329</guid>
      <dc:creator>robert_miller</dc:creator>
      <dc:date>2017-06-28T18:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195436#M7330</link>
      <description>&lt;P&gt;Hi, Splunk does not overwrite the init.d script during upgrade.&lt;BR /&gt;
It is generated once when you run the "enable boot-start" command during initial installation.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 19:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195436#M7330</guid>
      <dc:creator>guilmxm</dc:creator>
      <dc:date>2017-06-30T19:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195437#M7331</link>
      <description>&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.6.2/Admin/ConfigureSplunktostartatboottime"&gt;http://docs.splunk.com/Documentation/Splunk/6.6.2/Admin/ConfigureSplunktostartatboottime&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Check out this not in docs about updating the init.d for splunk user&lt;/P&gt;</description>
      <pubDate>Sat, 05 Aug 2017 23:01:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195437#M7331</guid>
      <dc:creator>mcronkrite_splu</dc:creator>
      <dc:date>2017-08-05T23:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195438#M7332</link>
      <description>&lt;P&gt;@mcronkrite, Thanks a lot.&lt;/P&gt;

&lt;P&gt;That's great to see that the doc has been finally updated and the problem taken in consideration, even if it took ages &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
But never too late!&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 14:26:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195438#M7332</guid>
      <dc:creator>guilmxm</dc:creator>
      <dc:date>2017-08-09T14:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195439#M7333</link>
      <description>&lt;P&gt;It should be mentioned that this works (on CentOS 7) after a full host reboot. Just restarting splunk is insufficient.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 15:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195439#M7333</guid>
      <dc:creator>DUThibault</dc:creator>
      <dc:date>2017-10-31T15:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195440#M7334</link>
      <description>&lt;P&gt;Thanks @brian.rampley !  Running RHEL 7.2 and indeed the &lt;CODE&gt;/etc/security/limits.conf&lt;/CODE&gt; was being ignored.  My &lt;CODE&gt;ulimit -a&lt;/CODE&gt; value and what was showing up in splunk (from the health check) were different.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;created the &lt;CODE&gt;splunk.service.d&lt;/CODE&gt; directory&lt;/LI&gt;
&lt;LI&gt;put the flielimit.conf parameters that weren't matching between my system and splunk health check&lt;/LI&gt;
&lt;LI&gt;ran &lt;CODE&gt;systemctl daemon-reload&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;full system reboot&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Did the trick!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Dec 2017 15:55:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195440#M7334</guid>
      <dc:creator>DEAD_BEEF</dc:creator>
      <dc:date>2017-12-18T15:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195441#M7335</link>
      <description>&lt;P&gt;thanks for this, fixed our issue by adding this to the splunk_start( ) function&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 16:44:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195441#M7335</guid>
      <dc:creator>ehorwood</dc:creator>
      <dc:date>2018-02-23T16:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why are my ulimits settings not being respected on ubuntu/debian after a server reboot?</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195442#M7336</link>
      <description>&lt;P&gt;Thank you sharing great answers &lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 16:47:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Why-are-my-ulimits-settings-not-being-respected-on-ubuntu-debian/m-p/195442#M7336</guid>
      <dc:creator>manchun</dc:creator>
      <dc:date>2018-02-23T16:47:04Z</dc:date>
    </item>
  </channel>
</rss>

