Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Feb 2007 01:02:14 +0100
From:      Tore Lund <toreld@netscape.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: how to run root cmds when starting xorg?
Message-ID:  <45E22386.4090606@netscape.net>
In-Reply-To: <45E21B90.7060102@gmail.com>
References:  <45E0C941.2030203@gmail.com> <20070226094300.5f40b710@localhost> <45E21B90.7060102@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"deeptech71@gmail.com wrote:
> Norberto Meijome wrote:
>> On Sun, 25 Feb 2007 00:24:49 +0100
>> deeptech71@gmail.com wrote:
>>
>>> From: deeptech71@gmail.com
>>> To: freebsd-questions@freebsd.org
>>> Subject: how to run root cmds when starting xorg?
>>> Date: Sun, 25 Feb 2007 00:24:49 +0100
>>> Sender: owner-freebsd-questions@freebsd.org
>>> 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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45E22386.4090606>