Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - bash problems: (5 Items)
   
bash problems  
I managed to get this working well enough to compile bash.  However there are a couple things I would like to figure out
 how to do.

It appears to work well enough and understand the it has to add bash to /etc/shells, etc.  I would also like to have it 
create a link (I am using a hard link) between /etc/profile.d/qnxsdk.sh and /etc/profile.d/qnxsdk.bash so that I get all
 the envars and path's I need to actually use bash as my shell.

This unfortunately isn't enough - and I know I have figured this out before, but can't recall what I did.  The problem 
is bash doesn't honor, or is not started correctly by photon so that it is a login shell.  This means it doesn't run my 
.profile and doesn't get the commands to read in the above mentioned /etc/profile.d/qnxsdk.bash.

I am sure there is a quick fix to this but I can't recall what it is.  Anyone know?

Thanks,
Rick..
Re: bash problems  
> I managed to get this working well enough to compile bash.  However there are 
> a couple things I would like to figure out how to do.
> 
> It appears to work well enough and understand the it has to add bash to /etc/
> shells, etc.  I would also like to have it create a link (I am using a hard 
> link) between /etc/profile.d/qnxsdk.sh and /etc/profile.d/qnxsdk.bash so that 
> I get all the envars and path's I need to actually use bash as my shell.

I can think of 2 ways.

Modify the shells/bash/Makefile, to have a "post-install" target, do the link you want there. (Wrap it with a .if $
{OPSYS} == "QNX", look at the textproc/groff/Makefile).

Or, create a PLIST.qnx and modify Makefile to have it use PLIST.qnx to install? (not quite sure).

> This unfortunately isn't enough - and I know I have figured this out before, 
> but can't recall what I did.  The problem is bash doesn't honor, or is not 
> started correctly by photon so that it is a login shell.  This means it 
> doesn't run my .profile and doesn't get the commands to read in the above 
> mentioned /etc/profile.d/qnxsdk.bash.
> 
> I am sure there is a quick fix to this but I can't recall what it is.  Anyone 
> know?

Note sure about this one. I will have a look...

-xtang

RE: bash problems  
 

> -----Original Message-----
> From: Rick Duff [mailto:rgduff@gmail.com] 
> Sent: September 25, 2007 11:12 AM
> To: general-pkgsrc
> Subject: bash problems
> 
> I managed to get this working well enough to compile bash.  
> However there are a couple things I would like to figure out 
> how to do.
> 
> It appears to work well enough and understand the it has to 
> add bash to /etc/shells, etc.  I would also like to have it 
> create a link (I am using a hard link) between 
> /etc/profile.d/qnxsdk.sh and /etc/profile.d/qnxsdk.bash so 
> that I get all the envars and path's I need to actually use 
> bash as my shell.
> 
> This unfortunately isn't enough - and I know I have figured 
> this out before, but can't recall what I did.  The problem is 
> bash doesn't honor, or is not started correctly by photon so 
> that it is a login shell.  This means it doesn't run my 
> .profile and doesn't get the commands to read in the above 
> mentioned /etc/profile.d/qnxsdk.bash.
> 
> I am sure there is a quick fix to this but I can't recall 
> what it is.  Anyone know?

Part of this may be related to the sillyness that is in the 
/etc/profile startup file that sources files in /etc/profile.d/
with an extension mapping the shell type.

This is what gives you your QNX_HOST/TARGET environment variables
for example.  You can see this problem if you change your shell
from /bin/sh to /bin/ksh .. all of a sudden the "default" environment
dissapears.

Hope this helps,
 Thomas
Re: bash problems  
> This unfortunately isn't enough - and I know I have figured this out before, 
> but can't recall what I did.  The problem is bash doesn't honor, or is not 
> started correctly by photon so that it is a login shell.  This means it 
> doesn't run my .profile and doesn't get the commands to read in the above 
> mentioned /etc/profile.d/qnxsdk.bash.
> 
> I am sure there is a quick fix to this but I can't recall what it is.  Anyone 
> know?

I took a look. 

phlogin is looking 2 places for paramaters. $HOME/.ph/login/shells/$SHELL and then /etc/photon/login/shells/$SHELL

So if you create a $HOME/.ph/login/shells/bash, with one line in it:

bash --login

Things should be fine.

Interesting enough, we do ship a /etc/photon/login/bash, which is in wrong place. (it has to be login/shells/bash). I 
did this on my system to make it work (this sounds like an install bug)

# cd /etc/photon/login
# ln -sf . shells

And now everyone use bash in the system should got the profile.bash in there login.

Hope this helpful.

-xtang

Re: bash problems  
I have modified the bash package in HEAD, that during post-install, it will create the above 2 files.