From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18389 invoked from network); 21 Oct 2020 13:26:26 -0000 Received: from alyss.skarnet.org (95.142.172.232) by inbox.vuxu.org with ESMTPUTF8; 21 Oct 2020 13:26:26 -0000 Received: (qmail 29720 invoked by uid 89); 21 Oct 2020 13:26:52 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 29713 invoked from network); 21 Oct 2020 13:26:52 -0000 From: "Laurent Bercot" To: "Amaresh Kotekal" , "supervision@list.skarnet.org" Subject: Re: Dependencies in S6 Date: Wed, 21 Oct 2020 13:26:25 +0000 Message-Id: In-Reply-To: References: Reply-To: "Laurent Bercot" User-Agent: eM_Client/8.0.3385.0 Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedujedrjeehgdeihecutefuodetggdotffvucfrrhhofhhilhgvmecupfgfoffgtffkveetuefngfdpqfgfvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkfgjfhhrfgggtgfgsehtqhertddtreejnecuhfhrohhmpedfnfgruhhrvghnthcuuegvrhgtohhtfdcuoehskhgrqdhsuhhpvghrvhhishhiohhnsehskhgrrhhnvghtrdhorhhgqeenucggtffrrghtthgvrhhnpedvgfevffeuleegvdektdffteegvdeiieefkeetgfeuheffheelheejhfevueeijeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht Hi Amaresh, As long as service B depends on service A, A and B will never start in parallel; B will always start when A is ready. "A is ready" means: - if A is a oneshot: when the script has completed - if A is a longrun: * if there is a notification-fd file in the service definition directory: when the daemon has notified readiness * if there is no such file: as soon as the run script has started (which is not a good readiness indicator; it is akin to starting B _right after A_, essentially in parallel, so you may have race conditions here - which is why you should always use readiness notifications.) >Secnario 1: >1. A & B are one shot services in a s6-rc bundle. Service B is dependent o= n >A. ( added in dependency file). >2. I think Service B will start after the completion of service A ( A then >B, in serial manner ) is it correct ? or >3. Service B will start immediately after the service A as started (in a >parallel manner) ? Serial manner, A then B. >Secnario 2: >1. A is one shot service and B is a long run service. Service B is >dependent on Service A. >2. Service B will start, once th service A as completed (in serial manner) >? or >3. Service B will start immediately after the service A as started (in a >parallel manner) ? Serial manner, A then B. >Secnario 3: >1. A is a long run service and B is a one shot service. Service B is >dependent on Service A. >2. Service B will start immediately after the service A as started (in a >parallel manner) ? >3. Do I need to use notification mechanism if I want to start service B >after A service as reached particular point in execution Yes, you need notification; if you don't, then B will start immediately after A. >Secnario 4: >1. A & B both are long run services. Service B is dependent on Service A. >2. Service B will start immediately after the service A as started (in a >parallel manner) ? Same as above: almost-parallel manner if A does not use notification, serial manner if it does. > If one shot service are dependent on other one shot services. They will= be >started in serial manner one after the other ? That is your Scenario 1 above. If the case is: "C depends on A and B, but A and B are independent", then: * A and B are started in parallel * when both A and B are ready, then C is started. Hope this helps, -- Laurent