Bug 769570

Summary: Missing ACL for device files when booted via sysvinit
Product: [openSUSE] openSUSE 12.2 Reporter: Vit Pelcak <vpelcak>
Component: Release NotesAssignee: Karl Eichwalder <ke>
Status: RESOLVED FIXED QA Contact: Stephan Kulow <coolo>
Severity: Major    
Priority: P3 - Medium CC: coolo, forgotten__NtlHAplw6, lnussel, rmilasan, tiwai, vkrevs, vuntz, werner
Version: Beta 2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: alsa-info.txt
Patch for upstream

Description Vit Pelcak 2012-07-02 07:21:42 UTC
When I installed openSUSE 12.2, no sound is played.

pavucontrol finds only Dummy device. Alsamixer detects Analog Devices AD1984A with all channels (none relevant is muted).

I tried to remove pulseaudio, then in KDE Analog Devices AD1984A is detected as audio output, but no sound is still played.

# hwinfo --sound
20: PCI 1b.0: 0403 Audio device                                 
  [Created at pci.319]
  Unique ID: u1Nb.sKwjxXGziR5
  SysFS ID: /devices/pci0000:00/0000:00:1b.0
  SysFS BusID: 0000:00:1b.0
  Hardware Class: sound
  Model: "Intel 82801JI (ICH10 Family) HD Audio Controller"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x3a3e "82801JI (ICH10 Family) HD Audio Controller"
  SubVendor: pci 0x1028 "Dell"
  SubDevice: pci 0x0293 
  Driver: "snd_hda_intel"
  Driver Modules: "snd_hda_intel"
  Memory Range: 0xf7ffc000-0xf7ffffff (rw,non-prefetchable)
  IRQ: 68 (467 events)
  Module Alias: "pci:v00008086d00003A3Esv00001028sd00000293bc04sc03i00"
  Driver Info #0:
    Driver Status: snd_hda_intel is active
    Driver Activation Cmd: "modprobe snd_hda_intel"
  Config Status: cfg=yes, avail=yes, need=no, active=unknown

# lsmod | grep snd
snd_mixer_oss          22413  0 
snd_seq                69746  0 
snd_seq_device         14497  1 snd_seq
snd_hda_codec_analog    93491  1 
snd_hda_intel          33312  0 
snd_hda_codec         136135  2 snd_hda_codec_analog,snd_hda_intel
snd_hwdep              13602  1 snd_hda_codec
snd_pcm               109282  2 snd_hda_intel,snd_hda_codec
snd_timer              29370  2 snd_seq,snd_pcm
snd                    87206  9 snd_mixer_oss,snd_seq,snd_seq_device,snd_hda_codec_analog,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore              15047  1 snd
snd_page_alloc         18484  2 snd_hda_intel,snd_pcm

Feel free to ask for more details.
Comment 1 Takashi Iwai 2012-07-02 07:35:44 UTC
Could you run alsa-info.sh with --no-upload option, and attach the generated output?
Comment 2 Vit Pelcak 2012-07-02 07:54:06 UTC
Created attachment 497050 [details]
alsa-info.txt

Here you are.
Comment 3 Takashi Iwai 2012-07-02 08:06:07 UTC
I see no obvious problem there, so it's likely an issue in PulseAudio.

Try to remove ~/.pulse once and re-login.
Comment 4 Vit Pelcak 2012-07-02 08:49:51 UTC
No change. I still cannot play any audio.
Comment 5 Takashi Iwai 2012-07-02 09:21:46 UTC
OK, then this might be rather the device permission.
Check the permission of /dev/snd/* files.  Also, check ACL of these files via "getfacl /dev/snd/*".
Comment 6 Vit Pelcak 2012-07-02 10:51:52 UTC
ls -l /dev/snd/*
crw-rw---- 1 root audio 116,  6 Jul  2  2012 /dev/snd/controlC0
crw-rw---- 1 root audio 116,  5 Jul  2  2012 /dev/snd/hwC0D0
crw-rw---- 1 root audio 116,  4 Jul  2 09:00 /dev/snd/pcmC0D0c
crw-rw---- 1 root audio 116,  3 Jul  2 09:00 /dev/snd/pcmC0D0p
crw-rw---- 1 root audio 116,  2 Jul  2 09:00 /dev/snd/pcmC0D1p
crw-rw---- 1 root audio 116,  1 Jul  2  2012 /dev/snd/seq
crw-rw---- 1 root audio 116, 33 Jul  2  2012 /dev/snd/timer

# getfacl /dev/snd/*
getfacl: Removing leading '/' from absolute path names
# file: dev/snd/by-path
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

# file: dev/snd/controlC0
# owner: root
# group: audio
user::rw-
group::rw-
other::---

# file: dev/snd/hwC0D0
# owner: root
# group: audio
user::rw-
group::rw-
other::---

# file: dev/snd/pcmC0D0c
# owner: root
# group: audio
user::rw-
group::rw-
other::---

# file: dev/snd/pcmC0D0p
# owner: root
# group: audio
user::rw-
group::rw-
other::---

# file: dev/snd/pcmC0D1p
# owner: root
# group: audio
user::rw-
group::rw-
other::---

# file: dev/snd/seq
# owner: root
# group: audio
user::rw-
group::rw-
other::---

# file: dev/snd/timer
# owner: root
# group: audio
user::rw-
group::rw-
other::---

# cat /etc/group
audio:x:17:pulse
.
.

Shouldn't be user put into audio group?
Comment 7 Takashi Iwai 2012-07-02 10:55:56 UTC
No, the permissions should have been adjusted via ACL dynamically.
This worked fine for 12.1, so it must be a regression on 12.2.

Ludwig, any clue about this change?
Comment 8 Ludwig Nussel 2012-07-02 11:34:44 UTC
Well, as I found out only last week acl handling changed silently once again. It's now logind which handles them which means acls likely only work with systemd. Did you boot using sysvinit maybe?
Comment 9 Vit Pelcak 2012-07-02 12:11:05 UTC
Yes, I did.

I don't want to use systemd at all.
Comment 10 Takashi Iwai 2012-07-02 12:25:29 UTC
OK, so it's another policy change (aka regression) in udev...
Comment 11 Takashi Iwai 2012-07-02 12:26:04 UTC
I confirm that ACL isn't set when booted via sysvinit on my system, too.
Comment 12 Ludwig Nussel 2012-07-02 12:41:00 UTC
Unfortunately nothing we can do about anymore. desktop components are more and more reliant on systemd. sysv just cant be used to boot a desktop anymore.
Comment 13 Ludwig Nussel 2012-07-02 12:55:16 UTC
let's use this bug to get an entry into release notes. Something like


sysvinit deprecated
~~~~~~~~~~~~~~~~~~~

Various desktop components depend on services provided by systemd only. So while openSUSE 12.2 still has basic support for booting a system with sysvinit as fallback it's considered deprecated and probably even broken in some regards. If you have any issues with a sysvinit booted system please try systemd before filing bug reports.
Comment 14 Takashi Iwai 2012-07-02 13:11:55 UTC
Why can't we keep udev-acl and its rule in another package?
sysvinit can take it or depend on it.
Comment 15 Ludwig Nussel 2012-07-02 13:24:46 UTC
well feel free to find a volunteer to do that. Bear in mind that this is just the tip of the iceberg. Another issue I found was udisks depending on logind information. Without systemd udisks keeps asking for the root password for mounting removable media. I guess there are more such rough edges. It's an uphill battle you can't win unless you have plenty of time.
Comment 16 Takashi Iwai 2012-07-02 14:01:43 UTC
Yeah, I know.  But, when I think of SLE12, I'm not sure whether "forgetting old-and-good days and follow to the new world (dis)order" is our way to go.

Speaking of only this bug: the udev-acl stuff is a pretty easy to pick up again.  Just take udev-acl code from the old udev tarball and build it separately.  I guess an experienced packager could finish it in 10 minutes.
Comment 17 Takashi Iwai 2012-07-02 14:31:30 UTC
I created a package udev-acl in OBS home:tiwai/udev-acl repo.
This has "Supplements: sysvinit", so that it'll be dragged in when sysvinit is installed.
Comment 18 Ludwig Nussel 2012-07-03 09:23:23 UTC
you may want to match for tag 'uaccess' so you don't need to do your own tagging and udev-acl should do nothing if the system was booted with systemd.
Comment 19 Takashi Iwai 2012-07-03 09:26:22 UTC
Yes, it's already found in 70-udev-acl.rules.
Actually these are just a copy from udev-173.  Only Makefile is new.
Comment 20 Ludwig Nussel 2012-07-03 09:40:04 UTC
70-udev-acl.rules uses 'udev-acl' as tag
Comment 21 Takashi Iwai 2012-07-03 10:02:40 UTC
Do you mean to check the tag "uaccess" in udev-acl.rules instead of tagging "udev-acl" again?  Then this won't work if systemd isn't installed, since uaccess.rules belongs to systemd, not to udev.

OTOH, systemd is almost impossible to uninstall nowadays, unfortunately.  So, yet another dependency wouldn't be a big issue...
Comment 22 Ludwig Nussel 2012-07-03 10:07:32 UTC
you cannot uninstall systemd
Comment 23 Takashi Iwai 2012-07-03 10:13:13 UTC
You still can uninstall systemd, but it'll be a pretty thin system :)
Comment 24 Karl Eichwalder 2012-07-03 12:42:56 UTC
(In reply to comment #13)
> let's use this bug to get an entry into release notes. Something like

I'm all for it (they both are not compatible in any sense and pretending that you could use one or the other as a replacement, will cause trouble).

> sysvinit deprecated
> ~~~~~~~~~~~~~~~~~~~
> 
> Various desktop components depend on services provided by systemd only. So
> while openSUSE 12.2 still has basic support for booting a system with sysvinit
> as fallback it's considered deprecated and probably even broken in some
> regards. If you have any issues with a sysvinit booted system please try
> systemd before filing bug reports.

Here is my version:

  <sect3 id="sec.122.sysv">
   <!-- bnc#769570 -->
   <title>sysvinit Deprecated</title>
   <para>
    Some desktop components depend on services provided by systemd
    only. So while openSUSE 12.2 still has basic support for booting a
    system with sysvinit as fallback, sysvinit nevertheless is
    considered deprecated and probably even faulty or broken in some
    regard. If you have any issues with a sysvinit booted system, use
    systemd before filing bug reports.
   </para>
  </sect3>

There is still this old entry that we'd probably better remove now:

  <sect3 id="sec.121.systemd-sysvinit">
   <!-- bnc#727092 -->
   <title>Booting with systemd or sysvinit</title>

   <para>CHECKIT for 12.2.  Is this entry still required?</para>
   <para>By default, openSUSE now boots using
   <command>systemd</command>.  In case of trouble, you can switch back
   to the old way using <command>sysvinit</command> by pressing the F5
   key on the boot.</para>

   <para>If you want to switch to <command>sysvinit</command>
   permanently, install the <systemitem>sysvinit-init</systemitem>
   package.  To switch back to <command>systemd</command>, reinstall the
   <systemitem>systemd-sysvinit</systemitem> package.</para>
  </sect3>
Comment 25 Takashi Iwai 2012-07-03 14:02:08 UTC
FWIW, OBS home:tiwai/udev-acl contains the fixed version of udev-acl with the revised rules and some patches.  It shouldn't do harm with systemd, too.

Also, OBS home:tiwai:branches:Base:System/udisks2 contains the package with a fix for sysvinit.  This still works with systemd, too.
Comment 26 Ludwig Nussel 2012-07-04 09:25:55 UTC
udev-acl looks good AFAICT
Comment 27 Takashi Iwai 2012-07-04 09:38:29 UTC
OK, I created SR to Base:System via SRID 127080.
Comment 28 Karl Eichwalder 2012-07-05 12:19:19 UTC
(In reply to comment #24)
> (In reply to comment #13)

> Here is my version:

Updated version:

  <sect2 id="sec.122.sysv">
   <!-- bnc#769570 -->
   <title>sysvinit Deprecated</title>
   <para>
    Some desktop components depend on services provided by systemd
    only. So while openSUSE 12.2 still has basic support for booting a
    system with sysvinit as fallback, sysvinit nevertheless is
    considered deprecated and probably even faulty or broken in some
    regard. If you have any issues with a sysvinit booted system, use
    systemd before filing bug reports.
   </para>
  </sect2>

> There is still this old entry that we'd probably better remove now:

I shortened it as follows:

  <sect2 id="sec.121.systemd-sysvinit">
   <!-- bnc#727092 -->
   <title>Booting with Deprecated sysvinit</title>

   <para>By default, openSUSE now boots using
   <command>systemd</command>.  In case of trouble, you can try to switch back
   to the deprecated <command>sysvinit</command> way by pressing the F5
   key on the boot.  For more information about limitations when booting
   with sysvinit, see <xref linkend="sec.122.sysv"/>.</para>

  </sect2>
Comment 29 Karl Eichwalder 2012-07-06 07:51:55 UTC
SR done.
Comment 30 Vadim Krevs 2012-09-10 07:59:52 UTC
Just upgraded from 12.1 (that used sysvinit) to 12.2 using zypper dup, and ran into this very problem. 

Had to manually install udev-acl from OBS home:tiwai/udev-acl repo - it was not automatically picked up by the upgrade.
Comment 31 Takashi Iwai 2012-09-10 08:09:56 UTC
Yes, the problem isn't fixed at all but just proactively ignored :)
udev-acl package itself is found already in OBS Base:System.

Also you'd need to install the fixed udisk2 package from OBS home:tiwai:branches:Base:System/udisk2.  The SR has been pending over months in a review state.  I copied the package to home:tiwai/udisk2 to be sure.
Comment 32 Vadim Krevs 2012-09-10 08:29:07 UTC
Takashi, thank you for a prompt response.

What is the URL for Base:System for 12.2? The standard one - http://download.opensuse.org/repositories/Base:/System/openSUSE_12.2/ - does not exist.
Comment 33 Takashi Iwai 2012-09-10 08:41:45 UTC
The OBS Base:System is published only for FACTORY by some unknown reason.
Comment 34 Ludwig Nussel 2012-09-11 07:44:07 UTC
Base:System is not a backports project, it's staging for Factory. The udisks2 sr is in review state by Vincent, you may want to ping him. Wrt udev-acl you need to submit that package to the target project yourself, it won't happen automatically of course.
Comment 35 Vincent Untz 2012-09-25 08:49:38 UTC
(In reply to comment #31)
> Also you'd need to install the fixed udisk2 package from OBS
> home:tiwai:branches:Base:System/udisk2.  The SR has been pending over months in
> a review state.  I copied the package to home:tiwai/udisk2 to be sure.

Sorry, it got pointed out to me today it was waiting for my review -- unfortunately, I missed that :/

Ideally, the patch should use sd_booted(), but udisks2 doesn't link with libsystemd-daemon, so I guess the patch is good enough if used for an update. For a proper fix, using sd_booted() is likely what we should do (and we can do it earlier in the function).

That being said, what I'm missing is a bug upstream. Did you file that?
Comment 36 Vincent Untz 2012-09-25 09:00:03 UTC
Created attachment 506916 [details]
Patch for upstream

That would be the patch for upstream.
Comment 37 Vincent Untz 2012-09-25 09:12:03 UTC
Didn't find a bug upstream, so I filed https://bugs.freedesktop.org/show_bug.cgi?id=55309.

The sr will go in now.