LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   2 bash related questions (https://www.linuxquestions.org/questions/slackware-14/2-bash-related-questions-556601/)

mobilemonkey 05-25-2007 06:50 AM

2 bash related questions
 
hello,
my first and most immediate problem is when i try and log into the root account i get the funny little message but no prompt, then the system hangs for about 30 seconds and kicks me back to the login prompt (im positive i am entering the correct login info for root). however i can log in to a normal user account. some other useful information my be that i have been editing the '~.xinitrc' file.

my second problem is with that normal user account. i have created '~.bashrc' and '~.bash_profile' in the home folder and added commands to them. however, when i log into the account, it seems it is still reading the global '/etc/profile' (i have tested this by changing the user prompt line of the '/etc/profile'). again, i have been editing the '.xinitrc' file (for this account), which i actually transfered over from the root accounts home folder, but i have given everyone RWX permissions to the file.

as you can see im in a bit of a mess, any help is appreciated.

druuna 05-25-2007 06:58 AM

Hi,

1) What 'funny little message' are you getting?

2) /etc/profile is 'always' read, creating a ~/.bashrc and/or ~/.bashr_profile are there to create/change some local (private for that user) settings. See man bash (the INVOCATION part) for details.

mobilemonkey 05-25-2007 07:49 AM

the messages are right after logging in, alot of them are quotes by famous people, id like to be able to switch this off too ;)

i have a line in my '~.bash_profile' ('source ~.bashrc') which then (should) execute all the commands in the .bashrc file, which includes a custom prompt string command, but it doesnt seem to work, although i have had this working in the past :confused:

MS3FGX 05-25-2007 07:53 AM

I assumed that he meant the fortune message, which would indicate that he did successfully log in, the system just failed to give him a usable prompt.

I have always used .bash_profile under Slackware, never .bashrc. You might want to try just using bash_profile to load your user-specific settings. As for the xinitrc file, that shouldn't have anything to do with the current problems you are having since obviously that is a component of X. It shouldn't even be read when you are logging into the console.

H_TeXMeX_H 05-25-2007 12:19 PM

Dunno how to fix whatever has been messed up, but to uninstall fortune, 'removepkg' the bsd-games package.

dive 05-25-2007 01:17 PM

Quote:

Originally Posted by mobilemonkey
i have a line in my '~.bash_profile' ('source ~.bashrc')

Don't know if it's a typo but you should have 'source ~/.bashrc' or '. ~/.bashrc'

simcox1 05-25-2007 01:28 PM

If you don't want the fortune messages, just do:

chmod -x /etc/profile.d/bds-games-login-fortune.sh

'removepkg bsdgames' is a bit ott and not necessary.

H_TeXMeX_H 05-25-2007 01:53 PM

Unless, of course, you don't play any of the BSD games, it which case you just save some space.

mobilemonkey 05-25-2007 02:09 PM

thanks for your suggestions everyone :)

i *think* ive worked it out. when i log into the root account and type 'echo $SHELL' i get '/bin/bash'. when i log into a normal user account and type 'echo $SHELL' i get '/bin/sh', which indicates the shell is the BOURNE shell. and so may not look at the '.bash_profile' on login ??. how would i set the bash shell as the default shell for normal users?

sn9ke_eyes 05-25-2007 05:36 PM

to modify an existing user you can use the command

usermod -s /bin/bash username

or edit /etc/passwd to make the change for users there

I'm not sure how to set it as the default when you are creating a user, but you can specify it with useradd just like usermod.

mobilemonkey 05-25-2007 06:28 PM

sn9ke_eyes, i edited the '/etc/passwd' file and put '/bin/bash' at the end of the users line. now everytime i log in as that user i get bash as my default login shell, and subsequent shells, and now the commands in the '.bash_profile' and the '.bashrc' are being read and executed, so everything works. thanks again :)


All times are GMT -5. The time now is 09:39 AM.