On Sat, 2003-02-15 at 17:44, gabor wrote:
> > Usually this behavior only occurs on a slower machine.  I used to encounter 
> > that on my PIII-800MZ, but now that I'm using an Athlon-XP 1900, I don't see 
> > that behavior.  You can overcome that by giving the X server a negative nice 
> > value before starting something like a kernel compile or a lengthy emerge.
> > 
> > If you would like, I can dig around and locate the script I used to run at 
> > startup from local (requires sudo).
> 
> ok, please locate that script.

Someone posted this attachment ages ago, works nicely for me, and
doesn't require sudo.

-- 
Mike Williams <[EMAIL PROTECTED]>
/* wrapper.c
 * Casey Cain <[EMAIL PROTECTED]>
 *
 * This is a quick hack that starts X with a priority
 * of -10 for increased responsiveness. It should work
 * but it may not :)  There is no warranty or anything.
 * Although I can't see anything possibly going wrong as
 * there's only about 3 lines of code, worst case you
 * have to reinstall X. Basically, you should never run
 * code that you don't understand. That said:
 *
 * To use this program, verify that /usr/X11R6/bin/X is
 * really a symlink to /usr/X11R6/bin/XFree86 (the actual
 * server binary) If not, then change the *app to point to
 * the actual binary.
 * At the console (be careful..no typos):
 *   kill X and anything X-related (ie: xdm, kdm)
 * $  gcc wrapper.c -o XFree86.wrapper
 * $  su
 * $  cp XFree86.wrapper /usr/X11R6/bin
 * $  cd /usr/X11R6/bin
 * $  ls -alk X (make sure its a symlink..if not STOP!!!!)
 * $  rm X
 * $  chown root.root XFree86.wrapper
 * $  chmod u+s XFree86.wrapper
 * $  ln -s XFree86.wrapper X
 * $  exit
 *
 * You should now be able to startx or xdm or whatever.
 * Open an xterm and run 'top'. The process XFree86
 * (which is the server) should be running at nice -10.
 *
 * If not, then make sure the XFree86.wrapper is suid
 * root, executable by all, owned by root, and pointed
 * to by /usr/X11R6/bin/X.
 *
 * To revert is easy.
 * $  su
 * $  cd /usr/X11R6/bin
 * $  rm X
 * $  ln -s XFree86 X
 * $  exit
 */
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>

const char *app = "/usr/X11R6/bin/XFree86";   // the actual binary
const int root = 0;   // root's uid
const int n = -10;    // desired nice priority valid range -20..20.

int main(int argc, char **argv)
{
  seteuid(root);    // The X server must be started as root under any Linux
  nice(n);          // Makes it nice
  execv(app, argv); // This is it!
  /* Should never see this unless *app points to invalid binary */
  fprintf(stderr, "Failed to execv %s with nice value of %d\n", app, n);
  exit(1);
}

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to