Re: how to run root cmds when starting xorg?

2007-02-27 Thread Kirk Strauser
On Saturday 24 February 2007 17:24, [EMAIL PROTECTED] wrote:
 how do i exec a kldload script when starting ttyv8 kdm (or xorg) ?

Another idea not yet mentioned is to create two wrapper scripts like so:

$ cat /usr/local/bin/loadsound
#!/bin/sh
kldload whatever.ko
$ cat /usr/local/bin/unloadsound
#!/bin/sh
kldunload whatever.ko

and the install sudo and configure it to give your user the ability to run 
those two commands without entering your password.  Finally, add sudo 
loadsound and sudo unloadsound to your startup and exit scripts.
-- 
Kirk Strauser


pgpWUVdbZQYd0.pgp
Description: PGP signature


Re: how to run root cmds when starting xorg?

2007-02-25 Thread Norberto Meijome
On Sun, 25 Feb 2007 00:24:49 +0100
[EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED]
 To: freebsd-questions@freebsd.org
 Subject: how to run root cmds when starting xorg?
 Date: Sun, 25 Feb 2007 00:24:49 +0100
 Sender: [EMAIL PROTECTED]
 User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
 
 how do i exec a kldload script when starting ttyv8 kdm (or xorg) ?

modify the xorg or kdm  startup script? 

why do you need such thing?

_
{Beto|Norberto|Numard} Meijome

The greater danger for most of us is not that our aim is too high and we miss
it. But that it is too low... and we reach it.
   Michelangelo (1475-1564)

I speak for myself, not my employer. Contents may be hot. Slippery when wet.
Reading disclaimers makes you go blind. Writing them is worse. You have been
Warned.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: how to run root cmds when starting xorg?

2007-02-25 Thread deeptech71

Norberto Meijome wrote:

On Sun, 25 Feb 2007 00:24:49 +0100
[EMAIL PROTECTED] wrote:


From: [EMAIL PROTECTED]
To: freebsd-questions@freebsd.org
Subject: how to run root cmds when starting xorg?
Date: Sun, 25 Feb 2007 00:24:49 +0100
Sender: [EMAIL PROTECTED]
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)

how do i exec a kldload script when starting ttyv8 kdm (or xorg) ?


modify the xorg or kdm  startup script? 


Xorg's xinitrc is a user script. Or does one of the X server or client thing 
start as root? If so, which script runs? xinitrc didnt work..

./kdm -nodaemon: exactly which one (if any) executed as root?


why do you need such thing?


I want to load sound support only when in a desktop environment, and 
auto-disable it when moving back to a console. That is, I need a script that 
loads sound when starting, and unloads when exiting kdm.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: how to run root cmds when starting xorg?

2007-02-25 Thread Tore Lund
[EMAIL PROTECTED] wrote:
 Norberto Meijome wrote:
 On Sun, 25 Feb 2007 00:24:49 +0100
 [EMAIL PROTECTED] wrote:

 From: [EMAIL PROTECTED]
 To: freebsd-questions@freebsd.org
 Subject: how to run root cmds when starting xorg?
 Date: Sun, 25 Feb 2007 00:24:49 +0100
 Sender: [EMAIL PROTECTED]
 User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)

 how do i exec a kldload script when starting ttyv8 kdm (or xorg) ?
 modify the xorg or kdm  startup script? 
 
 Xorg's xinitrc is a user script. Or does one of the X server or client thing 
 start as root? If so, which script runs? xinitrc didnt work..
 ./kdm -nodaemon: exactly which one (if any) executed as root?

The startup script is /usr/X11R6/lib/X11/xdm/Xsetup_0.  You may also
want to have a look at /usr/X11R6/lib/X11/xdm/Xsession.  This latter
file will call up ~/.xsession, which is where we normally put commands
at the beginning of an X session called up through xdm.  What I do in
that file is to call nvidia-settings and display a background image.  I
guess ~/.xsession is the right place to put a kldload - this file may be
simply a symlink to .xinitrc (if the setup you want is in this file).

 why do you need such thing?
 
 I want to load sound support only when in a desktop environment, and 
 auto-disable it when moving back to a console. That is, I need a script that 
 loads sound when starting, and unloads when exiting kdm.

Okay, when you revert to the console, /usr/X11R6/lib/X11/xdm/Xreset may
be the right place to put a kldunload.  Or maybe you could use
GiveConsole and TakeConsole (in the same directory) to accomplish these
tasks.  I hope more expert users will chime in with more information
about the difference between these various command files.

Have a look at man xdm as well as /usr/X11R6/lib/X11/xdm/xdm-config.

For some reason, not many users appear to use xdm.  The majority
apparently prefer kdm or gdm or just .xinitrc.  I find that odd myself.
-- 
Tore


___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: how to run root cmds when starting xorg?

2007-02-25 Thread Tore Lund
Tore Lund wrote:
 The startup script is /usr/X11R6/lib/X11/xdm/Xsetup_0.  You may also
 want to have a look at /usr/X11R6/lib/X11/xdm/Xsession.  This latter
 file will call up ~/.xsession, which is where we normally put commands
 at the beginning of an X session called up through xdm.  What I do in
 that file is to call nvidia-settings and display a background image.  I
 guess ~/.xsession is the right place to put a kldload - this file may be
 simply a symlink to .xinitrc (if the setup you want is in this file).

Correction:  The file where I call nvidia-settings and display a
background image is /usr/X11R6/lib/X11/xdm/Xsetup_0.
-- 
Tore

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


how to run root cmds when starting xorg?

2007-02-24 Thread deeptech71

how do i exec a kldload script when starting ttyv8 kdm (or xorg) ?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]