<?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: Separating a scripted BASH input from the parent (Splunk) process in order to perform restart on Linux (Ubuntu) in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/Separating-a-scripted-BASH-input-from-the-parent-Splunk-process/m-p/487692#M16911</link>
    <description>&lt;P&gt;Thank for the quick response. Unfortunately &lt;CODE&gt;setsid&lt;/CODE&gt; didn't work either. &lt;/P&gt;

&lt;P&gt;They all seem to be doing the right thing &lt;STRONG&gt;IF&lt;/STRONG&gt; I am trying to detach from the TTY session that I am using. However, I want to detach the bash script from the &lt;CODE&gt;splunkd&lt;/CODE&gt; process, and I can't seem to figure out how to do that.&lt;/P&gt;

&lt;P&gt;I know this is not directly related to Splunk, but I have searched the Linux forums as well, and cannot find specifics on how to do it. I may just not know how to ask the question properly there. I had hoped that since I was trying to do it under Splunk scripted inputs, someone here may have run into it before.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jan 2020 20:46:00 GMT</pubDate>
    <dc:creator>bkcarter</dc:creator>
    <dc:date>2020-01-15T20:46:00Z</dc:date>
    <item>
      <title>Separating a scripted BASH input from the parent (Splunk) process in order to perform restart on Linux (Ubuntu)</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Separating-a-scripted-BASH-input-from-the-parent-Splunk-process/m-p/487690#M16909</link>
      <description>&lt;P&gt;I am attempting to run a scheduled BASH scripted input on UF 7.2.x on Ubuntu 16 or later.&lt;/P&gt;

&lt;P&gt;The script does some preparatory work and then STOPS the UF.&lt;BR /&gt;
It then needs to change some things in the UF environment, and then restart the UF.&lt;/P&gt;

&lt;P&gt;Testing it from the CLI shows that the script works according to plan, HOWEVER,&lt;BR /&gt;
when running it as a scripted input, the last line that gets executed is the SPLUNK STOP command.&lt;/P&gt;

&lt;P&gt;I know the reason is that when the UF stops, it destroys the process tree that is running the script.&lt;BR /&gt;
From reading older threads on similar issues, I find that this behavior used to not be the default. People were complaining that things were continuing to run, and chewing up resources even though the UF had been stopped. I understand that concern, however in this case, I really need it to keep running, even though that no longer appears to be the default behavior.&lt;/P&gt;

&lt;P&gt;I have attempted using a wrapper script using the bash and &amp;amp; parameters, as well as NOHUP and SCREEN. All to no avail. They all get killed when the UF stops. I have attempted using a .path file to call the script. Same result.&lt;/P&gt;

&lt;P&gt;How can a fork something that is no longer dependent on the UF process for this one script?&lt;/P&gt;

&lt;P&gt;Any help is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 17:58:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Separating-a-scripted-BASH-input-from-the-parent-Splunk-process/m-p/487690#M16909</guid>
      <dc:creator>bkcarter</dc:creator>
      <dc:date>2020-01-15T17:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Separating a scripted BASH input from the parent (Splunk) process in order to perform restart on Linux (Ubuntu)</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Separating-a-scripted-BASH-input-from-the-parent-Splunk-process/m-p/487691#M16910</link>
      <description>&lt;P&gt;Hi bkcarter,&lt;/P&gt;

&lt;P&gt;Not really a Splunk issue as you probably know &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; But here to help anyway &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Since you tried &lt;CODE&gt;NOHUP&lt;/CODE&gt; and &lt;CODE&gt;screen&lt;/CODE&gt; already without success have you considered using &lt;CODE&gt;setsid&lt;/CODE&gt; ? &lt;BR /&gt;
You can find a good example here &lt;A href="https://superuser.com/a/172476"&gt;https://superuser.com/a/172476&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;Hope that helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 19:00:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Separating-a-scripted-BASH-input-from-the-parent-Splunk-process/m-p/487691#M16910</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2020-01-15T19:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Separating a scripted BASH input from the parent (Splunk) process in order to perform restart on Linux (Ubuntu)</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Separating-a-scripted-BASH-input-from-the-parent-Splunk-process/m-p/487692#M16911</link>
      <description>&lt;P&gt;Thank for the quick response. Unfortunately &lt;CODE&gt;setsid&lt;/CODE&gt; didn't work either. &lt;/P&gt;

&lt;P&gt;They all seem to be doing the right thing &lt;STRONG&gt;IF&lt;/STRONG&gt; I am trying to detach from the TTY session that I am using. However, I want to detach the bash script from the &lt;CODE&gt;splunkd&lt;/CODE&gt; process, and I can't seem to figure out how to do that.&lt;/P&gt;

&lt;P&gt;I know this is not directly related to Splunk, but I have searched the Linux forums as well, and cannot find specifics on how to do it. I may just not know how to ask the question properly there. I had hoped that since I was trying to do it under Splunk scripted inputs, someone here may have run into it before.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 20:46:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Separating-a-scripted-BASH-input-from-the-parent-Splunk-process/m-p/487692#M16911</guid>
      <dc:creator>bkcarter</dc:creator>
      <dc:date>2020-01-15T20:46:00Z</dc:date>
    </item>
  </channel>
</rss>

