'nice' attribute for executable files
Hi all,
recently i had to run some program (xmms) with lowered nice value as normal user. to do that i had to su to the root account and then execute nice --5 xmms. but, then xmms was run as root and X server refused connection, so i had to do second su from root account. (total: su nice --5 su wixor xmms). what's more, i thought that entering root password each time i want to run something with lowered nice is rather boring. furthermore, on many systems root may want to make users able to run some program with lowered nice, but not from root account and without having to know the root password... i've found a way to do this using shell scripts combined with suid bit and strange fils ownerships, but it is absolute diseaster.
so i thought that it would be nice to add an attribute to file (changable only for root) that would modify nice value of process when it starts. if there is one byte free in ext2/3 file metadata, maybe it could be used for that? i think that it woundn't be more dangerous than setuid bit.
Does it all make any sense?
thanks for responses
--
wixor
May the Source be with you
Quoted 5 lines · Wiktor
Hi all,
recently i had to run some program (xmms) with lowered nice value as normal user. to do that i had to su to the root account and then execute nice --5 xmms.
Let me guess, the sound skips unless you run at a low nice value. That's bad design on the part of XMMS.
nice is the wrong way to handle RT constraints. You need a proper design (ie multithreaded).
See JACK for an example of how to do it right.
Or, since you don't need low latency, use a bigger buffer.
Proper handling of RT constraints has been discussed to death on LKML and other lists (executive summary: almost no one does it right. mplayer is one of the most egregious offenders).
Lee
Quoted 1 line · Wiktor
so i thought that it would be nice to add an attribute to file (changable only for root) that would modify nice value of process when it starts. if there is one byte free in ext2/3 file metadata, maybe it could be used for that? i think that it woundn't be more dangerous than setuid bit.
Given that setuid is possibly the most misused (no I didn't say overused) features around, that's hardly a recommendation. That said, have you looked at capabilities?
Signature · 3 lines
-bill davidsen ([email protected]) "The secret to procrastination is to put things off until the last possible moment - but no longer" -me
Quoted 4 lines · Wiktor
Hi all,
recently i had to run some program (xmms) with lowered nice value as normal user.
See the new nice rlimit in recent -mm. This allows you to give various users permission to raise priorities without root privileges.
Signature · 1 line
Mathematics is the supreme nostalgia of our time.