From owner-freebsd-questions@FreeBSD.ORG Mon Feb 26 00:04:09 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 33E2216A401 for ; Mon, 26 Feb 2007 00:04:09 +0000 (UTC) (envelope-from toreld@netscape.net) Received: from mail43.e.nsc.no (mail43.e.nsc.no [193.213.115.43]) by mx1.freebsd.org (Postfix) with ESMTP id C735B13C48D for ; Mon, 26 Feb 2007 00:04:08 +0000 (UTC) (envelope-from toreld@netscape.net) Received: from [62.16.181.21] (062016181021.customer.alfanett.no [62.16.181.21]) (authenticated bits=0) by mail43.nsc.no (8.13.8/8.13.5) with ESMTP id l1Q0462c002677 for ; Mon, 26 Feb 2007 01:04:07 +0100 (CET) Message-ID: <45E22386.4090606@netscape.net> Date: Mon, 26 Feb 2007 01:02:14 +0100 From: Tore Lund User-Agent: Thunderbird 1.5.0.9 (X11/20061228) MIME-Version: 1.0 CC: freebsd-questions@freebsd.org References: <45E0C941.2030203@gmail.com> <20070226094300.5f40b710@localhost> <45E21B90.7060102@gmail.com> In-Reply-To: <45E21B90.7060102@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: how to run root cmds when starting xorg? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Feb 2007 00:04:09 -0000 "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