From patchwork Thu Jan 8 20:50:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Owen Kirby X-Patchwork-Id: 426858 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1323014012F for ; Fri, 9 Jan 2015 07:50:47 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 864842805E4; Thu, 8 Jan 2015 21:48:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 8A54128121B for ; Thu, 8 Jan 2015 21:48:25 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 CL_IP_EQ_HELO_IP=-2 (check from: .exegin. - helo: .mail-pa0-f45.google. - helo-domain: .google.) FROM/MX_MATCHES_NOT_HELO(DOMAIN)=1; rate: -5.5 Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 8 Jan 2015 21:48:22 +0100 (CET) Received: by mail-pa0-f45.google.com with SMTP id lf10so13971990pab.4 for ; Thu, 08 Jan 2015 12:50:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=A0Zy/lTEa8KH5AiJEpP97FBPuCRERfVpbpQTE6VgPH4=; b=ljh2FQz990rNxhSOM9UGwp+rNU8gkutXj2FhSTSAgYEl3lRtiukGgtmPORweY7l5T0 hiZ02b2kBG73DNjoRAzmTGvZ4ZBtl82WvQWLrahcHuC1uvUXn5ZcI8i+e/NcIcFb57bk NzFw2hZ4rz9drM0enXDwdA1X6nhFHXFCYK1NuBxWNNrYOFGgSH5qLEhEQcu47StAIORh RMHELN2hKYz3RTuc8eXhKZFgwKz1GmAL23IytBw7OapXe4gYOStSDZzHVKn7DuiE3h0G Ob3VMqTNOdUpcVKrDa1jrVZZ6spDOCKhdXnGthZCn0rRuGGdIjgygv5IRjQDT0rnSba9 /blw== X-Gm-Message-State: ALoCoQn7ajwNQpRSQz1IAEQm1yq43hJ2FcUeJfHww+h++4qaT8EoVQ9rMUWIhqkJsNbSAkc8REXf X-Received: by 10.68.234.134 with SMTP id ue6mr17931995pbc.47.1420750230201; Thu, 08 Jan 2015 12:50:30 -0800 (PST) Received: from [172.16.16.147] ([184.71.143.130]) by mx.google.com with ESMTPSA id sb7sm5170050pbc.54.2015.01.08.12.50.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jan 2015 12:50:29 -0800 (PST) Message-ID: <54AEED81.4090901@exegin.com> Date: Thu, 08 Jan 2015 12:50:09 -0800 From: Owen Kirby User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] procd/inittab with a delayed console X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Hi, I'm not sure if this is a bug with procd's implementation of inittab or if I'm just doing something wrong in my inittab. However, we have a board that has multiple serial console ports, one of which relies on a kernel module and procd refuses to start a console on the second port. What seems to be happening is that procd loads inittab before the kernel modules are loaded, therefore the tty device doesn't exist yet and the check for dev_exist() fails and procd never forks a worker for that console. I was able to fix it for my board with the following patch, but I'm not sure if this is would be the entire fix for the problem since it seems like fork_worker() should be a little more graceful in handling tty devices that don't exist yet. Any thoughts or suggestions on better ways to fix this? Thanks, Owen diff --git a/inittab.c b/inittab.c index 2efbf4d..7b12e10 100644 --- a/inittab.c +++ b/inittab.c @@ -161,7 +161,7 @@ static void askfirst(struct init_action *a) { int i; - if (!dev_exist(a->id) || (console && !strcmp(console, a->id))) { + if (console && !strcmp(console, a->id)) { DEBUG(4, "Skipping %s\n", a->id); return; }