Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: A list for linux audio users <linux-audio-user@...>, <paul@...>
Date: Thursday, February 16, 2006 - 8:07 am

On Wed, Feb 15, 2006 at 09:47:00PM -0500, Ross Vandegrift wrote:

Experiment is done. rlimits properly inherit with set_rlimits.
Granting RT privileges to any program I run is easy and transparent:

1) I added a line to set_rlimits.conf allowing anyone in the group
audio to run my window manager with RT abilities:
@audio /usr/local/enlightenment/bin/enlightenment nice=-1 rtprio=80 memlock=67108864

2) I changed my .xsession to run the window manager with set_rlimits:
exec /usr/local/bin/set_rlimits -k /usr/local/enlightenment/bin/enlightenment

The -k to set_rlimits is an option I added to continue even if
realtime privileges cannot be setup. I did this so if I ever take
myself out of the audio group, I will still be able to login to my
Xsession. Patch is below.

It's now just a bit more work to take the patch set_rlimits and edit
the system-wide display manager to invoke any users session with
set_rlimits. Then, any user can take advantage of this without
modifying their config files.

diff -ur set_rlimits-1.2.0/set_rlimits.c set_rlimits/set_rlimits.c
--- set_rlimits-1.2.0/set_rlimits.c 2005-12-20 06:37:35.000000000 -0500
+++ set_rlimits/set_rlimits.c 2006-02-16 02:04:34.000000000 -0500
@@ -98,6 +98,7 @@

signed int debug = 0;
signed int verbose = 0;
+signed int cont = 0;

/* rlimits for process */
Rlimits rlimits = {
@@ -123,6 +124,7 @@
"Available options:\n"
" -d Turn on additional debugging output.\n"
" -h Display this help message.\n"
+ " -k Continue running program even if there's an error.\n"
" -n[=] Set nice limit to . Values 0 to 39 equate to nice\n"
" levels 19 to -20 respectively.\n"
" -r[=] Set realtime priority limit to . Max available is\n"
@@ -216,6 +218,9 @@
debug = 1;
break;
case 'h': err = -1; break;
+ case 'k':
+ cont = 1;
+ break;
case 'v':
if (argv[i][2]!=0)
err = -1;
@@ -632,10 +637,14 @@
return -1;
}
/* No matching entry - permission denied */
- if (!match) {
+ if (!match && !cont) {
fprintf(stderr,"set_rlimits: no permission to run %s with elevated resource limits\n",
*exec_path);
return 0;
+ } else if (!match && cont) {
+ fprintf(stderr,"set_rlimits: no permission to run %s with elevated resource limits\n",
+ *exec_path);
+ fprintf(stderr,"set_rlimits: continuing anyway, as requested...\n");
}

if (debug) {

--
Ross Vandegrift
ross@lug.udel.edu

"The good Christian should beware of mathematicians, and all those who
make empty prophecies. The danger already exists that the mathematicians
have made a covenant with the devil to darken the spirit and to confine
man in the bonds of Hell."
--St. Augustine, De Genesi ad Litteram, Book II, xviii, 37

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R, , Kjetil S. Matheussen, (Sun Feb 12, 10:45 pm)
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,, Frank Barknecht, (Mon Feb 13, 9:04 am)
[linux-audio-user] Newbie alert. Realtime knowledge stuff, Jonty Needham, (Mon Feb 13, 3:30 pm)
Re: [linux-audio-user] Newbie alert. Realtime knowledge stuff, Ismael Valladolid Torres, (Mon Feb 13, 9:39 pm)
Re: [linux-audio-user] Newbie alert. Realtime knowledge stuff, Frank Barknecht, (Mon Feb 13, 10:56 pm)
Re: [linux-audio-user] Newbie alert. Realtime knowledge stuff, Ismael Valladolid Torres, (Thu Feb 16, 4:22 pm)
Re: [linux-audio-user] Newbie alert. Realtime knowledge stuff, Cesare Marilungo, (Mon Feb 13, 4:09 pm)
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,, fons adriaensen, (Mon Feb 13, 1:37 am)
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,, Ross Vandegrift, (Tue Feb 14, 2:04 am)
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,, Ross Vandegrift, (Wed Feb 15, 5:49 am)
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,, Ross Vandegrift, (Thu Feb 16, 2:47 am)
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,, Ross Vandegrift, (Thu Feb 16, 8:07 am)
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,, Frank Barknecht, (Wed Feb 15, 9:32 pm)
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,, Florian Schmidt, (Wed Feb 15, 9:51 pm)
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,, Frank Barknecht, (Thu Feb 16, 4:14 pm)
Re: [linux-audio-user] 2.6.15.4, realtime-lsm, jackd -R,, Frank Barknecht, (Tue Feb 14, 10:15 am)