Re: running scripts when logging in (via X)

From: Sam Watkins (swatkins_at_fastmail.fm)
Date: 11/30/04

  • Next message: Henrique de Moraes Holschuh: "Re: Powerbook produces a lot more heat after kernel upgrade"
    Date: Wed, 1 Dec 2004 02:26:01 +1100
    To: "Mark D. Hansen" <m.hansen23@verizon.net>
    
    

    On Tue, Nov 30, 2004 at 09:04:17AM -0500, Mark D. Hansen wrote:
    > When I reboot my Debian box, the login comes up in an X environment. I
    > notice that my login scripts (e.g., /etc/profile, .bash_profile) do not run.
    >
    > How to I get these scripts to run when I login via X ??

    /etc/profile and ~/.bash_profile are only supposed to run when you first login,
    rather than every time you start a new shell or open a new xterm.

    ~/.bashrc is run every time you start a new shell.

    Are you sure that the display managers like "xdm", "gdm", "kdm" don't run
    /etc/profile or ~/.bash_profile when you login ?

    I tried with xdm, and apparently it _does_ run both of these. I think it's a
    bit weird that it runs ~/.bash_profile! apparently this is because the
    Xsession script is executed using bash.

    I assume that /etc/profile and ~/.bash_profile get run no matter which display
    manager you use since Xsession is common to all of them.

    Perhaps you were expecting the profile scripts to get run every time you open
    an xterm? they don't. Put stuff you want to be run every time you open an
    xterm in ~/.bashrc instead.

    Creating a new "screen" apparently counts as "logging in" - it does run
    /etc/profile and ~/.bash_profile. That seems a bit bogus.

    (in case you don't know what screen is, it's a useful program that prevents
    your terminals / shells dying if X dies, among other things! see "apt-cache
    show screen")

    Sam

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Henrique de Moraes Holschuh: "Re: Powerbook produces a lot more heat after kernel upgrade"

    Relevant Pages

    • RE: Login Shell/Profile: Stop the Madness
      ... correct solution is to alter a few scripts and put some other scripts ... Subject: Login Shell/Profile: Stop the Madness ... >> that should be sourced for the shell that the login manager ... Subsequent shells do not use the login option which is ...
      (Debian-User)
    • Re: Running Nedit from the terminal
      ... which creates a login shell): ... For example 'xterm &' now works from Terminal. ... The point is that a login shell processes your .profile (or ...
      (comp.sys.mac.system)
    • Re: Failure to execute .profile under AIX 5.2
      ... I hate windows. ... Have you tried the '-ls' flag with 'xterm' command? ... shell (in other words, the first character of the ArgumentVector ... indicating to the shell that it should read the user's .login or ...
      (comp.unix.aix)
    • Re: Running Nedit from the terminal
      ... which creates a login shell): ...   export DISPLAY=:0.0 ... For example 'xterm &' now works from Terminal. ... This will cause xterm to run a login shell (equivalent to typing ...
      (comp.sys.mac.system)
    • Re: make installkernel help required. (ANSWER... sort of)
      ... as a "login" shell ... ... try typing "logout" to exit your xterm. ... "not a login shell", then, well, it's not. ... Now, to further support the theory Giorgos has here, Eterm *does* ...
      (freebsd-questions)