Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#3729 - rlimits doesn't appear to work

Attached to Project: Arch Linux
Opened by Lou (cmf) - Sunday, 08 January 2006, 13:47 GMT
Last edited by Jan de Groot (JGC) - Monday, 21 July 2008, 06:45 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Tobias Powalowski (tpowa)
Jan de Groot (JGC)
Architecture All
Severity High
Priority Normal
Reported Version None
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No



I'm trying to get realtime audio working for normal users in the 'audio' group. When trying to setup rlimits on my machine it doens't seem to take effect. My user recieves numerous xruns that root doesn't recieve, indicating my user doesn't have realtime capabilities.

* - rtprio 0
* - nice 0
@audio - rtprio 80
@audio - nice -10
@audio - memlock 250000

This is using kernel26 2.6.15-2

Any suggestions/help?


This task depends upon

Closed by  Jan de Groot (JGC)
Monday, 21 July 2008, 06:45 GMT
Reason for closing:  Duplicate
Additional comments about closing:  See  bug 10374 
Please don't reopen very old bugs that are already covered by others.
Comment by Lou (cmf) - Sunday, 08 January 2006, 13:47 GMT
Might i add tis was also the case with 2.6.14
Comment by Judd Vinet (judd) - Monday, 09 January 2006, 19:24 GMT
Hi Lou,

I'm a little stumped by this one. AFAICT, it *should* be working. Neri originally set up the rtprio stuff in PAM, but he's in inter-continental transit right now, so we can't ask him.

For the time being, I've been using this workaround with qjackctl/jackd. I've attached the PKGBUILD.
(application/octet-stream)    PKGBUILD (0.5 KiB)
Comment by Denis A. Altoe Falqueto (denisfalqueto) - Tuesday, 07 March 2006, 13:29 GMT
I was experiencing the same problem too but I made it work. I did the following:

1. In /etc/security/limits.conf, I moved the default rules for the bottom of the file, since the documentation of pam_limits says that the first rule that matches the current user will be used. So, the default (*) must be the last, for the particular cases to be trapped first.

2. I am using KDE, with KDM to login. As the /opt/kde/share/doc/kdm/README says, the default service name that KDM uses when the pam support is active is kde, but in the /etc/pam.d directory there is only a file named kde-np, that instructs kdm to use pam_limits for the session part of the authentication. So, I did, as root:

ln -s /etc/pam.d/kde-np /etc/pam.d/kde

And it worked. The problem is that kdm was not finding the configuration file for PAM and so it couldn't use the pam_limits to change limits for the logged user. The real solution to this is to change the package that owns kde-np (witch is kde-common). Either change the file kde-np to kde or recompile kdm (witch is in kdebase) to read the pam configuration from kde-np.

I deeply hope that this helps to solve this problem.
Comment by arjan timmerman (blaasvis) - Sunday, 26 March 2006, 15:22 GMT
moved to tpowa due to it seems and kde bug.
Comment by Tobias Powalowski (tpowa) - Friday, 07 April 2006, 06:12 GMT
problem is that the provided fix, will enable everyone to login without any password
Comment by Lou (cmf) - Friday, 07 April 2006, 15:56 GMT
Ahh, that's quite a problem, was there another fix which in current kde-common which bypasses this and still works? It's still not working for me and it's rather essential if you want to do audio work.
Comment by Denis A. Altoe Falqueto (denisfalqueto) - Friday, 07 April 2006, 16:08 GMT
Hi. I'm im my job and can't test this right now. But what I meant in the solution was that the login procedure for KDE was not considering the /etc/security/limits. By what I remember, the /etc/pam.d/kde-np file instructs the same things as /etc/pam.d/login. It seems that both load pam_unix2 (I think...) to verify the password. And when I mistype my password, it refuses to login, as I wuold expect.

As I said, I must confirm this first. But I think that it doesn't do this. I am using arch for audio with no problems. Jack is runing in realtime and a lot of others applications run fine, including Ardour, Muse, Hexter, Om-synth and ZynAddSubFx. No problems at all...
Comment by Denis A. Altoe Falqueto (denisfalqueto) - Monday, 10 April 2006, 13:17 GMT
Well, after the tests, I saw that the login in kdm was a big hole... Oh God. And if you look into /etc/pam.d/kde-np you see that it is very different from /etc/pam.d/login, which is the responsible for the pam configuration of the terminal login. So (one more hack doesn't hurt), I softlinked /etc/pam.d/kde to /etc/pam.d/login and it worked. Of course this is not a final solution, but works for me. I'll keep with this until /etc/pam.d/kde-np is fixed for someone with more experience in pam than me.

And for the realtime part of the problem, my /etc/security/limits.conf is like this:

@audio - rtprio 99
@audio - nice -20
@audio - memlock 40000
* - rtprio 0
* - nice 0

And I can use realtime for audio without any problems. Take a note on the rtprio and nice values. I took this from the Linux Audio User list.
Comment by Michal Krenek (Mikos) - Wednesday, 03 May 2006, 12:36 GMT
tpowa: You can simply add this line to the end of /etc/pam.d/kde:
session required

This really should be added to kde-common package.
Comment by Tobias Powalowski (tpowa) - Friday, 26 May 2006, 08:46 GMT
added to kde 3.5.3
Comment by name withheld (Gullible Jones) - Monday, 30 June 2008, 15:41 GMT
No longer fixed. GDM uses as it should, and jack won't run properly; it's possible that a necessary compile option is missing from the kernel, but I'm not sure.