From patchwork Wed Aug 23 14:43:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 7112 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 (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RW8932KYnz3wm3 for ; Wed, 23 Aug 2023 14:43:35 +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 (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RW89157WFz10N; Wed, 23 Aug 2023 14:43:33 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RW89143nxz2yVl; Wed, 23 Aug 2023 14:43:33 +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 4RW88z3zkbz2xk4 for ; Wed, 23 Aug 2023 14:43:31 +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 (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4RW88y1NvYz16Y for ; Wed, 23 Aug 2023 14:43:29 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1692801810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hQ7Mp+ZX06Z512XreqQXzuk1EhMe0eyclOjedfUS2r4=; b=VnsUOL2owAwpzhNViTxuvnR9HLsMywdDYS9kkZSFdDQQSksWUc2WACJQ2oFols5Xa1gnTk mn18SVCbjhtBtCBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1692801810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hQ7Mp+ZX06Z512XreqQXzuk1EhMe0eyclOjedfUS2r4=; b=SFvLMhNBF+kOttHoR2PSUCrzQhXDlTlVMuVnx1zf7luZSp8TGIkH9VWKjR7/vxREnw6w83 MAc4kZMwCx33pnexUNdYOxofl2s/cpdedLY26tthG3omFLaaH75msV89+ZS+1IkumjR1I+ VCuC8JE2OvnPqEAXJwI8GfLxKqv9DrMSyNu7ro/89hUWs/hCreEWvtyh/Bc51T35203tYc y92TH+xffGrPy0Ke3IcO19yHc2tQc0J0jCzO7rEr94jNGWY1APZjucG5SvbHYO71xG2F7A mmlLP160p30pbmowSZqCgMtmnP5bG2flz7Yk/ZCe/zmw1o34TKmLb2vM5pVKDQ== Message-ID: <80612c05-cb2e-46f8-a1d4-afe135568efc@ipfire.org> Date: Wed, 23 Aug 2023 14:43:00 +0000 MIME-Version: 1.0 To: "IPFire: Development" From: =?utf-8?q?Peter_M=C3=BCller?= Subject: [PATCH] Core Update 179: Only start services if they are enabled 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" Doing so avoids situations where a service is started without being configured to do so, thus reducing the potential for confusion and exposure of services not intended to be exposed by the user. Signed-off-by: Peter Müller --- config/rootfiles/core/179/update.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config/rootfiles/core/179/update.sh b/config/rootfiles/core/179/update.sh index 636792d82..df89d702e 100644 --- a/config/rootfiles/core/179/update.sh +++ b/config/rootfiles/core/179/update.sh @@ -86,9 +86,13 @@ migrate_extrahd # Start services /etc/init.d/udev restart -/etc/init.d/squid restart -/usr/local/bin/openvpnctrl -s -/usr/local/bin/openvpnctrl -sn2n +if [ -f /var/ipfire/proxy/enable ]; then + /etc/init.d/squid restart +fi +if grep -q "ENABLED=on" /var/ipfire/ovpn/settings; then + /usr/local/bin/openvpnctrl -s + /usr/local/bin/openvpnctrl -sn2n +fi # This update needs a reboot... touch /var/run/need_reboot