Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I've got a game on my system that suffers some minor performance problems. I can make these go away by using renice to take it to priority -1. I am root, so doing this isn't a problem for me (just annoying), but I do have another two users who would love to play the game properly, but can't unless I do a quick su and renice their game.
So, I'm looking for a way that I can get them to run something without root having to interfere. My instincts are to create a wrapper script that they can run, but I don't know how to get it to do the job.
I've played with sudo, but don't want to grant them permission to run renice at any time, and I had a look at chmod +s, but I think that would make them run the game as root (definitely don't want that!).
>What game is it, and how does reniceing by 1 level fix it
Game is Neverwinter Nights. There's a slight jerkiness when starting to rotate the "camera", when opening/closing some of the panels and when there's a lot of activity on screen. The jerkiness goes away with a small renice for the first two issues, and the number of moving objects on screen can double before there's any loss of performance.
Checking top when the game is running is a dead giveaway - it's constantly vying with all the other nice 0 processes. Renicing stops this, without seeming to affect any other process.
>You should not have to alter the priority.
Nope, but it works!
>Particularly by any large amounts.
Hence only one point. I've locked up machines before by misusing renice, so I keep it to a minimum. The game starts at 0 and we renice it to -1.
>Something else will be penalized, and you ought to try to find out what it is.
Well, yes, everything with priority 0 to 20. But this machine is a desktop, for single user use, and when playing, we're not interested in any other process that is running, so it doesn't really matter.
>If you punch a process into better-than-normal priority, sometimes it depends upon some other process that runs at normal-priority and things start to clog up.
Good point - nwn does use the sound and GUI processes, which continue at normal priority, but renicing doesn't affect the game. I will have a look at the process tree when running it later, to see what it is spawning
Why not allow them to sudo and ONLY perform 'renice -n -1 `pidof PROCESS`'. You might not be able to put that directly into the sudoers file, and may need to place it in a script... but then allow them to sudo that script. Or better, create a script that launches the game through nice. 'nice -n -1 su $USER -c GAME'.