From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 162FE138334 for ; Thu, 2 Aug 2018 09:32:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3A825E0822; Thu, 2 Aug 2018 09:32:32 +0000 (UTC) Received: from edrik.securmail.fr (edrik.securmail.fr [89.234.186.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9AC1BE07E2 for ; Thu, 2 Aug 2018 09:32:29 +0000 (UTC) Received: by edrik.securmail.fr (Postfix, from userid 58) id 41932B0D49; Thu, 2 Aug 2018 11:32:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=swordarmor.fr; s=swordarmor; t=1533202346; bh=OJBB7CFJ/VXCWPhp0rZxOZjWz7r6xggRKGG9m2DDeww=; h=Date:From:To:Subject; b=y+ehoXUGTIbBN38w3Bpg5BM4lAYt3diNmJYcaHfhwb63kWkwTbNMA1ceeCvJdpICZ 1+UOjsxYLWLG6MSV26E4mmPYRxj5ij52k7PwTfGqvTXKFCn+A5x8MgvR/lUChg/dR2 UGXzIwqHdQjDdFxdxmLCukXBlGlnvCxIK+rcPDhM= X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on edrik.securmail.fr X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU autolearn=ham autolearn_force=no version=3.4.1 Received: from mew.swordarmor.fr (mew.swordarmor.fr [IPv6:2a00:5884:102:1::4]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: alarig@swordarmor.fr) by edrik.securmail.fr (Postfix) with ESMTPSA id B3A4DB0D2D for ; Thu, 2 Aug 2018 11:32:24 +0200 (CEST) Authentication-Results: edrik.securmail.fr/B3A4DB0D2D; dmarc=none (p=none dis=none) header.from=swordarmor.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=swordarmor.fr; s=swordarmor; t=1533202344; bh=OJBB7CFJ/VXCWPhp0rZxOZjWz7r6xggRKGG9m2DDeww=; h=Date:From:To:Subject; b=JPl3zDwYsKskaV9gHfauLm7Fdh8QjBpjH5V9zcxRtfKHJwWOPjc3far0WHxKlSlaj YM/PJYfZEBTHuNwsSlhUxTjY9PN+7+957W66qf4cmYD5HOMJQZ/JOizPcWDiJo7Iz/ 0YxHlBQVTaqPNNl8e0wrrMgUsQuGqmAHGIY6xQAo= Date: Thu, 2 Aug 2018 11:32:23 +0200 From: Alarig Le Lay To: gentoo-user@lists.gentoo.org Subject: [gentoo-user] How does OpenRC know if a service is crashed? Message-ID: <20180802093223.3bjnp57czg7l2tf7@mew.swordarmor.fr> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20180716 X-Archives-Salt: f14a9c5f-156c-41fd-9e7f-b3eb2b2a6e6e X-Archives-Hash: e922af08a0e1e801da74671342978497 Hi, Some times ago, I wrote a basic init script for a service I’m running but that is not in the tree. It’s just a python script behind a reverse-proxy. bulbizarre ~ # cat /etc/init.d/paste-py #!/sbin/openrc-run # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ #depend() { # #} start() { start-stop-daemon --start --user pastepy --exec paste-py.sh --name paste-py eend $? } stop() { kill $(cat /opt/paste-py/paste.pid) } bulbizarre ~ # cat $(which paste-py.sh) #!/bin/sh port="$(grep port /opt/paste-py/paste-py.conf | cut -d '=' -f 2)" addr="$(grep addr /opt/paste-py/paste-py.conf | cut -d '=' -f 2)" cd /opt/paste-py source bin/activate ./daemonize.py --port=${port} --addr=${addr} bulbizarre ~ # cat /opt/paste-py/paste.pid 9480 bulbizarre ~ # ps aux | grep 9480 root 493 0.0 0.0 11440 924 pts/3 S+ 11:14 0:00 grep --colour=auto 9480 pastepy 9480 0.0 0.4 113548 16848 ? S 08:05 0:00 python ./daemonize.py --port=8087 --addr=127.0.0.1 So, the process is running (and responding), but OpenRC shows it as crashed bulbizarre ~ # rc-status | grep crash paste-py [ crashed ] What do I have to change? Thanks, -- alarig