From patchwork Tue May 23 17:23:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonatan Schlag X-Patchwork-Id: 6907 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4QQh4c4Qczz3wlf for ; Tue, 23 May 2023 17:24:00 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4QQh4Z6DTjz9Vt; Tue, 23 May 2023 17:23:58 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4QQh4Z3rfJz30L6; Tue, 23 May 2023 17:23:58 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4QQh4Y2cJkz2ySG for ; Tue, 23 May 2023 17:23:57 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4QQh4Y14f1z9Tr; Tue, 23 May 2023 17:23:57 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1684862637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JDDZUdorWqHiD6OlcnO+URMPZC7+kMtre0wF3Qqb9u4=; b=ZKqtqcLXc4h/SxbbrAIgzEa2Em/KSU+WREk+7PUyUnKRsaiTWDENRUp9ZtpRO+KaRu/Wz/ EunVuEGWOu8N1qBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1684862637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JDDZUdorWqHiD6OlcnO+URMPZC7+kMtre0wF3Qqb9u4=; b=lFl5TOSx4r+xX94mot8ccrzPt4ieUQNtytdFKReUs0v4I9MX1YsVHJ+yjXulqpvfnlMOC7 heADdQ/o1UpMJQayiDheiu4o0imWouhv9LxNmYimn7K8vrgv2i4LOpIxTWHZ5Vh1+5/T5B F7H5tUjoelu7L4g/fKCLEVY+dw510uckgYgZGn067QWlhV1eWnlVrxOKjigfKvv78HruEp Kf4aC97E60vi6DRs0hYjg33G1ZhHPzZZa3Y/HmxztWqgThYSyGrUBdAG1tHSvHb5ZqlKKG FDDsSE2yM6eGYc31r6x8jHqJXC+aZ2dNVqNqQFSKk5+b1QmJWU5SgXRlLDUxRA== From: Jonatan Schlag To: development@lists.ipfire.org Subject: [Patch RFC 08/15] network startup: Always cleanup before red gets started Date: Tue, 23 May 2023 19:23:08 +0200 Message-Id: <20230523172314.7826-9-jonatan.schlag@ipfire.org> In-Reply-To: <20230523172314.7826-1-jonatan.schlag@ipfire.org> References: <20230523172314.7826-1-jonatan.schlag@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" There is no sense in doing this only in /etc/init.d/network and not in /etc/init.d/networking/red This files should be always deleted before a startup Signed-off-by: Jonatan Schlag --- src/initscripts/networking/red | 3 +++ src/initscripts/system/network | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red index 8e41314b6..3873974ea 100644 --- a/src/initscripts/networking/red +++ b/src/initscripts/networking/red @@ -80,6 +80,9 @@ fi case "${1}" in start) + # Remove possible leftover files + rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf} + if [ "${DEVICE}" != "${GREEN_DEV}" ] && [ "${DEVICE}" != "" ]; then boot_mesg "Bringing up the ${DEVICE} interface..." boot_mesg_flush diff --git a/src/initscripts/system/network b/src/initscripts/system/network index b346d487c..9694165f2 100644 --- a/src/initscripts/system/network +++ b/src/initscripts/system/network @@ -60,11 +60,7 @@ case "${DO}" in [ "$orange" == "1" ] && /etc/rc.d/init.d/networking/orange start # RED - if [ "$red" == "1" ]; then - # Remove possible leftover files - rm -f /var/ipfire/red/{active,device,dial-on-demand,dns1,dns2,local-ipaddress,remote-ipaddress,resolv.conf} - /etc/rc.d/init.d/networking/red start - fi + [ "$red" == "1" ] && /etc/rc.d/init.d/networking/red start boot_mesg "Mounting network file systems..." mount -a -O _netdev