Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
generating an nsswitch.conf file where none exists[SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
mikefot
l33t
l33t


Joined: 19 Nov 2014
Posts: 680

PostPosted: Fri May 01, 2020 10:06 am    Post subject: generating an nsswitch.conf file where none exists[SOLVED] Reply with quote

Dear All,

I am running gentoo amd64 stable on an old hp laptop.

I am having difficulty connecting to some gentoo mirrors to fetch packages.

I think the dns function is impaired at present.

I noticed that I do not have an nsswitch.conf file.

Suggestions on running a command will generate one would be appreciated.

Regards

Michael Fothergill


Last edited by mikefot on Sun May 03, 2020 6:43 am; edited 1 time in total
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1184
Location: Italy

PostPosted: Fri May 01, 2020 10:48 am    Post subject: Reply with quote

/etc/nsswitch.conf belongs to sys-libs/glibc on my system. So I guess you can re-emerge that package in order to re-generate the file.

In alternative, here you are my (unmodified) nsswitch.conf file from my system:
Code:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
#

passwd:         db files
group:          db files
initgroups:     db [SUCCESS=continue] files
shadow:         db files
gshadow:        files

hosts:          files dns
networks:       files dns

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       db files
Back to top
View user's profile Send private message
mikefot
l33t
l33t


Joined: 19 Nov 2014
Posts: 680

PostPosted: Fri May 01, 2020 11:12 am    Post subject: Reply with quote

Many thanks for your response.

I created an nsswitch file using your template.

I then tried to emerge glibc.

The build.log file is here:

https://paste.debian.net/1144123/

The output of

Code:
emerge --info '=sys-libs/glibc-2.29-r8::gentoo'


is here

https://paste.debian.net/1144124/

Comments appreciated

Regards

MF
Back to top
View user's profile Send private message
mike155
Advocate
Advocate


Joined: 17 Sep 2010
Posts: 2439
Location: Frankfurt, Germany

PostPosted: Fri May 01, 2020 6:14 pm    Post subject: Reply with quote

User 'portage' was deleted from '/etc/passwd' and '/etc/group'????

How could that happen?

The output you posted tells you how you can restore that user:
Code:
portage: 'portage' user or group missing.
         For the defaults, line 1 goes into passwd, and 2 into group.
         portage:x:250:250:portage:/var/tmp/portage:/bin/false
         portage::250:portage

But I'm afraid that much more has been destroyed on your machine... Please tell us what you have done!
Back to top
View user's profile Send private message
mikefot
l33t
l33t


Joined: 19 Nov 2014
Posts: 680

PostPosted: Sat May 02, 2020 3:19 pm    Post subject: Reply with quote

Many thanks for your response.

I fixed my system by moving to the
Code:
/
directory and installing the
Code:
stage3 tarball
again on top of the existing install.

It created me a
Code:
glibc
and
Code:
binutils
binary that got me going again.

I managed to save the install and get rid of the portage errors and other dependency problems.

I have made the deep world update run correctly along with perl-cleaner --all....

I also reinstalled
Code:
xorg-server
.

What is odd is that when I try to log in either as user or root after I input the password
nothing happens....

I just get the login prompt appearing again and an error message saying
Code:
login incorrect
.

What could cause that to occur?

Cheers

MF

PS

I think I have figured out what the problem could be.

I deleted the
Code:
USE
entry in my
Code:
make.conf
by mistake.

I need to have
Code:
elogind
in there.

I have added it in and am now doing a world update.

Cheers

MF


Last edited by mikefot on Sat May 02, 2020 4:12 pm; edited 2 times in total
Back to top
View user's profile Send private message
fturco
Veteran
Veteran


Joined: 08 Dec 2010
Posts: 1184
Location: Italy

PostPosted: Sat May 02, 2020 4:08 pm    Post subject: Reply with quote

Is your unprivileged user listed in /etc/passwd?
You may also try resetting passwords with the passwd command after chroot'ing with a live CD.
Back to top
View user's profile Send private message
mikefot
l33t
l33t


Joined: 19 Nov 2014
Posts: 680

PostPosted: Sat May 02, 2020 4:10 pm    Post subject: Reply with quote

Many thanks for your response and suggestion.

I can make a livecd quite easily for gentoo.

I will try this out after fixing the USE flag omission.

Cheers

MF

PS

Since the original problem of the nsswitch.conf file is now fixed I am going to declare the problem solved and
move the discussion about the login problem to the Desktop Environments section of the forum.

I have got my user account and password working and can login to
Code:
lightdm
and
Code:
lxde
which I have now installed.

I cannot login to root properly yet.

I will create a new post on the desktop section about this.

Many thanks for the all the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum