how do I continue when it logs me out and says : Changing privileges (su) : Now running as user 'lfs' ???

Asked by Don Clermont

Hello,
Thank you for the lfscripts .. nice initiative !
I have a problem though !
After I have launch the lfscript as root
it got to a point where it says :

"Changing priviledges (su) : Now running as user 'lfs'

and it stopped the build process at the prompt :

lfs:~$

NB. I was installing the lfs 6.8 by using your script ... how do i pickup where It stopped !

thank you !

Question information

Language:
English Edit question
Status:
Solved
For:
LFScript Edit question
Assignee:
No assignee Edit question
Solved by:
Don Clermont
Solved:
Last query:
Last reply:
Revision history for this message
Marcel van den Boer (synthehol) said :
#1

Hmm... LFScript should not drop to a prompt. Can you give me some info about your host system? Have you made sure the LFS host system requirements are met (http://www.linuxfromscratch.org/lfs/view/stable/prologue/hostreqs.html)?

Revision history for this message
Don Clermont (don-clermont) said :
#2

All LFS 6.8 requirements are met ! I am using OpenSuse 11.4 ( running XFCE desktop ) as host in an IBM Pentium 4 Intel 2.8 ghz with 512 M Ram. However, I have already used the same system and build LFS on it before ! I wanted to try the lfscript ! .. before doing so ... I have deleted the lfs user and use a new formated 40 gig partition ext on my HD. The swap used is the same as the host ( 1.1 gig)!
Right before the script stopped !
I had the following msgs in RED background:
ln: failed to create symbolic link '/tools' : file exists
UNEXPECTED ERROR OCCURED
A command stopped with exit status : 1
Press 'CTRL+C' to abort, or 'ENTER' to continue...
( i press ENTER )
groupadd: Group 'lfs' already exists.
UNEXPECTED ERROR OCCURED
A command stopped with exit status : 9
Press 'CTRL+C' to abort, or 'ENTER' to continue...
( i press ENTER )
useradd: Warning : home directory already exists, not modifying it.
Changing privileges (su) : Now running as user 'lfs'
( and the process stops with the prompt lfs:~$ )

that's it !

Revision history for this message
Don Clermont (don-clermont) said :
#3

(ext3 instead of ext )

Revision history for this message
Robert Xu (bravoall1552) said :
#4

You did not clean your SuSE system from your previous run.

Revision history for this message
Marcel van den Boer (synthehol) said :
#5

Robert is right. Normally, if you use LFScript it will set up and restore the environment for you, but because you have some stuff left over from an earlier LFS build, you need to manually restore your system state before running LFScript again:

First of all, reboot your system. This will remove any ties LFS and/or LFScript may have made with your host system during the build.

Then, properly remove the 'lfs' user. You may have removed the 'lfs' user earlier, but the errors you got indicate the 'lfs' group and home directory still exist.
Run (as root, or with sudo) 'groupdel lfs' and 'rm -rf /home/lfs' to solve this.

Also, the '/tools' directory still exists from your previous build.
Run (as root, or with sudo) 'rm -rf /tools' to solve this.

I'm not sure if '/sources' still exists on your system (your error messages do not mention it), but if it does you need to remove that too ('rm -rf /sources').

You may also have a folder called 'builddir.###.tmp' in the LFScript directory, as you probably not have quit LFScript properly (because you dropped to a shell). You can remove that too.

Revision history for this message
Don Clermont (don-clermont) said :
#6

I have done what you have asked .. but now .. I have lost the usage of my root !

When I do "su" I get a msg telling me :

/usr/bin/chroot: failed to run command '/tools/bin/env' : no such file or directory

in order words ... I can no longer have access to the root user !

I succeeded in deleting the various file by typing in " sudo " and the command .. but besides that I cannot access to the root user

it seems the bash path for the root user is corrupted now .. and I cannot change it !

( I have access to yast within xfce in Opensuse though ... but I still cannot change the Bash path for the root user ! )

??????

can you please assist me on that one !

Revision history for this message
Marcel van den Boer (synthehol) said :
#7

Can you post the results of the following two commands:

sudo cat /root/.bash_profile
sudo cat /root/.bashrc

Revision history for this message
Don Clermont (don-clermont) said :
#8

donald@linux-6vfa:~> sudo cat /root/.bash_profile
root's password:
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash

-------------------------

donald@linux-6vfa:~> sudo cat /root/.bashrc
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
LFS_TGT=$(uname -m)-lfs-linux-gnu
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL LFS_TGT PATH
/sources/buildmgr/buildmgr --resumebasebuild
exit
donald@linux-6vfa:~>

Revision history for this message
Don Clermont (don-clermont) said :
#9

I was wondering .... shouldn't I simply delete these 2 hidden files in the root folder ??? ... they don't seem to exist on my other computer running the same OpenSuse but with KDE ! I type the same command you suggested and I got : no such file or directory msg ... ??? ... bizarre ... !!! .. in my other computer ... I only have the file .bash_history in my root directory ... but not .bashrc nor .bash_profile

thx for the tip ! ... I will wait for your input before I proceed with a deletion or a rename of these 2 files !??

Revision history for this message
Robert Xu (bravoall1552) said :
#10

No, .bashrc and .bash_profile are system files that bash uses. I have these system files on openSUSE, and on several other computers too..

Revision history for this message
Don Clermont (don-clermont) said :
#11

I renamed them from .bashrc to .old_bashrc and from .bash_profile to .old_bash_profile

and bingo .... I got access back to my root account ...

thx .. you are a real prince !

Revision history for this message
Robert Xu (bravoall1552) said :
#12

If you can find the old copies of .bashrc and .bash_profile, you may want to place them back, just in case.

Revision history for this message
Marcel van den Boer (synthehol) said :
#13

Well, you already figured it out. But for those who read this later and might still wonder about those two files I mentioned; The contents of those two files I asked you to post should have gone into the .bash_profile and .bashrc of the 'lfs' user. However, because there were some problems with the 'lfs' user (which LFScript reported, but you chose to continue), LFScript put them in the root users account.

So, deleting them is perfectly okay (they only make sense while running LFScript). You might want to check the /etc/skel directory on your suse system, as it may hold a copy of the original files, which you may choose to restore.

Finally, two pieces of advice:
1. If an unexpected error occurs; Abort, don't continue. Your problem is a perfect example of what can go wrong if you just continue.
2. If you are new with LFS/LFScript, run it in a virtual machine. This will protect your system from any harm at all.

Good luck.

Revision history for this message
Manish Thatte (manishjagdishthatte) said :
#14

Same problem I faced yesterday.