<?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 7.0 ~ boot-start not working as non-root user in Installation</title>
    <link>https://community.splunk.com/t5/Installation/Splunk-7-0-boot-start-not-working-as-non-root-user/m-p/352695#M8058</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have Splunk 7.0 installed on a 64-bit Linux host. I followed the instructions for enabling boot-start as a non-root user, but I am not able to figure out why it's still not working as expected. Here is what I have in my &lt;EM&gt;/etc/init.d/splunk&lt;/EM&gt; file after the necessary &lt;EM&gt;su&lt;/EM&gt; changes -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/bin/sh
#
# /etc/init.d/splunk
# init script for Splunk.
# generated by 'splunk enable boot-start'.
#
# chkconfig: 2345 90 60
# description: Splunk indexer service
#
RETVAL=0

. /etc/init.d/functions

splunk_start() {
  echo Starting Splunk...
  su - ${USER} -c '"/opt/splunk/bin/splunk start"' --no-prompt --answer-yes
  RETVAL=$?
  [ $RETVAL -eq 0 ] &amp;amp;&amp;amp; touch /var/lock/subsys/splunk
}
splunk_stop() {
  echo Stopping Splunk...
  su - ${USER} -c '"/opt/splunk/bin/splunk stop"' 
  RETVAL=$?
  [ $RETVAL -eq 0 ] &amp;amp;&amp;amp; rm -f /var/lock/subsys/splunk
}
splunk_restart() {
  echo Restarting Splunk...
  su - ${USER} -c '"/opt/splunk/bin/splunk restart"' 
  RETVAL=$?
  [ $RETVAL -eq 0 ] &amp;amp;&amp;amp; touch /var/lock/subsys/splunk
}
splunk_status() {
  echo Splunk status:
  su - ${USER} -c '"/opt/splunk/bin/splunk status"' 
  RETVAL=$?
}
case "$1" in
  start)
    splunk_start
    ;;
  stop)
    splunk_stop
    ;;
  restart)
    splunk_restart
    ;;
  status)
    splunk_status
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
    ;;
esac

exit $RETVAL
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any thoughts how I can fix this?&lt;/P&gt;

&lt;P&gt;Thank you&lt;BR /&gt;
MT&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2017 16:06:58 GMT</pubDate>
    <dc:creator>mrigs</dc:creator>
    <dc:date>2017-11-06T16:06:58Z</dc:date>
    <item>
      <title>Splunk 7.0 ~ boot-start not working as non-root user</title>
      <link>https://community.splunk.com/t5/Installation/Splunk-7-0-boot-start-not-working-as-non-root-user/m-p/352695#M8058</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have Splunk 7.0 installed on a 64-bit Linux host. I followed the instructions for enabling boot-start as a non-root user, but I am not able to figure out why it's still not working as expected. Here is what I have in my &lt;EM&gt;/etc/init.d/splunk&lt;/EM&gt; file after the necessary &lt;EM&gt;su&lt;/EM&gt; changes -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/bin/sh
#
# /etc/init.d/splunk
# init script for Splunk.
# generated by 'splunk enable boot-start'.
#
# chkconfig: 2345 90 60
# description: Splunk indexer service
#
RETVAL=0

. /etc/init.d/functions

splunk_start() {
  echo Starting Splunk...
  su - ${USER} -c '"/opt/splunk/bin/splunk start"' --no-prompt --answer-yes
  RETVAL=$?
  [ $RETVAL -eq 0 ] &amp;amp;&amp;amp; touch /var/lock/subsys/splunk
}
splunk_stop() {
  echo Stopping Splunk...
  su - ${USER} -c '"/opt/splunk/bin/splunk stop"' 
  RETVAL=$?
  [ $RETVAL -eq 0 ] &amp;amp;&amp;amp; rm -f /var/lock/subsys/splunk
}
splunk_restart() {
  echo Restarting Splunk...
  su - ${USER} -c '"/opt/splunk/bin/splunk restart"' 
  RETVAL=$?
  [ $RETVAL -eq 0 ] &amp;amp;&amp;amp; touch /var/lock/subsys/splunk
}
splunk_status() {
  echo Splunk status:
  su - ${USER} -c '"/opt/splunk/bin/splunk status"' 
  RETVAL=$?
}
case "$1" in
  start)
    splunk_start
    ;;
  stop)
    splunk_stop
    ;;
  restart)
    splunk_restart
    ;;
  status)
    splunk_status
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
    ;;
esac

exit $RETVAL
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any thoughts how I can fix this?&lt;/P&gt;

&lt;P&gt;Thank you&lt;BR /&gt;
MT&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 16:06:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Splunk-7-0-boot-start-not-working-as-non-root-user/m-p/352695#M8058</guid>
      <dc:creator>mrigs</dc:creator>
      <dc:date>2017-11-06T16:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.0 ~ boot-start not working as non-root user</title>
      <link>https://community.splunk.com/t5/Installation/Splunk-7-0-boot-start-not-working-as-non-root-user/m-p/352696#M8059</link>
      <description>&lt;P&gt;&lt;CODE&gt;USER&lt;/CODE&gt; isn't defined in your script, so there's no value to replace for &lt;CODE&gt;${USER}&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Did you attempt to use &lt;CODE&gt;splunk enable boot-start -user &amp;lt;splunk user&amp;gt;&lt;/CODE&gt; to accomplish this, or some other means?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 21:22:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Splunk-7-0-boot-start-not-working-as-non-root-user/m-p/352696#M8059</guid>
      <dc:creator>micahkemp</dc:creator>
      <dc:date>2017-11-13T21:22:34Z</dc:date>
    </item>
  </channel>
</rss>

