Re: How to allow some basic programs to start automatically



On 2006-05-23, blmblm myrealbox.com wrote:
In article <to0ck3-cgp.ln1@xxxxxxxxxxxxxxxxxx>,
Chris F.A. Johnson <cfajohnson@xxxxxxxxx> wrote:
On 2006-05-23, blmblm myrealbox.com wrote:
In article <1148379212.31273.6@xxxxxxxxxxxxxxxxxxxxxx>,
The Natural Philosopher <a@xxx> wrote:

[ snip ]

there is a script file in the users home directory that executes when
the user logs in. I forget what it is called, but it begins with a
dot...put all user specific stuff in there.

Is there? Every shell seems to have its own such file, sometimes more
than one depending on whether the shell is invoked as a "login shell",
but is there something that's read in when one does a graphical login?

If I'm right that there's no such file -- why not? I can imagine
historical reasons -- for example, that it was assumed that any login
would immediately invoke a shell, which would read in user configuration
files, etc., etc. -- but it seems like now it would be a useful thing
to have.

You have to source it explicitly in your .xinitrc (or whichever
file you use).

With all due respect, I don't think you've answered my question(s) --
is there a single file that's always read at login time (as opposed to
when a shell is started, or when a window manager is started), and if
not, why not?

There isn't a single file, because there are different methods of
logging in.

What you've suggested is a way of getting user configuration
information read at X-startup (?) time, and it depends on knowing what
file(s) are read then.

No, I'm talking about logging in via a display manager, such as xdm
or gdm, although the same goes for starting X with startx.

I guess this might depend in part on whether
one is using a graphical login manager, such as gdm or xdm, and if so
what files *it* uses, or logging in in text mode and then starting X.

Exactly.

Browsing through the files in /etc/X11/gdm, I discovered that there
appears to be an option for having a script that's executed at login
time for all users (gdm/PostLogin/Default). Hm! If there's a user
configuration file that's always read during gdm-managed login, though,
I didn't find it. At some point /etc/X11/xdm/Xsession is called, and
it executes .xsession or .Xclients if found, but my guess is that for
most users using GNOME or KDE these won't be there.

So yeah, there are options, but there doesn't seem to be one file that
would be used however one logs in, and I'm wondering why not -- seems
like it would be useful, at least for setting environment variables.
I'm still guessing "historical reasons", but maybe there's a logical
reason too?

There are other things, besides not reading a single configuration
file, that are not done (or may not be done) when logging in
through a display manager. For example, utmp may not be updated,
and who or w may not show users logged in through a display
manager.

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
.



Relevant Pages

  • Re: Login Shell/Profile: Stop the Madness
    ... > Let's start with sensible behavior to the user (before considering ... > It would be sensible if logging in via a display manager included ... > the same shell login initialization that logging in on a virtual ... ssh, etc.) you are just running a login shell, but X is not a shell. ...
    (Debian-User)
  • Re: Login Shell/Profile: Stop the Madness
    ... >> that should be sourced for the shell that the login manager ... > login option of a shell is to say "Hey, I'm logging in, initialize my ... Subsequent shells do not use the login option which is ...
    (Debian-User)
  • Re: Editor With NO Shell Access?
    ... I assume logging in is handled by /usr/bin/login, ... and control is then (i. e. ... to the login shell, which is the program specified in the ...
    (freebsd-questions)
  • Re: Login Shell/Profile: Stop the Madness
    ... > It would be sensible if logging in via a display manager included ... > the same shell login initialization that logging in on a virtual ...
    (Debian-User)
  • Re: Specify shell at ssh login, not appearing in w, who or last output
    ... Thanks for the replies. ... people from logging in this way, rather than giving them the option. ... Is it possible to prevent specifying the shell at login? ...
    (comp.security.ssh)