Xsession.d and tpb

Marius Gedminas marius at pov.lt
Tue Feb 15 23:38:42 UTC 2005


On Tue, Feb 15, 2005 at 04:53:56PM +0100, Tomas Krag wrote:
> I'm running Warty on an IBM X31, and am mostly extremely satisfied with
> almost everything.
> I installed the thinkpad button package (tpb) and it adds a script
> /etc/X11/Xsession.d/90tpb
> which looks as if it should start the tpd daemon on starting X. 

Not exactly.  X session scripts are executed when a user logs in into X.

> However, after booting a quick os -aux |grep tpb 
> shows tpb is not running.

There can be two reasons for this:

1. tpb needs /dev/nvram and fails to start up if that device is not available.
   /dev/nvram appears only when you modproble the nvram module, which is
   not done by default.

     echo nvram >> /etc/modules

   should fix the problem.

2. Xsession.d scripts are run with user (not root) privileges, so you
   need to have access to /dev/nvram.

     sudo adduser (yourusername) nvram

   should fix the problem.

> If I run "sudo tpb -d" from a terminal or from
> the gnome-sessions it works.

From this I assume (2) is the case.

> There are other files in /etc/X11/Xsession.d/ that also do not seem to be
> run. 
> What is the idea with Xsession.d ?

If you feel like studying how X logins work, start at /etc/gdm/Xsession
and look what is executed and when.  Its very educational.

> If these files do not run, what would be the ideal place to start a
> program that needs to be run as root? /etc/init.d/ ?

In general, yes, but this only applies to programs that do not interact
with X.

HTH,
Marius Gedminas
-- 
Shift happens.
		-- Doppler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050216/59f6dbc5/attachment.sig>


More information about the ubuntu-users mailing list