<?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: Is there a systemd unit file for Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70166#M180631</link>
    <description>&lt;P&gt;Updated:&lt;/P&gt;

&lt;P&gt;[Unit]&lt;BR /&gt;
Description=Splunk service&lt;BR /&gt;
Documentation=&lt;BR /&gt;
After=network.target&lt;BR /&gt;
Wants=network.target&lt;/P&gt;

&lt;P&gt;[Service]&lt;BR /&gt;
Type=forking&lt;BR /&gt;
RemainAfterExit=yes&lt;BR /&gt;
Restart=on-failure&lt;BR /&gt;
RestartSec=30s&lt;BR /&gt;
User=splunk&lt;BR /&gt;
Group=splunk&lt;BR /&gt;
LimitNOFILE=64000&lt;BR /&gt;
ExecStart=/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt&lt;BR /&gt;
ExecStop=/opt/splunk/bin/splunk stop&lt;BR /&gt;
ExecReload=/opt/splunk/bin/splunk restart&lt;/P&gt;

&lt;P&gt;[Install]&lt;BR /&gt;
WantedBy=multi-user.target&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2016 16:20:08 GMT</pubDate>
    <dc:creator>ephemeric</dc:creator>
    <dc:date>2016-08-11T16:20:08Z</dc:date>
    <item>
      <title>Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70156#M180621</link>
      <description>&lt;P&gt;systemd replaces SysV init scripts and some Linux distributions are migrating to or currently support systemd (such as Arch Linux). The traditional start-up script /etc/init.d/splunk (or /etc/rc.d/splunk) does not work in a pure systemd configuration, a unit file is required.&lt;/P&gt;

&lt;P&gt;This thread is getting outdated. See the official documentation and additional information below:&lt;BR /&gt;
- &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Admin/RunSplunkassystemdservice"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Admin/RunSplunkassystemdservice&lt;/A&gt;&lt;BR /&gt;
- &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Workloads/Configuresystemd"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Workloads/Configuresystemd&lt;/A&gt;&lt;BR /&gt;
- &lt;A href="https://answers.splunk.com/answers/738877/splunk-systemd-unit-file-in-versions-722-and-newer.html"&gt;https://answers.splunk.com/answers/738877/splunk-systemd-unit-file-in-versions-722-and-newer.html&lt;/A&gt;&lt;BR /&gt;
- &lt;A href="https://www.duanewaddle.com/splunk-7-2-2-and-systemd/"&gt;https://www.duanewaddle.com/splunk-7-2-2-and-systemd/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2012 20:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70156#M180621</guid>
      <dc:creator>Yorokobi</dc:creator>
      <dc:date>2012-09-24T20:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70157#M180622</link>
      <description>&lt;P&gt;EDIT: I have tested this on Arch Linux and CentOS 7. I added the LimitNOFILE and PIDFile entries based on feedback from this Answers thread and conversations in both Splunk IRC and User Group Slack.&lt;/P&gt;

&lt;P&gt;This unit file works for both Enterprise Splunk and the Universal Forwarder, simply change the description, paths, and unit file name as appropriate.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/etc/systemd/system/splunkd.service

[Unit]
Description=Splunk Enterprise 6.5.0
After=network.target
Wants=network.target

[Service]
Type=forking
RemainAfterExit=False
User=splunk
Group=splunk
LimitNOFILE=65536
ExecStart=/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt
ExecStop=/opt/splunk/bin/splunk stop
PIDFile=/opt/splunk/var/run/splunk/splunkd.pid

[Install]
WantedBy=multi-user.target
# If you want to use $(systemctl [start|stop|restart] splunk) instead of splunkd ...
Alias=splunk.service
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Sep 2012 20:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70157#M180622</guid>
      <dc:creator>Yorokobi</dc:creator>
      <dc:date>2012-09-24T20:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70158#M180623</link>
      <description>&lt;P&gt;To enable the unit file:&lt;BR /&gt;
    sudo systemctl enable splunkd&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2012 20:56:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70158#M180623</guid>
      <dc:creator>Yorokobi</dc:creator>
      <dc:date>2012-09-24T20:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70159#M180624</link>
      <description>&lt;P&gt;According to systemd docs, variables cannot be used as the first argument of the ExecStart, ExecStop, and/or ExecReload options. Systemd will not expand those variables. My testing agrees with the documentation. I had to restore the absolute path as shown in the top entry of this answer.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2012 00:53:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70159#M180624</guid>
      <dc:creator>sspencer_splunk</dc:creator>
      <dc:date>2012-12-17T00:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70160#M180625</link>
      <description>&lt;P&gt;Here's something I threw together for a Universal Forwarder that's installed on a Fedora 17 endpoint. It should work on most *nix distros. There are a few assumptions I've made:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;You have NOT previously enabled Splunk to start at boot by running the command "splunk enable boot-start" or performed some similar action to start Splunk automatically.&lt;/LI&gt;
&lt;LI&gt;You are going to run the forwarder with root privileges. (Look up systemd.exec(5) man page for details on running the forwarder as a less-privileged user.)&lt;/LI&gt;
&lt;LI&gt;Your forwarder is installed in /opt/splunkforwarder.&lt;/LI&gt;
&lt;LI&gt;You will perform these commands below as root or with equivalent sudo privileges.&lt;/LI&gt;
&lt;/UL&gt;

&lt;HR /&gt;

&lt;P&gt;I started with &lt;A href="http://splunk-base.splunk.com/users/4349/yorokobi"&gt;Yorokobi's&lt;/A&gt; template above. Copy this text into a file named "/usr/lib/systemd/system/splunkforwarder.service".&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Unit]
Description=Splunk Universal Forwarder
Wants=network.target
After=network.target

[Service]
Type=forking
RemainAfterExit=yes
ExecStart=/opt/splunkforwarder/bin/splunk start
ExecStop=/opt/splunkforwarder/bin/splunk stop
ExecReload=/opt/splunkforwarder/bin/splunk restart
StandardOutput=syslog

[Install]
WantedBy=multi-user.target
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Next, create a symlink that systemd will use to fetch this control file.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cd /etc/systemd/system/multi-user.target.wants
ln -sf /usr/lib/systemd/system/splunkforwarder.service splunkforwarder.service
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That's it.&lt;/P&gt;

&lt;P&gt;Next time you reboot your endpoint, the Splunk Forwarder should start automatically. You can now use systemctl to start and stop the Splunk forwarder at your leisure.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Dec 2012 01:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70160#M180625</guid>
      <dc:creator>sspencer_splunk</dc:creator>
      <dc:date>2012-12-17T01:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70161#M180626</link>
      <description>&lt;P&gt;Good catch, sspencer. I expect these answers will change over time as systemd evolves.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2012 21:46:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70161#M180626</guid>
      <dc:creator>Yorokobi</dc:creator>
      <dc:date>2012-12-21T21:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70162#M180627</link>
      <description>&lt;P&gt;Don't need syslog as Splunk logs to splunkd.log and has user and group assigned.&lt;/P&gt;

&lt;P&gt;One doesn't need the symlink as above, simply do:&lt;/P&gt;

&lt;P&gt;systemctl enable splunkindexer.service&lt;/P&gt;

&lt;P&gt;[Unit]&lt;BR /&gt;
Description=Splunk indexer service&lt;BR /&gt;
Wants=network.target&lt;BR /&gt;
After=network.target&lt;/P&gt;

&lt;P&gt;[Service]&lt;BR /&gt;
Type=forking&lt;BR /&gt;
RemainAfterExit=yes&lt;BR /&gt;
Restart=on-failure&lt;BR /&gt;
RestartSec=30s&lt;BR /&gt;
User=splunk&lt;BR /&gt;
Group=splunk&lt;BR /&gt;
ExecStart=/opt/splunk/bin/splunk start&lt;BR /&gt;
ExecStop=/opt/splunk/bin/splunk stop&lt;BR /&gt;
ExecReload=/opt/splunk/bin/splunk restart&lt;BR /&gt;
StandardOutput=null&lt;/P&gt;

&lt;P&gt;[Install]&lt;BR /&gt;
WantedBy=multi-user.target&lt;/P&gt;</description>
      <pubDate>Wed, 06 May 2015 13:17:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70162#M180627</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2015-05-06T13:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70163#M180628</link>
      <description>&lt;P&gt;ephemeric, you nailed the config. My two additions:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;1. Use /usr/local for custom configs&lt;/STRONG&gt;&lt;BR /&gt;
Good sysadmin practice would be to put the config in /usr/local/lib rather than /usr/lib, since it isn't managed by the package--systemd supports this for that reason.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;2. Daemon reload is required to read the new config before you can run a systemctl enable&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;My steps (as root) were the following:&lt;BR /&gt;
&lt;EM&gt;(note that I am using the name "splunk.service" for service and file)&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mkdir -p /usr/local/lib/systemd/system/
cp ~/MYCUSTOM.systemd.splunk.service /usr/local/lib/systemd/system/splunk.service
systemctl daemon-reload
systemctl enable splunk.service
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2015 09:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70163#M180628</guid>
      <dc:creator>mcs24</dc:creator>
      <dc:date>2015-05-15T09:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70164#M180629</link>
      <description>&lt;P&gt;From what I understand, custom made service files should ideally be placed in "/etc/systemd/system/" and not "/usr/lib/systemd/system/" because the latter should be touched only by package managers. Either place should work just fine in most cases but could cause issues if Splunk later on decides to ship their own service file (as I expect they will). &lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 12:09:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70164#M180629</guid>
      <dc:creator>FloydATC</dc:creator>
      <dc:date>2016-07-20T12:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70165#M180630</link>
      <description>&lt;P&gt;Thank you for the additions.&lt;/P&gt;

&lt;P&gt;I see that RTFM says /etc/systemd/system/ but I suppose much of muchness.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 15:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70165#M180630</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2016-08-11T15:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70166#M180631</link>
      <description>&lt;P&gt;Updated:&lt;/P&gt;

&lt;P&gt;[Unit]&lt;BR /&gt;
Description=Splunk service&lt;BR /&gt;
Documentation=&lt;BR /&gt;
After=network.target&lt;BR /&gt;
Wants=network.target&lt;/P&gt;

&lt;P&gt;[Service]&lt;BR /&gt;
Type=forking&lt;BR /&gt;
RemainAfterExit=yes&lt;BR /&gt;
Restart=on-failure&lt;BR /&gt;
RestartSec=30s&lt;BR /&gt;
User=splunk&lt;BR /&gt;
Group=splunk&lt;BR /&gt;
LimitNOFILE=64000&lt;BR /&gt;
ExecStart=/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt&lt;BR /&gt;
ExecStop=/opt/splunk/bin/splunk stop&lt;BR /&gt;
ExecReload=/opt/splunk/bin/splunk restart&lt;/P&gt;

&lt;P&gt;[Install]&lt;BR /&gt;
WantedBy=multi-user.target&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 16:20:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70166#M180631</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2016-08-11T16:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70167#M180632</link>
      <description>&lt;P&gt;However the above does not restart if you kill a process.&lt;/P&gt;

&lt;P&gt;Any ideas, anyone?&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;

&lt;P&gt;PS Why does Splunk STILL not ship with a service unit file?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 16:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70167#M180632</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2016-08-11T16:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70168#M180633</link>
      <description>&lt;P&gt;Here is what I have configured that addresses restarting the process if the process is killed by anything except "systemctl stop splunk.service", this includes ./splunk stop. If you want to stop the splunk services and keep them from starting back up in 30s, you must issue this command: systemctl stop splunk.service&lt;/P&gt;

&lt;P&gt;[Unit]&lt;BR /&gt;
Description=Splunkd service&lt;BR /&gt;
After=network.target&lt;BR /&gt;
Wants=network.target&lt;/P&gt;

&lt;P&gt;[Service]&lt;BR /&gt;
Type=forking&lt;BR /&gt;
RemainAfterExit=False&lt;BR /&gt;
Restart=always&lt;BR /&gt;
Restart=30s&lt;BR /&gt;
User=splunk&lt;BR /&gt;
Group=splunk&lt;BR /&gt;
ExecStart=/opt/splunk/bin/splunk start&lt;BR /&gt;
ExecStop=/opt/splunk/bin/splunk stop&lt;BR /&gt;
Restart=/opt/splunk/bin/splunk restart&lt;/P&gt;

&lt;P&gt;[Install]&lt;BR /&gt;
WantedBy=multi-user.target&lt;/P&gt;

&lt;P&gt;This is saved as /etc/systemd/system/splunk.service. &lt;BR /&gt;
This was tested on CentOS 7&lt;BR /&gt;
Hope this helps someone....&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 20:09:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70168#M180633</guid>
      <dc:creator>joebisesi</dc:creator>
      <dc:date>2016-10-11T20:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70169#M180634</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Latest one I'm using, no need for RemainAfterexit:&lt;/P&gt;

&lt;P&gt;"RemainAfterExit=&lt;BR /&gt;
Takes a boolean value that specifies whether the service shall be considered active even when all its processes exited. Defaults to no."&lt;/P&gt;

&lt;P&gt;[Unit]&lt;BR /&gt;
Description=Splunk server service&lt;BR /&gt;
Documentation=&lt;BR /&gt;
After=network.target&lt;BR /&gt;
Wants=network.target&lt;BR /&gt;
[Service]&lt;BR /&gt;
Type=forking&lt;BR /&gt;
Restart=always&lt;BR /&gt;
RestartSec=30s&lt;BR /&gt;
User=splunk&lt;BR /&gt;
Group=splunk&lt;BR /&gt;
LimitNOFILE=64000&lt;BR /&gt;
ExecStart=/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt&lt;BR /&gt;
ExecStop=/opt/splunk/bin/splunk stop&lt;BR /&gt;
ExecReload=/opt/splunk/bin/splunk restart&lt;BR /&gt;
[Install]&lt;BR /&gt;
WantedBy=multi-user.target&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 07:50:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70169#M180634</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2016-10-12T07:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70170#M180635</link>
      <description>&lt;P&gt;Agreed on the "RemainAfterExit" defaulting to false, so there is not a need for it.&lt;BR /&gt;
A couple of questions for you:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;What is the "LimitNOFILE=64000" doing?&lt;/LI&gt;
&lt;LI&gt;Is the Splunk server service restarting for you with the "ExecReload=/opt/../splunk restart"?&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 12 Oct 2016 10:54:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70170#M180635</guid>
      <dc:creator>joebisesi</dc:creator>
      <dc:date>2016-10-12T10:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70171#M180636</link>
      <description>&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.0/Troubleshooting/ulimitErrors"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.0/Troubleshooting/ulimitErrors&lt;/A&gt; (Google "linux max file descriptors").&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Yes, it does restart, you could also change to "ExecReload=/opt/splunk/bin/splunk reload [object]". Maybe somebody knows how to reload everything?&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;[root@template ~]# cat /etc/systemd/system/splunk.service &lt;BR /&gt;
[Unit]&lt;BR /&gt;
Description=Splunk service&lt;BR /&gt;
Documentation=&lt;BR /&gt;
After=network.target&lt;BR /&gt;
Wants=network.target&lt;/P&gt;

&lt;P&gt;[Service]&lt;BR /&gt;
Type=forking&lt;BR /&gt;
Restart=always&lt;BR /&gt;
RestartSec=10s&lt;BR /&gt;
User=splunk&lt;BR /&gt;
Group=splunk&lt;BR /&gt;
LimitNOFILE=64000&lt;BR /&gt;
ExecStart=/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt&lt;BR /&gt;
ExecStop=/opt/splunk/bin/splunk stop&lt;BR /&gt;
ExecReload=/opt/splunk/bin/splunk restart&lt;/P&gt;

&lt;P&gt;[Install]&lt;BR /&gt;
WantedBy=multi-user.target&lt;/P&gt;

&lt;P&gt;[root@template ~]# systemctl status splunk.service&lt;BR /&gt;
● splunk.service - Splunk service&lt;BR /&gt;
   Loaded: loaded (/etc/systemd/system/splunk.service; enabled; vendor preset: disabled)&lt;BR /&gt;
   Active: active (running) since Wed 2016-10-12 15:28:23 SAST; 8min ago&lt;BR /&gt;
  Process: 25379 ExecStop=/opt/splunk/bin/splunk stop (code=exited, status=0/SUCCESS)&lt;BR /&gt;
  Process: 25181 ExecReload=/opt/splunk/bin/splunk restart (code=exited, status=0/SUCCESS)&lt;BR /&gt;
  Process: 25404 ExecStart=/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt (code=exited, status=0/SUCCESS)&lt;BR /&gt;
 Main PID: 25450 (splunkd)&lt;BR /&gt;
   CGroup: /system.slice/splunk.service&lt;BR /&gt;
           ├─25450 splunkd -h 0.0.0.0 -p 8089 start&lt;BR /&gt;
           ├─25455 [splunkd pid=25450] splunkd -h 0.0.0.0 -p 8089 start [process-runner]&lt;BR /&gt;
           ├─25472 mongod --dbpath=/opt/splunk/var/lib/splunk/kvstore/mongo --port=8191 --timeStampFormat=iso8601-utc --smallfiles --oplogSize=200 --keyFile=/opt/splunk/var/lib/splunk/kvstore/mongo/splunk.key --setParameter=enableLocalh...&lt;BR /&gt;
           ├─25533 /opt/splunk/bin/python -O /opt/splunk/lib/python2.7/site-packages/splunk/appserver/mrsparkle/root.py --proxied=127.0.0.1,8065,8000&lt;BR /&gt;
           └─25574 /opt/splunk/bin/splunkd instrument-resource-usage -p 8089 --with-kvstore&lt;/P&gt;

&lt;P&gt;Oct 12 15:28:21 template.ephemeric.local splunk[25404]: Done&lt;BR /&gt;
Oct 12 15:28:21 template.ephemeric.local splunk[25404]: Checking default conf files for edits...&lt;BR /&gt;
Oct 12 15:28:21 template.ephemeric.local splunk[25404]: Validating installed files against hashes from '/opt/splunk/splunk-6.5.0-59c8927def0f-linux-2.6-x86_64-manifest'&lt;BR /&gt;
Oct 12 15:28:21 template.ephemeric.local splunk[25404]: [  OK  ]&lt;BR /&gt;
Oct 12 15:28:22 template.ephemeric.local splunk[25404]: All installed files intact.&lt;BR /&gt;
Oct 12 15:28:22 template.ephemeric.local splunk[25404]: Done&lt;BR /&gt;
Oct 12 15:28:22 template.ephemeric.local splunk[25404]: All preliminary checks passed.&lt;BR /&gt;
Oct 12 15:28:22 template.ephemeric.local splunk[25404]: Starting splunk server daemon (splunkd)...&lt;BR /&gt;
Oct 12 15:28:22 template.ephemeric.local splunk[25404]: Done&lt;BR /&gt;
Oct 12 15:28:23 template.ephemeric.local systemd[1]: Started Splunk service.&lt;/P&gt;

&lt;P&gt;[root@template ~]# systemctl reload splunk.service&lt;/P&gt;

&lt;P&gt;[root@template ~]# systemctl status splunk.service&lt;BR /&gt;
● splunk.service - Splunk service&lt;BR /&gt;
   Loaded: loaded (/etc/systemd/system/splunk.service; enabled; vendor preset: disabled)&lt;BR /&gt;
   Active: activating (auto-restart) since Wed 2016-10-12 15:37:02 SAST; 1s ago&lt;BR /&gt;
  Process: 25855 ExecStop=/opt/splunk/bin/splunk stop (code=exited, status=0/SUCCESS)&lt;BR /&gt;
  Process: 25611 ExecReload=/opt/splunk/bin/splunk restart (code=exited, status=0/SUCCESS)&lt;BR /&gt;
  Process: 25404 ExecStart=/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt (code=exited, status=0/SUCCESS)&lt;BR /&gt;
 Main PID: 25450 (code=exited, status=0/SUCCESS)&lt;/P&gt;

&lt;P&gt;Oct 12 15:37:02 template.ephemeric.local systemd[1]: Reloaded Splunk service.&lt;BR /&gt;
[root@template ~]# systemctl status splunk.service&lt;BR /&gt;
● splunk.service - Splunk service&lt;BR /&gt;
   Loaded: loaded (/etc/systemd/system/splunk.service; enabled; vendor preset: disabled)&lt;BR /&gt;
   Active: active (running) since Wed 2016-10-12 15:37:15 SAST; 14s ago&lt;BR /&gt;
  Process: 25855 ExecStop=/opt/splunk/bin/splunk stop (code=exited, status=0/SUCCESS)&lt;BR /&gt;
  Process: 25611 ExecReload=/opt/splunk/bin/splunk restart (code=exited, status=0/SUCCESS)&lt;BR /&gt;
  Process: 25881 ExecStart=/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt (code=exited, status=0/SUCCESS)&lt;BR /&gt;
 Main PID: 25928 (splunkd)&lt;BR /&gt;
   CGroup: /system.slice/splunk.service&lt;BR /&gt;
           ├─25928 splunkd -h 0.0.0.0 -p 8089 start&lt;BR /&gt;
           ├─25932 [splunkd pid=25928] splunkd -h 0.0.0.0 -p 8089 start [process-runner]&lt;BR /&gt;
           ├─25949 mongod --dbpath=/opt/splunk/var/lib/splunk/kvstore/mongo --port=8191 --timeStampFormat=iso8601-utc --smallfiles --oplogSize=200 --keyFile=/opt/splunk/var/lib/splunk/kvstore/mongo/splunk.key --setParameter=enableLocalh...&lt;BR /&gt;
           ├─25999 /opt/splunk/bin/python -O /opt/splunk/lib/python2.7/site-packages/splunk/appserver/mrsparkle/root.py --proxied=127.0.0.1,8065,8000&lt;BR /&gt;
           └─26049 /opt/splunk/bin/splunkd instrument-resource-usage -p 8089 --with-kvstore&lt;/P&gt;

&lt;P&gt;Oct 12 15:37:14 template.ephemeric.local splunk[25881]: Done&lt;BR /&gt;
Oct 12 15:37:14 template.ephemeric.local splunk[25881]: Checking default conf files for edits...&lt;BR /&gt;
Oct 12 15:37:14 template.ephemeric.local splunk[25881]: Validating installed files against hashes from '/opt/splunk/splunk-6.5.0-59c8927def0f-linux-2.6-x86_64-manifest'&lt;BR /&gt;
Oct 12 15:37:14 template.ephemeric.local splunk[25881]: [  OK  ]&lt;BR /&gt;
Oct 12 15:37:14 template.ephemeric.local splunk[25881]: All installed files intact.&lt;BR /&gt;
Oct 12 15:37:14 template.ephemeric.local splunk[25881]: Done&lt;BR /&gt;
Oct 12 15:37:14 template.ephemeric.local splunk[25881]: All preliminary checks passed.&lt;BR /&gt;
Oct 12 15:37:14 template.ephemeric.local splunk[25881]: Starting splunk server daemon (splunkd)...&lt;BR /&gt;
Oct 12 15:37:14 template.ephemeric.local splunk[25881]: Done&lt;BR /&gt;
Oct 12 15:37:15 template.ephemeric.local systemd[1]: Started Splunk service.&lt;/P&gt;

&lt;P&gt;[root@template ~]# ss -tnl&lt;BR /&gt;
State       Recv-Q Send-Q                                                                          Local Address:Port                                                                                         Peer Address:Port&lt;BR /&gt;&lt;BR /&gt;
LISTEN      0      128                                                                                         &lt;EM&gt;:22                                                                                                      *:&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;
LISTEN      0      128                                                                                         &lt;EM&gt;:8089                                                                                                    *:&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;
LISTEN      0      100                                                                                 127.0.0.1:25                                                                                                      &lt;EM&gt;:&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;
LISTEN      0      128                                                                                         &lt;EM&gt;:8191                                                                                                    *:&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;
LISTEN      0      128                                                                                         &lt;EM&gt;:8000                                                                                                    *:&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;
LISTEN      0      100                                                                                 127.0.0.1:8065                                                                                                    &lt;EM&gt;:&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;
LISTEN      0      100                                                                                       ::1:25                                                                                                     :::*&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2016 13:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70171#M180636</guid>
      <dc:creator>ephemeric</dc:creator>
      <dc:date>2016-10-12T13:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70172#M180637</link>
      <description>&lt;P&gt;You're follow up answers regarding the "Restart" and "RestartSec" options worked for me.  Key point from my testing running CentOS7 and Splunk 6.5.2, DO NOT USE “RemainAfterExit=yes”.  Your Main PID will remain the PID of your initial process start.  When a Deployment Server, Cluster Master, or local user restarts Splunk, systemd will not track the new PID as the main one.  Also, if Splunk crashes or is stopped by the user, systemd will still report “active” because it’s holding on to the successful start of that initial PID.  &lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 18:24:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70172#M180637</guid>
      <dc:creator>andrewfoglesong</dc:creator>
      <dc:date>2017-04-12T18:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70173#M180638</link>
      <description>&lt;P&gt;FloydATC is correct. Below is the from "man systemd.unit"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Table 1.  Load path when running in system mode (--system).
       ┌────────────────────────┬─────────────────────────────┐
       │Path                    │ Description                 │
       ├────────────────────────┼─────────────────────────────┤
       │/etc/systemd/system     │ Local configuration         │
       ├────────────────────────┼─────────────────────────────┤
       │/run/systemd/system     │ Runtime units               │
       ├────────────────────────┼─────────────────────────────┤
       │/usr/lib/systemd/system │ Units of installed packages │
       └────────────────────────┴─────────────────────────────┘
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Jun 2017 15:53:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70173#M180638</guid>
      <dc:creator>fenrisdacat</dc:creator>
      <dc:date>2017-06-15T15:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70174#M180639</link>
      <description>&lt;P&gt;how come the "splunk enable boot-start" has not been updated yet?&lt;BR /&gt;
like it or not, systemd has been standard in most distros for months now.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 10:08:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70174#M180639</guid>
      <dc:creator>andreworg</dc:creator>
      <dc:date>2017-08-01T10:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a systemd unit file for Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70175#M180640</link>
      <description>&lt;P&gt;+1, working nicely in my lab &lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 04:15:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-systemd-unit-file-for-Splunk/m-p/70175#M180640</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2017-08-23T04:15:39Z</dc:date>
    </item>
  </channel>
</rss>

