Bug 28416 - Wine package should not have init.d script and a systemd-binfmt: wine.service failed at boot time
Summary: Wine package should not have init.d script and a systemd-binfmt: wine.service...
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA8-64-OK
Keywords: validated_update
: 28570 29343 29430 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-23 15:29 CET by Aurelien Oudelet
Modified: 2021-09-13 20:23 CEST (History)
9 users (show)

See Also:
Source RPM: wine-6.0-3.mga8.src.rpm
CVE:
Status comment: Potential fix in Comment 5


Attachments
journalctl -b (179.08 KB, text/plain)
2021-02-23 15:29 CET, Aurelien Oudelet
Details

Description Aurelien Oudelet 2021-02-23 15:29:28 CET
Created attachment 12369 [details]
journalctl -b

Mageia 8 x86_64 Plasma, classic ISO. Online repositories and 32bits one activated for the following.

After wine and lutris installed,
I see in system journal:

$ systemctl status wine.service
● wine.service - LSB: Allow users to run Windows(tm) applications
     Loaded: loaded (/etc/rc.d/init.d/wine; generated)
     Active: failed (Result: exit-code) since Tue 2021-02-23 15:17:19 CET; 2min 55s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 1130 ExecStart=/etc/rc.d/init.d/wine start (code=exited, status=1/FAILURE)
        CPU: 10ms

févr. 23 15:17:19 mageia.local wine[1130]: Lancement de wine : [ÉCHEC ]
févr. 23 15:17:19 mageia.local wine[1130]: Enregistrement de Wine déjà activé !
févr. 23 15:17:19 mageia.local systemd[1]: Starting LSB: Allow users to run Windows(tm) applications...
févr. 23 15:17:19 mageia.local systemd[1]: wine.service: Control process exited, code=exited, status=1/FAILURE
févr. 23 15:17:19 mageia.local systemd[1]: wine.service: Failed with result 'exit-code'.
févr. 23 15:17:19 mageia.local systemd[1]: Failed to start LSB: Allow users to run Windows(tm) applications.
Comment 1 Aurelien Oudelet 2021-02-23 15:30:42 CET
Assigned to the package maintainer.

(Please set the status to 'assigned' if you are working on it)

Source RPM: (none) => wine-6.0-3.mga8.src.rpm
Assignee: bugsquad => rverschelde

Comment 2 Aurelien Oudelet 2021-02-23 15:40:22 CET
I think this faild because

/proc/sys/fs/binfmt_misc/windows

already exists because of:

proc-sys-fs-binfmt_misc.automount and qemu installed on this system for aarch build ISO tests...
So the wine initscript should fail gracefully instead of report an error.
Comment 3 Dave Hodgins 2021-07-01 00:04:18 CEST
The initscript file, /etc/rc.d/init.d/wine should be removed from the package
as registering the binary format is the sole purpose of the script duplicating
the effect of /usr/lib/binfmt.d/wine.conf from the same package.

Lowering the priority as the impact is cosmetic.

Workaround is to run as root "chkconfig wine off" for those who do not want
systemd status showing degraded as it's status.

For now, I recommend removing the file /etc/rc.d/init.d/wine from the package
in svn and waiting for the next wine update for it to be distributed.

Priority: Normal => Low
CC: (none) => davidwhodgins

Comment 4 Aurelian R 2021-07-01 00:32:56 CEST
 I use the solution posted at the end of Alex Gromnitsky's blog 
https://gromnitsky.blogspot.com/2017/03/how-to-prevent-wine-from-auto-running.html :

# ln -s /dev/null /etc/binfmt.d/wine.conf
# systemctl restart systemd-binfmt

This seems to avoid all issues with wine service:

# systemctl status wine.service
● wine.service - LSB: Allow users to run Windows(tm) applications
     Loaded: loaded (/etc/rc.d/init.d/wine; generated)
     Active: active (exited) since Wed 2021-06-30 12:51:39 EEST; 12h ago
       Docs: man:systemd-sysv-generator(8)
      Tasks: 0 (limit: 19093)
     Memory: 0B
        CPU: 0
     CGroup: /system.slice/wine.service

Jun 30 12:51:39 ryzen-ux systemd[1]: Starting LSB: Allow users to run Windows(tm) applications...
Jun 30 12:51:39 ryzen-ux wine[2912]: Starting wine: [  OK  ]
Jun 30 12:51:39 ryzen-ux systemd[1]: Started LSB: Allow users to run Windows(tm) applications.

# systemctl status systemd-binfmt.service 
● systemd-binfmt.service - Set Up Additional Binary Formats
     Loaded: loaded (/usr/lib/systemd/system/systemd-binfmt.service; static)
     Active: active (exited) since Wed 2021-06-30 12:51:37 EEST; 12h ago
       Docs: man:systemd-binfmt.service(8)
             man:binfmt.d(5)
             https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html
             https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems
   Main PID: 684 (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 19093)
     Memory: 0B
        CPU: 0
     CGroup: /system.slice/systemd-binfmt.service

Regards.

CC: (none) => arusanu

Comment 5 Dave Hodgins 2021-07-01 02:17:53 CEST
The problem is caused by the wine package using both an init script and
systemd-binfmt to register the the binary formats. One or the other should
be used, not both.

Note that systemd-binfmt is used by packages other then wine, so I think it's
preferable to remove the init script.
Comment 6 Aurelien Oudelet 2021-07-23 22:03:01 CEST
(In reply to Dave Hodgins from comment #5)
> The problem is caused by the wine package using both an init script and
> systemd-binfmt to register the the binary formats. One or the other should
> be used, not both.
> 
> Note that systemd-binfmt is used by packages other then wine, so I think it's
> preferable to remove the init script.

Agree.

Priority: Low => Normal
Summary: wine.service failed at boot time, results systemd status degraded => Wine package should not have init.d script and a systemd-binfmt: wine.service failed at boot time
Status comment: (none) => Potential fix in Comment 5

Comment 7 Rémi Verschelde 2021-07-23 22:32:52 CEST
Not directly related to this issue, but for the record: I picked up maintainership of the wine package when damsweb retired IIRC, but I've never been its most active maintainer (that's more tv).

I re-assigned the wine package to `nobody` as I'm not active enough to fulfill the needs for this package. I might still poke at some bugs as time permits but can't make any promise.

Re-setting assignee to pkg-bugs@, but feel free to snatch it up Thierry if you're up for it :)

Assignee: rverschelde => pkg-bugs
CC: (none) => thierry.vignaud

Rémi Verschelde 2021-07-23 22:33:10 CEST

CC: (none) => rverschelde

Comment 8 Aurelien Oudelet 2021-07-23 23:23:22 CEST
*** Bug 28570 has been marked as a duplicate of this bug. ***

CC: (none) => pealfa

Comment 9 David Walser 2021-07-25 19:20:30 CEST
Also agree with Dave.  I guess care needs to be taken to have the updated package run 'chkconfig --del wine' so as not to leave old broken symlinks around, probably in a %triggerun scriplet.
Comment 10 egc 2021-08-08 18:31:46 CEST
*** Bug 29343 has been marked as a duplicate of this bug. ***

CC: (none) => egc

Comment 11 David Walser 2021-09-01 18:10:58 CEST
*** Bug 29430 has been marked as a duplicate of this bug. ***

CC: (none) => mageia

Comment 12 Thomas Backlund 2021-09-01 20:16:32 CEST
(In reply to David Walser from comment #9)
> Also agree with Dave.  I guess care needs to be taken to have the updated
> package run 'chkconfig --del wine' so as not to leave old broken symlinks
> around, probably in a %triggerun scriplet.

I think this part was ignored in the currently "fixed" wine packages...
Comment 13 Raphael Gertz 2021-09-02 11:42:22 CEST
I think it's not needed because the package removes the init script in it's %preun script.

So by dropping %post and %preun scripts in new version, the old bugged wine version removes the init script by itself.

I upgraded to local build version and didn't get a problem, tell me if you have trailing wine stuff in /etc/rc?.d/*wine ?

Best regards
Comment 14 Raphael Gertz 2021-09-02 11:43:42 CEST
For me the only remaining action is to pass the package from updates_testing to updates (and issue errata ?).
Comment 15 Raphael Gertz 2021-09-02 11:52:28 CEST
This script from previous version should handle init script removal :
%preun -n %{wine}
%_preun_service %{name}
Comment 16 Dave Hodgins 2021-09-02 20:55:56 CEST
We still need a list of the srpm/rpm packages, an advisory stating what the
purpose of the update is, and the bug assigned to qa before it can be
validated for moving from updates testing to updates.
Comment 17 Raphael Gertz 2021-09-03 09:30:17 CEST
I have uploaded a fixed package for Mageia 8.

You can test this by installing and see that it don't have a failing sysv init script anymore.

Suggested advisory:
========================

Updated wine packages fix failing sysv init script:

Wine sysv init fail since registering binfmt windows and windowsPE is already done by systemd-binfmt.service with /usr/lib/binfmt.d/wine.conf config rile.

This update just drop script and triggers, old package will drop the service itself.

References:
https://www.mageialinux-online.org/forum/topic-28733+wine.php
========================

Updated packages in core/updates_testing:
========================
In armv7hl and i586 arch:
wine-6.0-4.1.mga8
wine-devel-6.0-4.1.mga8
wine32-6.0-4.1.mga8

In aarch64 and x86_64 arch:
wine64-6.0-4.1.mga8
wine64-devel-6.0-4.1.mga8

Source RPMs: 
wine-6.0-4.1.mga8.src.rpm
Raphael Gertz 2021-09-03 09:33:26 CEST

Assignee: pkg-bugs => qa-bugs

Comment 18 Herman Viaene 2021-09-13 16:03:03 CEST
MGA8-64 Plasma on Lenovo B50
This laptop did not have wine installed before.
No installation issues, i.e. no feedback on any problem.
Run winefile OK, so OK for me.

CC: (none) => herman.viaene
Whiteboard: (none) => MGA8-64-OK

Comment 19 Dave Hodgins 2021-09-13 20:23:56 CEST
Before installing the update ...
[root@x3 ~]# chkconfig 2>/dev/null|grep wine
wine            0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@x3 ~]# ls -l /etc/rc.d/rc3.d/S99wine 
lrwxrwxrwx 1 root root 14 Sep 13 14:19 /etc/rc.d/rc3.d/S99wine -> ../init.d/wine*

After installing the update ...
[root@x3 ~]# chkconfig 2>/dev/null|grep wine
[root@x3 ~]# ls -l /etc/rc.d/rc3.d/S99wine 
ls: cannot access '/etc/rc.d/rc3.d/S99wine': No such file or directory

Validating the update.

CC: (none) => sysadmin-bugs
Keywords: (none) => validated_update


Note You need to log in before you can comment on or make changes to this bug.