Bug 12539 - Core 152, addon cups: Duplicate listing of cups in WUI, Status -> Services -> Addon Services table
Summary: Core 152, addon cups: Duplicate listing of cups in WUI, Status -> Services ->...
Status: CLOSED FIXED
Alias: None
Product: IPFire
Classification: Unclassified
Component: cups (show other bugs)
Version: 2
Hardware: x86_64 Linux
: - Unknown - Aesthetic Issue
Assignee: Adolf Belka
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-22 12:53 UTC by datamorgana
Modified: 2021-03-08 17:48 UTC (History)
2 users (show)

See Also:


Attachments
Addon Services Table (37.72 KB, image/png)
2020-11-22 12:53 UTC, datamorgana
Details

Note You need to log in before you can comment on or make changes to this bug.
Description datamorgana 2020-11-22 12:53:29 UTC
Created attachment 806 [details]
Addon Services Table

- IPFire: 2.25, core 152

- System: Linux ipfire 4.14.198-ipfire #1 SMP Mon Oct 5 21:52:30 GMT 2020 x86_64 Intel(R) Atom(TM) CPU C3758 @ 2.20GHz GenuineIntel GNU/Linux

- Description: Addon CUPS appears as duplicate entry in the running services status table

- Precondition:
Package "cups" is installed (in my case automatically because of resolved dependencies to package "samba")

- Steps:
1. Klick in WUI: Status -> Services
2. Look in section Addon - Services
3. Notice "cups" entry in table shown here (see attached screenshot).

- Expected result:
Every service entry in the the table is shown ONCE.

- Actual result:
The entry of service "cups" is shown TWICE.

A click in the red or green arrow next to one of the duplicate entries to stop or start services "cups" (or a click in the "Boot" checkbox) shows that both service entries are identical in their reaction to the click, i.e. they both show the same status change.

- Proposed resolution:
Rename file
/opt/pakfire/db/installed/meta-cups-filters to
/opt/pakfire/db/installed/meta-cupsfilters (omit the second dash).

- Further details:
Script /srv/web/ipfire/cgi-bin/services.cgi between lines 161 and 202 parses two file lists:

/opt/pakfire/db/installed/meta-* and
/etc/init.d/*

Filenames of the packages in /opt/pakfire/db/installed/meta-* are split on first occurence of "-" to compare with the list of init scripts in /etc/init.d/*

Since "meta-cups" and "meta-cups-filters" result in the same "cups" string after the split, it will appear twice in the table built by the CGI script mentioned above.

It can be reproduced as follows, taking the routines from the CGI script to a shell one-liner:

[root@ipfire]# for i in `find /opt/pakfire/db/installed/meta-* 2>/dev/null | cut -d"-" -f2`; do echo `find /etc/init.d/$i 2>/dev/null | cut -d"/" -f4` | grep -v '^$'; done
avahi
clamav
cups
cups
freeradius
nut
samba
squid
watchdog
[root@kerberos installed]# mv meta-cups-filters meta-cupsfilters
[root@kerberos installed]# for i in `find /opt/pakfire/db/installed/meta-* 2>/dev/null | cut -d"-" -f2`; do echo `find /etc/init.d/$i 2>/dev/null | cut -d"/" -f4` | grep -v '^$'; done
avahi
clamav
cups
freeradius
nut
samba
squid
watchdog

Thanks,
datamorgana
Comment 1 Adolf Belka 2020-12-07 14:10:47 UTC
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 so fixes the issue raised in this bug.

Has been provided to the developer's mail list as a patch and is now in patchwork.

https://patchwork.ipfire.org/patch/3710/
Comment 4 Peter Müller 2021-02-13 09:59:07 UTC
(In reply to Adolf Belka from comment #3)
> https://blog.ipfire.org/post/ipfire-2-25-core-update-154-available-for-
> testing

Gee, thank you. :-)
Comment 5 Adolf Belka 2021-03-08 17:48:15 UTC
fix patch has been released with Core Update 154