Bug 9799 - Sound system blocked by exiting root terminal in LXDE
Summary: Sound system blocked by exiting root terminal in LXDE
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 3
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: mga3-32-ok mga3-64-ok
Keywords: PATCH, validated_update
Depends on: 9817
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-19 16:52 CEST by Bert Aerts
Modified: 2013-10-05 19:59 CEST (History)
9 users (show)

See Also:
Source RPM: lxdm
CVE:
Status comment:


Attachments
loginctl getfacl (3.61 KB, text/plain)
2013-04-20 12:33 CEST, Bert Aerts
Details
summary screenshot of presumedly unconfigured sound card (147.99 KB, image/png)
2013-04-24 10:06 CEST, Marja Van Waes
Details
loginctl show_session's with and without sound (1.63 KB, text/plain)
2013-04-24 10:39 CEST, Marja Van Waes
Details

Description Bert Aerts 2013-04-19 16:52:49 CEST
Description of problem:

I installed Mageia 3 beta 4 x86_64 live KDE DVD via USB stick on an external USB disk.
I copied my MP3 music to the /home partition on this external USB disk.
I start Amarok and it plays fine.
Then I start some kernel compilation activities via su in a terminal shell.
When exiting from su, Amarok stops playing and the "progress bar" freezes.
Doing su again makes Amarok continue playing.
Amarok only plays when there is a root shell open.
Same with other applications - complete sound system is blocked when there is no root shell open.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.


Reproducible: 

Steps to Reproduce:
Comment 1 claire robinson 2013-04-19 17:10:59 CEST
I've tested this with pre3rc kde installed from classic i586 dvd and couldn't reproduce. It may be x86_64 or something to do with live isos.

Forum link: https://forums.mageia.org/en/viewtopic.php?f=15&t=4735

CC: (none) => mageia, tmb

claire robinson 2013-04-19 17:11:25 CEST

CC: (none) => eeeemail

Comment 2 Bert Aerts 2013-04-19 17:14:07 CEST
Fact that problem is not seen on i586 is in line with:
https://forums.mageia.org/en/viewtopic.php?f=15&t=4735#p33091

"I have been seeing some similar weirdnesses. When I am doing admistrative tasks on LXDE as root, when package update runs as part of the Mageia Online applet, I get root password fail dialogs popping up on the screen. Why are processes of one parent sending their output to a different parent process? Not the same as what you are seeing of course, but very similar. In your case one child process (Amarok) is being affected by a different child process (su). This is VERY weird and something I have never seen before with Linux. And, by the way, I am not seeing this on my 32bit system, ONLY on my 64bit system, AND it only started to happen recently after a package update. - George"
Comment 3 Dave Hodgins 2013-04-19 22:03:53 CEST
I've tested three separate installs with the pre-release x86-64 RC
dvd.

Gnome - Rhythmbox
Kde - Amarok
Lxde - Xine (and then with Amarok).

I could not reproduce the problem.

So either it's limited to installs from the live iso, or it's
been fixed, or it's hardware dependent.

When we have the next build of the RC live iso images, I'll make
sure to test for this problem, with them.

CC: (none) => davidwhodgins

Comment 4 Colin Guthrie 2013-04-20 02:02:16 CEST
I suspect some kind of session/permissions related thing.

Can you do the following both when working and when frozen:

1. loginctl
2. loginctl show-session N (for each value of N in 1)
3. getfacl /dev/snd/pcm*
Comment 5 Bert Aerts 2013-04-20 12:33:06 CEST
Created attachment 3777 [details]
loginctl getfacl
Comment 6 Colin Guthrie 2013-04-20 23:11:18 CEST
Yup that confirms it.

The session is marked as active initially, but is then deactivated apparently to make way for the su session, which then disappears and then the original session is not reactivated, and ultimately your user is removed from the ACL.

This is typically caused by a misconfigured PAM configuration or a broken login manager.

What login manager are you using? Is the problem solved if you use GDM?
Comment 7 Bert Aerts 2013-04-21 09:54:16 CEST
My login manager is the default KDE login manager.
I installed Mageia 3 beta 4 KDE live DVD and did not change the login manager.
Comment 8 Colin Guthrie 2013-04-21 10:54:47 CEST
(In reply to Bert Aerts from comment #7)
> My login manager is the default KDE login manager.
> I installed Mageia 3 beta 4 KDE live DVD and did not change the login
> manager.

And is it solved if you switch to GDM? I'm only asking this as a test to compare. AFAIUI the "c" prefix on the session name is often the result of pam loginuid not being processed but the kdm pam.d file should contain that happily.
Comment 9 Colin Guthrie 2013-04-21 11:27:39 CEST
FWIW, I just tested in KDM here and it worked OK, so I suspect some problem of installing from the Live  system. Can you do the following as root:

$ grep loginuid /etc/pam.d/*
$ rpm -V mageia-kde4-config-common

Cheers
Comment 10 Bert Aerts 2013-04-21 12:57:57 CEST
[bert@Dell7720Mageia3 ~]$ grep loginuid /etc/pam.d/*
grep: /etc/pam.d/chage: Permission denied
grep: /etc/pam.d/chage-chfn-chsh: Permission denied
grep: /etc/pam.d/chpasswd: Permission denied
grep: /etc/pam.d/chpasswd-newusers: Permission denied
/etc/pam.d/crond:session    required   pam_loginuid.so
grep: /etc/pam.d/groupadd: Permission denied
grep: /etc/pam.d/groupdel: Permission denied
grep: /etc/pam.d/groupmod: Permission denied
/etc/pam.d/kdm:session    required    pam_loginuid.so
/etc/pam.d/kdm-np:session    required    pam_loginuid.so
/etc/pam.d/login:session    required     pam_loginuid.so
grep: /etc/pam.d/newusers: Permission denied
/etc/pam.d/remote:session    required     pam_loginuid.so
grep: /etc/pam.d/sshd: Permission denied
grep: /etc/pam.d/useradd: Permission denied
grep: /etc/pam.d/userdel: Permission denied
grep: /etc/pam.d/user-group-mod: Permission denied
grep: /etc/pam.d/usermod: Permission denied

[bert@Dell7720Mageia3 ~]$ su
Password: 

[root@Dell7720Mageia3 bert]# grep loginuid /etc/pam.d/*
/etc/pam.d/crond:session    required   pam_loginuid.so
/etc/pam.d/kdm:session    required    pam_loginuid.so
/etc/pam.d/kdm-np:session    required    pam_loginuid.so
/etc/pam.d/login:session    required     pam_loginuid.so
/etc/pam.d/remote:session    required     pam_loginuid.so

[root@Dell7720Mageia3 bert]# rpm -V mageia-kde4-config-common
[root@Dell7720Mageia3 bert]# 

How do I switch to gdm as login manager?
Comment 11 Bert Aerts 2013-04-21 13:00:14 CEST
[root@Dell7720Mageia3 pam.d]# rpm -aq | grep kde4-c
mageia-kde4-config-common-3-0.20130327.3.mga3
Default-kde4-config-3-0.20130327.3.mga3
Comment 12 Colin Guthrie 2013-04-21 13:11:24 CEST
(In reply to Bert Aerts from comment #10)
> [bert@Dell7720Mageia3 ~]$ grep loginuid /etc/pam.d/*
> grep: /etc/pam.d/chage: Permission denied
> grep: /etc/pam.d/chage-chfn-chsh: Permission denied
> grep: /etc/pam.d/chpasswd: Permission denied
> grep: /etc/pam.d/chpasswd-newusers: Permission denied
> /etc/pam.d/crond:session    required   pam_loginuid.so
> grep: /etc/pam.d/groupadd: Permission denied
> grep: /etc/pam.d/groupdel: Permission denied
> grep: /etc/pam.d/groupmod: Permission denied
> /etc/pam.d/kdm:session    required    pam_loginuid.so
> /etc/pam.d/kdm-np:session    required    pam_loginuid.so
> /etc/pam.d/login:session    required     pam_loginuid.so
> grep: /etc/pam.d/newusers: Permission denied
> /etc/pam.d/remote:session    required     pam_loginuid.so
> grep: /etc/pam.d/sshd: Permission denied
> grep: /etc/pam.d/useradd: Permission denied
> grep: /etc/pam.d/userdel: Permission denied
> grep: /etc/pam.d/user-group-mod: Permission denied
> grep: /etc/pam.d/usermod: Permission denied

Expected, hence why I asked for it as root :)

> [bert@Dell7720Mageia3 ~]$ su
> Password: 
> 
> [root@Dell7720Mageia3 bert]# grep loginuid /etc/pam.d/*
> /etc/pam.d/crond:session    required   pam_loginuid.so
> /etc/pam.d/kdm:session    required    pam_loginuid.so
> /etc/pam.d/kdm-np:session    required    pam_loginuid.so
> /etc/pam.d/login:session    required     pam_loginuid.so
> /etc/pam.d/remote:session    required     pam_loginuid.so

Hmm, looks annoyingly OK :(

> How do I switch to gdm as login manager?

"urpmi gdm" and then edit /etc/sysconfig/desktop and set DISPLAYMANAGER=GNOME  (although this will change in mga4)
Comment 13 Bert Aerts 2013-04-21 13:25:32 CEST
[root@Dell7720Mageia3 sysconfig]# cat desktop
DISPLAYMANAGER=GNOME
DESKTOP=KDE4

Restarted PC and KDE starts :-(
Comment 14 Colin Guthrie 2013-04-21 13:37:01 CEST
The code that parses it is in /etc/X11/prefdm. It should work. There is also /etc/X11/lookupdm which resolves the name to a binary e.g. "/etc/X11/lookupdm GNOME" should return /usr/sbin/gdm. If it does not, then the problem lies there. Are you certain gdm is installed?
Comment 15 Bert Aerts 2013-04-21 13:43:02 CEST
[root@Dell7720Mageia3 sysconfig]# /etc/X11/lookupdm GNOME
/usr/sbin/gdm

Yes sure, I installed gdm and its many dependencies...
Comment 16 Colin Guthrie 2013-04-21 14:10:14 CEST
Hmm, I'm confused. This should result in the GNOME login screen being used rather than the KDE one. 

Are you positive you still entered your username/password in the KDM prompt?

One thought: do you have any kind of autologin activated here? (cat /etc/sysconfig/autologin). If so, try disabling it and using a normal login screen (ideally test with both KDM and GDM - I think both should work). autologin is known to behvave incorrectly with PAM sessions - it works but it has these kind of issues. GDM implements it's own autologin that does things properly, but it will only be used if you configure GNOME. I'm not sure if KDM's built in autologin system works properly, but I think it does.
Comment 17 Bert Aerts 2013-04-21 14:23:03 CEST
I tried to unconfigure autologin via KDE System Settings / System Administration / Login Screen / Convenience / unclick Enable Auto-Login.
Root password was requested but autologin was still automatic.

Then I put /etc/sysconfig/autologin to "no" and now I have to login, so autologin is successfully disabled.

AND... issue is SOLVED... root exit no longer disables sound...
Comment 18 Colin Guthrie 2013-04-21 14:54:21 CEST
OK, that's what it was then.

To explain a bit... There are basically three autologin systems... One generic one called "autologin" which can be configured through drak* tools, one for GNOME in GDM and one in KDE in KDM. Each of them work differently and the generic one is the one that doesn't do PAM handling correctly and causes this kind of problem. I'm not 100% sure if the KDE one you configured through KDE System Settings works better, but please do feel free to experiment with it and see. The trick is to ensure that the /etc/sysconfig/autologin file is NOT used for your autologin needs, but rather use the utility of your desktop (KDE or GNOME) which (I hope) do things properly.

Longer term I'd like to kill the autologin package or adapt it to use the same pam handling code as GDM does currently as it's likely the best written.
Comment 19 Bert Aerts 2013-04-21 15:01:43 CEST
Thanks for the explanation.

But let me state clearly that I don't want autologin and did not configure it. Autologin is enabled by default after installation of Mageia 3 beta 4 x86_64 KDE live DVD.

So please adapt installation to unconfigure autologin, for sure the generic one.
Comment 20 Colin Guthrie 2013-04-21 15:03:23 CEST
Oh curious... Yes, this should certainly be done :)
Comment 21 Colin Guthrie 2013-04-21 15:10:42 CEST
I created bug #9817 to track the above.

Depends on: (none) => 9817

Comment 22 Colin Guthrie 2013-04-21 23:38:40 CEST
Ahaha!

I've actually checked this now and I found that the PAM configs for the kdm-np session are wrong in that they emit pam_namespace. Fixing this allows proper session registration in loginctl I have now corrected this in SVN.

http://svnweb.mageia.org/soft?view=revision&revision=7970

So I think even with autologin enabled under KDE, this should still work.

If you want you can re-enable autologin again (using only KDE tools - you still want to make sure /etc/sysconfig/autologin is not used) and set your /etc/pam.d/kdm-np is the same as the file in the above commit and the problem should also be resolved.

Certainly I couldn't reproduce with autologin and su and su -.

CC: (none) => lmenut

Thierry Vignaud 2013-04-23 02:06:22 CEST

Source RPM: (none) => mageia-kde4-config

Comment 23 Luc Menut 2013-04-23 23:19:55 CEST
Thanks Colin, your fix is available in mageia-kde4-config-common-3-0.20130423.1.mga3 just released.

Feel free to reopen if needed.

Status: NEW => RESOLVED
Hardware: x86_64 => All
Resolution: (none) => FIXED

Comment 24 Marja Van Waes 2013-04-24 09:50:13 CEST
I have the same problem on a LXDE install, is there a way to include a similar fix for LXDE?

(boot-nonfree.iso Mga3 install of less than 2 days ago, x86_64, updated)

Status: RESOLVED => REOPENED
CC: (none) => marja11, oliver.bgr
Resolution: FIXED => (none)

Comment 25 Colin Guthrie 2013-04-24 10:03:50 CEST
What is your loginctl output Marja? Are you seeing the little "c" prefix on the session ids too?

If so, can you post your /etc/sysconfig/autologin file in addition ot the loginctl show-session output?
Comment 26 Marja Van Waes 2013-04-24 10:06:51 CEST
Created attachment 3799 [details]
summary screenshot of presumedly unconfigured sound card

I forgot to mention that while installing, in the summary step, the sound card seemed not to be configured and it seemed impossible to get it configured. 
(see attachment)

After install, to my surprise in draksound nothing needed to be configured because my soundcard was correctly detected and all.

The only problem is having to be root in a terminal, to get sound.
Comment 27 Marja Van Waes 2013-04-24 10:10:32 CEST
(In reply to Colin Guthrie from comment #25)
> What is your loginctl output Marja? Are you seeing the little "c" prefix on
> the session ids too?
> 
> If so, can you post your /etc/sysconfig/autologin file in addition ot the
> loginctl show-session output?

[root@DenkBlok2 gebruiker]# loginctl
   SESSION        UID USER             SEAT            
        c1        500 gebruiker        seat0           
         1        500 gebruiker        seat0           

2 sessions listed.
[root@DenkBlok2 gebruiker]# 


/etc/sysconfig/autologin will follow
Comment 28 Marja Van Waes 2013-04-24 10:12:40 CEST
/etc/syscnfig/autologin

AUTOLOGIN=yes
EXEC=/usr/bin/startx.autologin


I never set it to do autologin, and it doesn't autologin
Comment 29 Marja Van Waes 2013-04-24 10:13:40 CEST
[root@DenkBlok2 gebruiker]# loginctl show-session
ControlGroupHierarchy=/user
ResetControllers=cpu
NAutoVTs=6
KillExcludeUsers=root
KillUserProcesses=no
IdleHint=yes
IdleSinceHint=1366789205906536
IdleSinceHintMonotonic=371287060
InhibitDelayMaxUSec=5s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
PreparingForShutdown=no
PreparingForSleep=no
[root@DenkBlok2 gebruiker]#
Comment 30 Colin Guthrie 2013-04-24 10:19:38 CEST
Is your loginctl output after a fresh login or after opening your root terminal?

Can you supply the "loginctl show-session N" output where N is both 1 and c1 (i.e. the values from the SESSION column of "loginctl" output? (i.e. what I asked the original reporter in comment 4)
Comment 31 Marja Van Waes 2013-04-24 10:39:41 CEST
Created attachment 3801 [details]
loginctl show_session's with and without sound

(In reply to Colin Guthrie from comment #30)
> Is your loginctl output after a fresh login or after opening your root
> terminal?

Certainly not after a fresh login and I got it as root. I'll login again if you want a loginctl output from that :-D

> 
> Can you supply the "loginctl show-session N" output where N is both 1 and c1
> (i.e. the values from the SESSION column of "loginctl" output? (i.e. what I
> asked the original reporter in comment 4)

Attaching all 4 of them
Luc Menut 2013-04-24 10:47:26 CEST

CC: lmenut => (none)
Source RPM: mageia-kde4-config => (none)

Comment 32 Marja Van Waes 2013-04-24 10:47:55 CEST
(In reply to Marja van Waes from comment #26)
> Created attachment 3799 [details]
> summary screenshot of presumedly unconfigured sound card
> 
 just saw tv is not in the cc of this bug, cc'ing him

CC: (none) => thierry.vignaud
Source RPM: (none) => mageia-kde4-config

Luc Menut 2013-04-24 10:56:32 CEST

Source RPM: mageia-kde4-config => mageia-kde4-config (fixed), lxde

Colin Guthrie 2013-04-24 11:41:31 CEST

Attachment 3801 mime type: application/octet-stream => text/plain

Comment 33 Colin Guthrie 2013-04-24 11:44:16 CEST
I don't think tv needs to be in this bug. The installer+sound card issue is a different bug (related to sound cards, but this bug is really about sessions and ACLs, it's just that sound output is the thing people often notice when there is a bug in this area).

So I'll remove tv again to stop the spam, but it's probably worth opening a new bug for the sound card bit.
Comment 34 Colin Guthrie 2013-04-24 11:57:01 CEST
I should have clarified m(In reply to Marja van Waes from comment #31)
> > Can you supply the "loginctl show-session N" output where N is both 1 and c1
> > (i.e. the values from the SESSION column of "loginctl" output? (i.e. what I
> > asked the original reporter in comment 4)
> 
> Attaching all 4 of them

I should have clarified that I wanted the output after a fresh boot *before* any su'ing goes on. But I think there is enough to go on there now anyway.

I'll have a look.

CC: thierry.vignaud => (none)

Comment 35 Colin Guthrie 2013-04-24 11:58:19 CEST
Please try the lxdm from updates_testing which fixes it's pam file in the same way as the kdm fixes.
Comment 36 Marja Van Waes 2013-04-24 12:44:23 CEST
(In reply to Colin Guthrie from comment #35)
> Please try the lxdm from updates_testing which fixes it's pam file in the
> same way as the kdm fixes.

It works :-D

Thanks Colin!

(In reply to Colin Guthrie from comment #33)
> 
> So I'll remove tv again to stop the spam, but it's probably worth opening a
> new bug for the sound card bit.

I'll do that when I get back
Comment 37 Colin Guthrie 2013-04-24 12:59:16 CEST
Freeze push requested. Closing again.

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED

Comment 38 Marja Van Waes 2013-09-23 20:39:48 CEST
(In reply to Colin Guthrie from comment #37)
> Freeze push requested. Closing again.

Sorry, Colin, it seems lxdm-0.4.1-14.mga3 was never pushed any further than cauldron core/updates_testing

A forum user now reported the same issue in Mageia 3

https://forums.mageia.org/en/viewtopic.php?f=26&t=6125

So reopening this report.

Since cauldron and Mga 3 have the same lxdm version, I suppose it is valid for both

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)
Summary: Sound system blocked by exiting root terminal (M3 beta 4) => Sound system blocked by exiting root terminal in LXDE
Whiteboard: (none) => MGA3TOO

Comment 39 Manuel Hiebel 2013-09-24 18:14:05 CEST
indeed http://svnweb.mageia.org/packages/cauldron/lxdm/current/SPECS/lxdm.spec?r1=389214&r2=411061

from sophie: 4.1-13.mga3 // core-release (Mga, 3, i586),               core-release (Mga, cauldron, i586)

Keywords: (none) => PATCH
CC: (none) => jani.valimaa
Source RPM: mageia-kde4-config (fixed), lxde => lxde

Comment 40 Marja Van Waes 2013-09-25 14:56:07 CEST
(In reply to Manuel Hiebel from comment #39)
> indeed
> http://svnweb.mageia.org/packages/cauldron/lxdm/current/SPECS/lxdm.
> spec?r1=389214&r2=411061
> 
> from sophie: 4.1-13.mga3 // core-release (Mga, 3, i586),              
> core-release (Mga, cauldron, i586)

assigning to maintainer, even if I know he won't have time.

@ any packager with full commit rights

Please feel free to push Colins fix to cauldron and 3 core/updates_testing

Assignee: bugsquad => oliver.bgr
Source RPM: lxde => lxdm

Comment 41 Marja Van Waes 2013-09-25 17:48:15 CEST
Colin pushed lxdm-0.4.1-14.mga4, so it is fixed in cauldron

He also pushed lxdm-0.4.1-13.1.mga3 to Mageia 3_core/updates_testing.

I asked the forum user who hit this bug to test the package.

Version: Cauldron => 3
Assignee: oliver.bgr => qa-bugs
Whiteboard: MGA3TOO => (none)

Comment 42 Marja Van Waes 2013-09-25 18:03:28 CEST
@ QA team
I tried to write an advisory to save Colin some time. Please complain if I did it wrong!

This update can be tested by playing music while having a terminal opened as root and then closing the terminal. With the old package the music stopped, after which it wouldn't play again as long as there was no terminal session as root.

With the new package the sound should always work

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

Updated lxdm packages Fix pam session registration (pam_namespace should be before system-auth include mga#9799)

========================

Updated packages in core/updates_testing:
========================
lxdm-0.4.1-13.1.mga3.i586.rpm
lxdm-0.4.1-13.1.mga3.x86_64.rpm

Source RPM: 
lxdm-0.4.1-13.1.mga3.src.rpm
Comment 43 Mijzelf 2013-09-28 20:06:35 CEST
I installed lxdm-0.4.1-13.1.mga3 on my system, and after a reboot I could not reproduce the bug anymore. So it seems to be fixed.

My system runs the i586 platform.

CC: (none) => Mijzelf

Comment 44 Manuel Hiebel 2013-09-28 21:16:33 CEST
thanks for your test

Whiteboard: (none) => mga3-32-ok

Comment 45 Marja Van Waes 2013-09-30 19:56:36 CEST
64bits:

installed a fresh Mageia 3 with LXDE only (so with LXDM)
updated
started a stream with vlc, sound was playing
closed a root terminal, video kept on playing without sound

installed lxdm-0.4.1-13.1.mga3.x86_64.rpm and rebooted
started the videostream, sound keeps playing, even when exiting root in a terminal.

No regressions

Whiteboard: mga3-32-ok => mga3-32-ok mga3-64-ok

Comment 46 Dave Hodgins 2013-09-30 20:41:10 CEST
Advisory committed to svn.

Someone from the sysadmin team please push 9799.adv to updates.

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

Comment 47 Thomas Backlund 2013-10-05 19:59:34 CEST
Update pushed:
http://advisories.mageia.org/MGAA-2013-0116.html

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED


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