From patchwork Mon Dec 7 14:01:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 3710 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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4CqQ3V1QN9z3wfs for ; Mon, 7 Dec 2020 14:01:58 +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 "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4CqQ3T2RV7z1V0; Mon, 7 Dec 2020 14:01:57 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4CqQ3S6LtXz2yDF; Mon, 7 Dec 2020 14:01:56 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4CqQ3R4Cc9z2xVW for ; Mon, 7 Dec 2020 14:01:55 +0000 (UTC) Received: from smtpq4.tb.mail.iss.as9143.net (smtpq4.tb.mail.iss.as9143.net [212.54.42.167]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4CqQ3R0wbZzD0 for ; Mon, 7 Dec 2020 14:01:55 +0000 (UTC) Received: from [212.54.42.137] (helo=smtp6.tb.mail.iss.as9143.net) by smtpq4.tb.mail.iss.as9143.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kmH5O-0004uN-Cr; Mon, 07 Dec 2020 15:01:54 +0100 Received: from j103033.upc-j.chello.nl ([24.132.103.33] helo=rhea.saturn.pimb.org) by smtp6.tb.mail.iss.as9143.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kmH5N-006XxX-Gb; Mon, 07 Dec 2020 15:01:53 +0100 Received: from hyperion.saturn.pimb.org (hyperion.saturn.pimb.org [192.168.26.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by rhea.saturn.pimb.org (Postfix) with ESMTPSA id 5E45E3EF6; Mon, 7 Dec 2020 15:01:53 +0100 (CET) From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] Fix for bug 12539 Date: Mon, 7 Dec 2020 15:01:36 +0100 Message-Id: <20201207140136.3423-1-ahb.ipfire@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-SourceIP: 24.132.103.33 X-Authenticated-Sender: adolf.belka@ziggo.nl (via SMTP) X-Ziggo-spambar: / X-Ziggo-spamscore: 0.0 X-Ziggo-spamreport: CMAE Analysis: v=2.4 cv=B8oHbMhM c=1 sm=1 tr=0 ts=5fce35d1 a=N0UC3/faf55XGTeY5t7zSQ==:17 a=9+rZDBEiDlHhcck0kWbJtElFXBc=:19 a=zTNgK-yGK50A:10 a=x7bEGLp0ZPQA:10 a=6yxbeI8x3IIA:10 a=pGLkceISAAAA:8 a=Nr4KyOdOul2KQ9t7dtQA:9 X-Ziggo-Spam-Status: No X-Spam-Status: No X-Spam-Flag: No ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1607349715; a=rsa-sha256; cv=none; b=AkAYjvEIbTFVr1/1nBQhbu8dfY6632N3yEDtJ1x754vcEXo/LI6T770BIyUdBJa02Y4bAn mPX1XPVDH+g5hKmrhShAWqnHsY67M0u3dQcEn4TlhZSPhhJgLob2n+3oMhl6ZY3f9NOcBc aFmwA4fSSj1oNjew/oxWkbcIYVF0DNTVZRwR2siJnBckbOs9BjHmFGHExXZDnr9ug4xfPm zgUQTZDCVHJjcUZ1cqJjiQq8lo5G2oJKQD5tXCbZamVyw5UjRqln2j6t68DWqq7TXM8S34 ULLHhh8RO+n2ifMIXKXElgfR1PWdavROH1nyz94flFI+vJsCUMtpjihWAkpgkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1607349715; 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; bh=e2/6y/XZlP2sMQbsNyLg8FsJEX3cvf2wp4/v0VFk87I=; b=u9HfffoNk/d5Rgg7pkUmPHNXjhaV6jsyxY35n908LXzB0KAzWhShxBud1jsKGiGLPuuL4m 1FjOGwpmtRcundBFI70HzVZx/v8BDlRTK8Sr5brjTzG5xGqHZqgRDFCjNtfeR/SBNEnjSd SEPZc7T1C4oO94Y2N1GbCfbnxXrvbCRIAu9WYXB7IDQrMxpOeySwoZBCVUTGxtQ4pBxS7T 8ZE6zo4GyKldugVLEQpshZAGEsuhMW2PVWuB5TBcN5W15N4uoVg/U4wY0ndwec3Vz2+eI0 u5UVgtDL81YLwgsE81uvT7wWmGkfEwx68ztiibfuUX+3sFjEvSEIuWJt2sl4jw== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=none; spf=softfail (mail01.ipfire.org: 212.54.42.167 is neither permitted nor denied by domain of ahbipfire@gmail.com) smtp.mailfrom=ahbipfire@gmail.com Authentication-Results: mail01.ipfire.org; dkim=none; spf=softfail (mail01.ipfire.org: 212.54.42.167 is neither permitted nor denied by domain of ahbipfire@gmail.com) smtp.mailfrom=ahbipfire@gmail.com; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none) X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-2.25 / 11.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_MISSING_CHARSET(2.50)[]; IP_REPUTATION_HAM(-2.25)[asn: 33915(-0.18), country: NL(-0.00), ip: 212.54.42.167(-0.94)]; BROKEN_CONTENT_TYPE(1.50)[]; R_SPF_SOFTFAIL(0.00)[~all]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; RCVD_COUNT_THREE(0.00)[4]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:33915, ipnet:212.54.32.0/20, country:NL]; R_DKIM_NA(0.00)[]; HAS_X_AS(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[24.132.103.33:received]; TAGGED_FROM(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; BAYES_HAM(-3.00)[99.99%]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.54.42.167:from]; NEURAL_HAM(-1.00)[-1.000]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.54.42.167:from]; FREEMAIL_CC(0.00)[gmail.com]; RCVD_TLS_ALL(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Queue-Id: 4CqQ3R0wbZzD0 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" The installer recognises cups and cups-filters both as cups and puts two instances of cups in the add-on services table. Based on input from Michael Tremer this patch replaces the command returning the second element between hyphens with one that takes what comes after "meta-" using Perl code rather than a shell command. The second find command was changed as per Michael's suggestion. Tested in my ipfire test bed system and only results in one cups entry. Signed-off-by: Adolf Belka --- html/cgi-bin/services.cgi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi index 26ab4f314..36954ba70 100644 --- a/html/cgi-bin/services.cgi +++ b/html/cgi-bin/services.cgi @@ -161,19 +161,20 @@ END my $lines=0; # Used to count the outputlines to make different bgcolor # Generate list of installed addon pak's - my @pak = `find /opt/pakfire/db/installed/meta-* 2>/dev/null | cut -d"-" -f2`; + opendir (DIR, "/opt/pakfire/db/installed") || die "Cannot opendir /opt/pakfire/db/installed/: $!"; + my @pak = sort readdir DIR; foreach (@pak){ chomp($_); + next unless (m/^meta-/); + s/^meta-//; # Check which of the paks are services - my @svc = `find /etc/init.d/$_ 2>/dev/null | cut -d"/" -f4`; - foreach (@svc){ + if (-e "/etc/init.d/$_") { # blacklist some packages # # alsa has trouble with the volume saving and was not really stopped # mdadm should not stopped with webif because this could crash the system # - chomp($_); if ( $_ eq 'squid' ) { next; }