# can't login after portmaster -a



## kvi (Jan 6, 2011)

Hi,

I decided to update my installed ports, so what I did was:


```
csup -L ports-supfile
```

After it was completed, I did this:


```
portmaster -L
```

And after that I used command:


```
portmaster -a
```

What happened is that it shutdown my dhcpd so my computer lost it's IP-address and kikked me out. I was running the update inside a screen, so it should still be going on. However, when I try to login to the computer, I get this error message:


```
/libexec/ld-elf.so.1: Shared object "libintl.so.8" not found, required by "bash"
```

I cannot login using ssh, telnet or directly from the keyboard. I can login using ftp, but I don't have root access with ftp. 

Does anyone have any way of helping me? I tried logging in as root from the keyboard, but seems also root uses bash, so no help there.


----------



## SirDice (Jan 6, 2011)

Never change root's shell!

You're pretty screwed now. You need to boot to single user mode and change root's shell back to /bin/csh before you can do anything else.


----------



## kvi (Jan 6, 2011)

Phew... that was a lesson learned. 

Thanks for the help! Lucky for me, pressing power-button started a managed poweroff for the box and once it had halted, I got it to boot into single user mode. I changed root-shell to /bin/sh, as single user -mode gave that as default shell. Or is /bin/csh a better choise? 

I started the portmaster -a again and it's now updating the ports again. I guess that should do the trick once it finishes? From now on, I promise to keep root shell as default and I will always keep a password for root instead of starring it out with vipw


----------



## SirDice (Jan 6, 2011)

kvi said:
			
		

> I changed root-shell to /bin/sh, as single user -mode gave that as default shell. Or is /bin/csh a better choise?


/bin/csh is root's shell by default. It's also a lot easier to use then /bin/sh.



> I started the portmaster -a again and it's now updating the ports again. I guess that should do the trick once it finishes? From now on, I promise to keep root shell as default and I will always keep a password for root instead of starring it out with vipw



Before doing any kind of upgrade/update be sure to read /usr/ports/UPDATING. Issues like these are preventable if you follow the correct procedures.


----------



## kvi (Jan 6, 2011)

I know I should read that file (and I have reviewed it). However, I don't really get much out from the file, because those libwpd etc. don't tell me much. (I guess my error was that). 

However, I thank you for all the help. I changed the root's shell to csh and keep it that way. It's not often I need to use root and I usually just run commands with sudo, so the root shell is not that important. As long as it just can be used for logging in...


----------



## SirDice (Jan 6, 2011)

kvi said:
			
		

> However, I don't really get much out from the file, because those libwpd etc. don't tell me much. (I guess my error was that).


The error you had is related to devel/gettext (which installs libintl).


----------



## kvi (Jan 6, 2011)

portmaster finally finished updating all my installed ports, but I still wasn't able to login using bash. I did what you wrote in another topic and made a symlink:


```
cd /usr/local/lib
ln -s libintl.so.9 libintl.so.8
```

And now I can login. I hope all the applications are now running normally :/


----------



## SirDice (Jan 6, 2011)

kvi said:
			
		

> I did what you wrote in another topic and made a symlink:


Errr... No. I always advise against doing just that. It's a really bad habit and it will bite you in the rear during a next upgrade cycle.

The real solution is to rebuild bash. And for good measure everything else that depends on gettext.


----------



## anomie (Jan 6, 2011)

kvi said:
			
		

> Does anyone have any way of helping me? I tried logging in as root from the keyboard, but seems also root uses bash, so no help there.



If the (now defunct, deleted) old bsdforums archives were readily available, I could point you to a painful thread where I did precisely the same thing. ]
[*] Keep root's shell as something living in /bin (i.e. the / filesystem, _and_ part of the FreeBSD base system, as opposed to from Ports) - agreed. 
[*] Also have an unprivileged, wheel-member administrative account using something under /bin - I recommend tcsh(1). (Or whatever.) 
[/list]

As you know, root logins over ssh are disabled by default. If/when you don't have physical access to the host, you're going to want an administrative account with a shell that's significantly unlikely to break.


----------



## kvi (Jan 6, 2011)

Let me continue asking stupid questions than. I can now login to the box, so atleast it's easier to work on it. 

Should I delete the symlink before doing this rebuilding operation? And how exactly do I rebuild everything that depends on gettext? If I just run 
	
	



```
portmaster devel/gettext
```
 to update gettext and how do I see what ports depend on it? (what ports need to be rebuild). I can't seem to find the solution with google...


----------



## kvi (Jan 6, 2011)

Nice tip anomie!

I added a backup-account to all my FreeBSD boxes (especially those I have no physical access) and added those accounts to sudoers file and made /bin/csh their default shell. Hopefully I'll have less problems like this in the future  everyday you learn new things!


----------



## wblock@ (Jan 6, 2011)

kvi said:
			
		

> Let me continue asking stupid questions than. I can now login to the box, so atleast it's easier to work on it.
> 
> Should I delete the symlink before doing this rebuilding operation? And how exactly do I rebuild everything that depends on gettext? If I just run
> 
> ...



Always, yes always, check /usr/ports/UPDATING before updating.  The entry that applies to this problem is 20100530.


----------



## kvi (Jan 6, 2011)

Yeah. It's easy to tell that now. But it's quite a long list to read to find something that goes that long way back. Especially when I just made a successfull portmaster -a on another box a few days ago. And like I said earlier: even now that you show me the correct entry, it really doesn't tell me much as I have no idea what that devel/gettext is in the first place. However, I guess I knew I had it installed...


----------



## wblock@ (Jan 6, 2011)

Upgrading FreeBSD Ports may be helpful as a general overview.  It uses portupgrade instead of portmaster, but if you squint and hold your head sideways they're kind of the same.


----------



## kvi (Jan 6, 2011)

I guess they should be pretty much the same. However, I consider myself as quite a newbie to these ports-tools (and in many other things aswell). I now removed the symlink I created earlier and tried the 
	
	



```
portmaster -w -r gettext
```

It didn't want to run the command and complained about bash3 being "DEPRECATED". So, my solution: 
	
	



```
cd /usr/ports/shells/bash3
make deinstall
```

and after that the portmaster -w -r gettext started nicely. It also listed all the applications/ports pkg_info gettext-0.18.1.1 listed, so I guess it should now rebuild all nicely. And after it's done, I guess I can continue building shells/bash for my personal use.


----------



## jb_fvwm2 (Jan 6, 2011)

Another way to deal with the gettext issue, easier than symlinks
maybe, is copy the libintl.so.(old) (and another one) to /usr/local/lib/compat, then upgrade gettext.  Bash should still find the old
.so. file in that /compat/ location, newer ports finding the newer one. Then (maybe at buildworld at least) delete the older /compat/ file. ( Method seems to work anyway, someone may de-suggest it...)


----------

