GNU bug report logs - #42600
/etc/profile not being sourced from interactive non-login shell

Previous Next

Package: guix;

Reported by: Kyle Andrews <kyle.c.andrews <at> gmail.com>

Date: Wed, 29 Jul 2020 15:19:02 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42600 in the body.
You can then email your comments to 42600 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#42600; Package guix. (Wed, 29 Jul 2020 15:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kyle Andrews <kyle.c.andrews <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 29 Jul 2020 15:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kyle Andrews <kyle.c.andrews <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: /etc/profile not being sourced from interactive non-login shell
Date: Wed, 29 Jul 2020 11:17:58 -0400
Despite what it says in my ~.bashrc~, if I start a shell from Emacs with
the elisp below, then `guix describe` does not work:

  (let ((default-directory "/ssh:me <at> remote:/home/me"))
      (shell "*shell<remote>*"))

Of course, if I start a shell normally with ~M-x shell~ in Emacs, then
type out the ssh command, ~/etc/profile~ does get sourced.

I learned about this by following the advice of nckx from IRC, placing
`set -x` in my .bash_profile. Following the former routine in Emacs I
see nothing, but with the explicit ssh call I do see all the commands
echo'd.

Is this a bug in Guix or Emacs? In other words, should the Bash
configuration files be extended to handle this case? I thought my system
might be broken, but nckx showed me that I could just `. /etc/profile`
and then guix describe started working again.

Best Regards,
Kyle





Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Thu, 14 Jul 2022 02:53:02 GMT) Full text and rfc822 format available.

Notification sent to Kyle Andrews <kyle.c.andrews <at> gmail.com>:
bug acknowledged by developer. (Thu, 14 Jul 2022 02:53:02 GMT) Full text and rfc822 format available.

Message #10 received at 42600-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Kyle Andrews <kyle.c.andrews <at> gmail.com>
Cc: 42600-done <at> debbugs.gnu.org
Subject: Re: bug#42600: /etc/profile not being sourced from interactive
 non-login shell
Date: Wed, 13 Jul 2022 22:52:06 -0400
Hello Kyle,

Kyle Andrews <kyle.c.andrews <at> gmail.com> writes:

> Despite what it says in my ~.bashrc~, if I start a shell from Emacs with
> the elisp below, then `guix describe` does not work:
>
>   (let ((default-directory "/ssh:me <at> remote:/home/me"))
>       (shell "*shell<remote>*"))

It works for me:

/ssh:raisin:/home/mcournoyer/ #$ guix describe
  guix 598f728
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: 598f7289db9955584457ffc11c8504f3938a1618

The remote machine is a Guix System though.  If it as something else, it
could be more tricky, as then the shell used may not be Bash *compiled
with a non-default option* [0] to source ~/.bashrc on SSH connections.

[0]  https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/bash.scm#n109

To force interactive mode, you could also use 'ssh remote bash -l'.
I've also written script with the shebang:

#/usr/bin/env -S bash -l

This works where 'env' is new enough to accept -S.  Useful in Jenkins
shell snippets for example.

Anyway, I hope that helps.  I don't see a bug here.

Closing.

Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 11 Aug 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 229 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.