• Re: New Debian 12 installation, GUI login doesn't run .profile

    From Chris Green@21:1/5 to Timothy M Butterworth on Sat Oct 26 12:00:01 2024
    Timothy M Butterworth <[email protected]> wrote:
    [-- text/plain, size 0.6K, charset UTF-8, 29 lines, encoding quoted-printable --]

    On Sat, Oct 26, 2024 at 5:20 AM Chris Green <[email protected]> wrote:

    I have installed Debian 12 on my Lenovo Thinkpad T470. It all went
    pretty smoothly but for some reason when I do a GUI login my .profile doesn't get run.

    If I ssh into the laptop then .profile does get run.

    So what might cause this?


    What Desktop Environment are you using?

    Oops, sorry, I should have said. It's XFCE.

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael =?utf-8?B?S2rDtnJsaW5n?=@21:1/5 to All on Sat Oct 26 11:50:01 2024
    On 26 Oct 2024 10:13 +0100, from [email protected] (Chris Green):
    I have installed Debian 12 on my Lenovo Thinkpad T470. It all went
    pretty smoothly but for some reason when I do a GUI login my .profile
    doesn't get run.

    Is starting a GUI session (whether X11/Xorg or Wayland) even
    _supposed_ to execute ~/.profile (or ~/.bash_profile)? My
    understanding is that it is not.

    As I understand it, those are meant to be run by a _login shell_. This
    sets them apart from e.g. ~/.bashrc which is read each time _bash_ is
    started.

    And similarly for the corresponding system-wide files in /etc, of
    course.

    **What problem are you _actually_ trying to solve?** Presumably
    executing ~/.profile on GUI session startup isn't your end goal in
    itself, but merely an attempt at a way to accomplish something else.
    If you tell us what your end goal is, we might be able to suggest a
    better way to accomplish that.

    --
    Michael Kjörling
    🔗 https://michael.kjorling.se

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Green@21:1/5 to All on Sat Oct 26 11:30:01 2024
    I have installed Debian 12 on my Lenovo Thinkpad T470. It all went
    pretty smoothly but for some reason when I do a GUI login my .profile
    doesn't get run.

    If I ssh into the laptop then .profile does get run.

    So what might cause this?

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael =?utf-8?B?S2rDtnJsaW5n?=@21:1/5 to All on Sat Oct 26 13:40:01 2024
    On 26 Oct 2024 12:08 +0100, from [email protected] (Chris Green):
    As I understand it, those are meant to be run by a _login shell_. This
    sets them apart from e.g. ~/.bashrc which is read each time _bash_ is
    started.

    Yes, and entering one's name and password at GUI start-up **is**
    logging in.

    It is _logging in_, but it's not a _login shell_. In this case the
    specific difference matters.

    --
    Michael Kjörling
    🔗 https://michael.kjorling.se

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Green@21:1/5 to [email protected] on Sat Oct 26 13:30:02 2024
    Michael Kjörling <[email protected]> wrote:
    On 26 Oct 2024 10:13 +0100, from [email protected] (Chris Green):
    I have installed Debian 12 on my Lenovo Thinkpad T470. It all went
    pretty smoothly but for some reason when I do a GUI login my .profile doesn't get run.

    Is starting a GUI session (whether X11/Xorg or Wayland) even
    _supposed_ to execute ~/.profile (or ~/.bash_profile)? My
    understanding is that it is not.

    Well on my previous XFCE installation on xubuntu it certainly did run ~/.profile.


    As I understand it, those are meant to be run by a _login shell_. This
    sets them apart from e.g. ~/.bashrc which is read each time _bash_ is started.

    Yes, and entering one's name and password at GUI start-up **is**
    logging in.


    And similarly for the corresponding system-wide files in /etc, of
    course.

    **What problem are you _actually_ trying to solve?** Presumably
    executing ~/.profile on GUI session startup isn't your end goal in
    itself, but merely an attempt at a way to accomplish something else.
    If you tell us what your end goal is, we might be able to suggest a
    better way to accomplish that.

    Setting things like PATH, it needs to be in .profile rather than
    .bashrc because otherwise things get added to PATH repeatedly.

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Chris Green on Sat Oct 26 15:10:01 2024
    On Sat, Oct 26, 2024 at 12:08:31 +0100, Chris Green wrote:
    Michael Kj�rling <[email protected]> wrote:
    On 26 Oct 2024 10:13 +0100, from [email protected] (Chris Green):
    I have installed Debian 12 on my Lenovo Thinkpad T470. It all went pretty smoothly but for some reason when I do a GUI login my .profile doesn't get run.

    Is starting a GUI session (whether X11/Xorg or Wayland) even
    _supposed_ to execute ~/.profile (or ~/.bash_profile)? My
    understanding is that it is not.

    Well on my previous XFCE installation on xubuntu it certainly did run ~/.profile.

    If you want that behavior, the simplest option would be to create
    a ~/.xsessionrc file containing:

    test -r ~/.profile && . ~/.profile

    Make sure there's a space after the "." command.

    ~/.xsessionrc (not to be confused with ~/.xsession) is a Debian-specific
    file that's read by the default Xsession regardless of which display
    manager (or startx) was used to login.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Green@21:1/5 to Max Nikulin on Sat Oct 26 15:20:01 2024
    Max Nikulin <[email protected]> wrote:
    On 26/10/2024 18:08, Chris Green wrote:
    Well on my previous XFCE installation on xubuntu it certainly did run ~/.profile.

    LightDM package in Ubuntu contains an additional script that reads
    ~/.profile (like SDDM in Debian). Some hints:

    - <https://wiki.debian.org/EnvironmentVariables#Using_graphical_display_manager>
    - <https://wiki.debian.org/LightDM#User_configuration>

    Yes, it does seem that there's some disagreement between distros as to
    whether a GUI login should run .profile or not.

    I have just added ~/.xsessionrc which runs .profile, that does what I
    need.

    Thanks all.

    --
    Chris Green
    ·

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)