Date: Sat, 28 Sep 2013 00:14:59 +0200 From: Jilles Tjoelker <jilles@stack.nl> To: sbruno@freebsd.org Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: Re: Trying to use /bin/sh Message-ID: <20130927221459.GA27990@stack.nl> In-Reply-To: <1380309632.84323.3.camel@localhost> References: <1380309632.84323.3.camel@localhost>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Sep 27, 2013 at 12:20:32PM -0700, Sean Bruno wrote: > I was attempting to simply set my EDITOR env variable for use on my > system today and discovered that I do *not* understand how computers > work. > After realizing that I simply do not understand what's going on, I broke > down and put an "echo test" into /etc/profile and ~/.profile. > I can't see why, but logging in via xdm/xfce4 isn't doing any of the > normal login things and nothing in my .profile is ever executed by any > shell, ever. > None of these get executed unless its a login shell. xfce4 doesn't seem > to pick these up when starting up, so I have no idea what to do. > For now, I've put the needed things into a .bashrc and switched my > loging shell to bash, which is not really what I wanted to do. sh's model of startup files (only login shells use startup files with fixed names, other interactive shells only use $ENV) assumes that every session will load /etc/profile and ~/.profile at some point. This includes graphical sessions. The ENV file typically contains only shell options, aliases, function definitions and unexported variables but no environment variables. Some graphical environments actually source shell startup files like ~/.profile when logging in. I remember this from CDE for example. It is important to have some rule where this should happen to avoid doing it twice or never in "strange" configurations. As a workaround, I made ~/.xsession a script interpreted by my login shell and source some startup files. A problem here is that different login shells have incompatible startup files. A different direction is to accept that the environment variables in the X session will be incorrect and make all xterms start login shells (e.g. xterm -ls). You may also be able to use setenv in ~/.login_conf. -- Jilles Tjoelker
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130927221459.GA27990>