<?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>question Re: Unable to Stop Custom Service through Cloudera Manager in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27206#M5800</link>
    <description>This is also documented here:&lt;BR /&gt;&lt;A target="_blank" href="https://github.com/cloudera/cm_ext/wiki/Control-Scripts"&gt;https://github.com/cloudera/cm_ext/wiki/Control-Scripts&lt;/A&gt;</description>
    <pubDate>Fri, 08 May 2015 18:30:12 GMT</pubDate>
    <dc:creator>Darren</dc:creator>
    <dc:date>2015-05-08T18:30:12Z</dc:date>
    <item>
      <title>Unable to Stop Custom Service through Cloudera Manager</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27099#M5796</link>
      <description>&lt;P&gt;Hello All, I have build a custom service. I am doing some pre task (installation of drivers, start database &amp;nbsp;and other daemon services etc) before calling exec.&lt;SPAN&gt;This service started succefully. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Duing stop from Cloudera Manager , along with the service started with exec I wanto stop the services started in pre task also.for that .I have written a script to stop all the daemon services&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I found that the only the &amp;nbsp;service which is started with exec &amp;nbsp;stops not in the pre-task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please Guide me , how to solve the isuue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My service.sdl is as foolows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
  "name" : "MYAPP",
  "label" : "Myapp",
  "description" : "My App Custom CSD",
  "version" : "2.1",
 "runAs" : {
    "user" : "root",
    "group" : "root"
   },
 "maxInstances" : 1,
 "icon" : "images/myapp.png",

  "parcel" : {
        "repoUrl" : "http://xx.xx.xx.xx:xxxx/latest/",
        "requiredTags" : [ "myapp" ]
 },
   "roles" : [
    {
       "name" : "MY_WEBSERVER",
       "label" : "My Web Server",
       "pluralLabel" : "My Web Server",
       "startRunner" :
        {
         "program" : "scripts/control.sh",
         "args" : [ "start" ]
        },
      "stopRunner" :
        {
                "relevantRoleTypes" : ["MY_WEBSERVER"],
                "runner" :
                {
                "program" : "scripts/control.sh",
                "args" : ["stop"]
                },
                "timeout" : 180000,
                "masterRole" : "MY_WEBSERVER"
        },

        "topology" :
        {
                "minInstances" : "1",
                "maxInstances" : "1"
        },
        "logging" :
        {
                "dir" : "/var/log/myapp-2.1/",
                "filename" : "myapp.log"
        }
    }
  ]
}&lt;/PRE&gt;&lt;P&gt;and my control.sh is as follows-&lt;/P&gt;&lt;PRE&gt;#!/bin/bash
CMD=$1

case $CMD in
  (start)
    echo "Starting the MyAPP Service"

        cp -r  /opt/cloudera/parcels/myapp-2.1 /opt/
       
        chmod 777 -R /opt/myapp-2.1/
        sh /opt/myapp-2.1/resource/scripts/installer/MainScript
        exec python -m SimpleHTTPServer 8080
    	;;
  (stop)
   	sh /opt/myapp-2.1/resource/scripts/installer/StopAll
   	;;
  (restart)
   	sh /opt/myapp-2.1/resource/scripts/installer/RestartAll
   	;;

  (*)
    	echo "Don't understand [$CMD]"
    	;;
esac&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:28:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27099#M5796</guid>
      <dc:creator>ashutosh_0507</dc:creator>
      <dc:date>2022-09-16T09:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Stop Custom Service through Cloudera Manager</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27145#M5797</link>
      <description>It's best if all roles are associated with a single process. It looks like you're spawning 2 processes for a single role. This messes up things like monitoring and makes it so that stop commands don't work (as you noticed).&lt;BR /&gt;&lt;BR /&gt;It's common to split these two processes into separate roles to solve this problem.</description>
      <pubDate>Fri, 08 May 2015 01:01:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27145#M5797</guid>
      <dc:creator>Darren</dc:creator>
      <dc:date>2015-05-08T01:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Stop Custom Service through Cloudera Manager</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27163#M5798</link>
      <description>&lt;P&gt;Thanks for the reply. I am new to cloudera manager and CSD.&lt;/P&gt;&lt;P&gt;I tried by spliiting the process into roles.&lt;/P&gt;&lt;P&gt;In the role`s startrunner &amp;nbsp;i have written to start one of my linux service, but the the role failed to start as Cloudera Manager attemped multiple times to start the same. First time it succeeded to start the service but then it attemped again multiple times and found the service is already running and thus failed to start. Please Guide me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Following is the stdout&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Fri May  8 01:26:13 EDT 2015
JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
Using /var/run/cloudera-scm-agent/process/887-xx-xx_SERVICE as conf dir
Using scripts/control.sh as process script
Starting the xx service
xx Service StartsStarting xx-service service: xxservice started ...
[  OK  ]

Fri May  8 01:26:16 EDT 2015
JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
Using /var/run/cloudera-scm-agent/process/887-xx-xx_SERVICE as conf dir
Using scripts/control.sh as process script
Starting the xx service
xx Service Starts xx-service already running

Fri May  8 01:26:18 EDT 2015
JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
Using /var/run/cloudera-scm-agent/process/887-xx-xx_SERVICE as conf dir
Using scripts/control.sh as process script
Starting the xx service
xx Service Starts xx-service already running

Fri May  8 01:26:21 EDT 2015
JAVA_HOME=/usr/java/jdk1.7.0_67-cloudera
Using /var/run/cloudera-scm-agent/process/887-xx-xx_SERVICE as conf dir
Using scripts/control.sh as process script
Starting the xx service
xx Service Starts xx-service already running&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2015 03:58:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27163#M5798</guid>
      <dc:creator>ashutosh_0507</dc:creator>
      <dc:date>2015-07-09T03:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Stop Custom Service through Cloudera Manager</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27202#M5799</link>
      <description>It looks like you're starting a process in the background. Cloudera Manager expects that the shell script used to start the role will "exec" the real process. Cloudera manager only tracks the process that it spawns. If you fork a process and then exit your shell script, it will appear as if the process CM just spawned has died unexpectedly, which causes CM to try and start it again.</description>
      <pubDate>Fri, 08 May 2015 18:04:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27202#M5799</guid>
      <dc:creator>Darren</dc:creator>
      <dc:date>2015-05-08T18:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Stop Custom Service through Cloudera Manager</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27206#M5800</link>
      <description>This is also documented here:&lt;BR /&gt;&lt;A target="_blank" href="https://github.com/cloudera/cm_ext/wiki/Control-Scripts"&gt;https://github.com/cloudera/cm_ext/wiki/Control-Scripts&lt;/A&gt;</description>
      <pubDate>Fri, 08 May 2015 18:30:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27206#M5800</guid>
      <dc:creator>Darren</dc:creator>
      <dc:date>2015-05-08T18:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to Stop Custom Service through Cloudera Manager</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27374#M5801</link>
      <description>&lt;P&gt;Thanks dlo,&lt;/P&gt;&lt;P&gt;You were correct, my service were daemons which was&amp;nbsp;causing the issue.&lt;/P&gt;&lt;P&gt;I made them to run in forground and everything just works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 10:56:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Unable-to-Stop-Custom-Service-through-Cloudera-Manager/m-p/27374#M5801</guid>
      <dc:creator>ashutosh_0507</dc:creator>
      <dc:date>2015-05-13T10:56:13Z</dc:date>
    </item>
  </channel>
</rss>

