<?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: How to add Delay during Rolling Restart Until Custom Service Fully Starts? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-add-Delay-during-Rolling-Restart-Until-Custom-Service/m-p/411258#M253015</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22036"&gt;@vineetchaure&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the Cloudera Manager itself manages the service startup scripts.&lt;/P&gt;&lt;P&gt;we do not recommend modifying the Cloudera service startup scripts, as this will harm and interfere with correct startup and consequently generate unwanted problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jul 2025 13:35:53 GMT</pubDate>
    <dc:creator>yagoaparecidoti</dc:creator>
    <dc:date>2025-07-07T13:35:53Z</dc:date>
    <item>
      <title>How to add Delay during Rolling Restart Until Custom Service Fully Starts?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-add-Delay-during-Rolling-Restart-Until-Custom-Service/m-p/408472#M252721</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I've created a custom service in Cloudera Manager (ABC_ROLE) and defined a startRunner that calls a control.sh script. This script eventually runs a start_and_monitor function that starts two internal services and enters a monitoring loop.&lt;/P&gt;&lt;P&gt;service.sdl Snippet:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"roles": [
  {
    "name": "ABC_ROLE",
    "startRunner": {
      "program": "scripts/control.sh",
      "args": ["start"],
      "environmentVariables": {
        "LOG_LEVEL": "${log_level}"
      }
    },
    "stopRunner": {
      "relevantRoleTypes": ["ABC_ROLE"],
      "runner": {
        "program": "scripts/control.sh",
        "args": ["stop"]
      }
    }
  }
],
"rollingRestart": {
  "workerSteps": {
    "roleName": "ABC_ROLE",
    "bringDownCommands": ["Stop"],
    "bringUpCommands": ["Start"]
  }
}&lt;/LI-CODE&gt;&lt;P&gt;control.sh&amp;nbsp;Snippet:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;control.sh

start_service() {
    echo "start_service() called"
    sleep 60 #Adding sleep to test
    exec ${SERVICE_PARCEL_HOME}/service/scripts/service_daemon.sh start_and_monitor
}

if [ "$CMD" == "start" ]; then
    start_service
elif [ "$CMD" == "stop" ]; then
    stop_service
elif [ "$CMD" == "status" ]; then
    status_service_and_uptime
fi&lt;/LI-CODE&gt;&lt;P&gt;service_daemon.sh Snippet:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt; start_service_daemons() {
	
    echo "Starting first service..."
    ${SERVICE_PARCEL_HOME}/service1/bin/service1ctrl start

    echo "Starting seconds service..."
    ${SERVICE_PARCEL_HOME}/service2/bin/service2ctrl start

}

 start_and_monitor() {
    trap stop_service_daemons SIGTERM
    umask 0027

    start_service_daemons

    sleep 5

    while true; do
        ${SERVICE_PARCEL_HOME}/service1/bin/service1ctrl status
        service1_status=$?

        ${SERVICE_PARCEL_HOME}/service2/bin/service2ctrl status
        service2_status=$?

        if [ $service1_status -ne 0 ] || [ $service2_status -ne 0 ]; then
            echo "One or more services are not running. Exiting..."
            exit 1
        else
            echo "Services are running. Sleeping..."
            sleep 60
        fi
    done
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;:&lt;BR /&gt;During a rolling restart, Cloudera Manager immediately proceeds to start the next service (e.g., HDFS) right after my custom service's startRunner is invoked — even though the internal services are still starting up.&lt;/P&gt;&lt;P&gt;I tried adding sleep and health checks in start_and_monitor, but Cloudera Manager does not even wait for the 60-second sleep in the loop. It seems to treat the service as "started" as soon as the startRunner is launched, not when the service is actually ready.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My service also needs to&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;connect to a server to download required files&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;during startup. This process must complete successfully before the service is considered ready.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question&lt;/STRONG&gt;:&lt;BR /&gt;Is there a way to make Cloudera Manager wait until a script returns success (exit code 0) before considering the service as started during a rolling restart?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2026 06:19:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-add-Delay-during-Rolling-Restart-Until-Custom-Service/m-p/408472#M252721</guid>
      <dc:creator>vineetchaure</dc:creator>
      <dc:date>2026-04-21T06:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to add Delay during Rolling Restart Until Custom Service Fully Starts?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-add-Delay-during-Rolling-Restart-Until-Custom-Service/m-p/411204#M253007</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22036"&gt;@vineetchaure&lt;/a&gt;&amp;nbsp;&amp;nbsp;Modifying the CDP/Cloudera Manager installation script is not recommended, as it may lead to unintended issues&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jul 2025 12:24:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-add-Delay-during-Rolling-Restart-Until-Custom-Service/m-p/411204#M253007</guid>
      <dc:creator>Scharan</dc:creator>
      <dc:date>2025-07-06T12:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to add Delay during Rolling Restart Until Custom Service Fully Starts?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-add-Delay-during-Rolling-Restart-Until-Custom-Service/m-p/411258#M253015</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22036"&gt;@vineetchaure&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the Cloudera Manager itself manages the service startup scripts.&lt;/P&gt;&lt;P&gt;we do not recommend modifying the Cloudera service startup scripts, as this will harm and interfere with correct startup and consequently generate unwanted problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2025 13:35:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-add-Delay-during-Rolling-Restart-Until-Custom-Service/m-p/411258#M253015</guid>
      <dc:creator>yagoaparecidoti</dc:creator>
      <dc:date>2025-07-07T13:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to add Delay during Rolling Restart Until Custom Service Fully Starts?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-add-Delay-during-Rolling-Restart-Until-Custom-Service/m-p/411503#M253065</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/22036"&gt;@vineetchaure&lt;/a&gt;,&amp;nbsp;Did the response assist in resolving your query? If it did, kindly mark the relevant reply as the solution, as it will aid others in locating the answer more easily in the future.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2025 04:44:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-add-Delay-during-Rolling-Restart-Until-Custom-Service/m-p/411503#M253065</guid>
      <dc:creator>VidyaSargur</dc:creator>
      <dc:date>2025-07-15T04:44:59Z</dc:date>
    </item>
  </channel>
</rss>

