Solaris 10 archives - Open Source Software and Linux

Open Source Software and Linux:

solaris 10

Feb 6 2009   2:49PM GMT

Solaris 10, ksh and root



Posted by: John Little
solaris 10, ksh, korn shell, bourne shell, /root, default shell, /sbin/sh

Like many people I have the question of, on Solaris 10, can I set the default root shell to ksh. After some study and research apparently it is ok to do this. The default shell for root is /sbin/sh. For those of us that use Linux this is not a symlink to bash but a static binary of the Bourne Shell.

Solaris versions previous to 10 had the Bourne Shell statically linked so that in case of a crash root would have access to a shell. This implies that certain directories were not mounted when booting into a ‘rescue’ mode, namely /usr.

With version 10 of Solaris, Sun has dynamically linked linked the Bourne Shell. This means that it does in fact now use shared libraries. This also implies that since other shells use shared libraries that it is ok to use the shell of your choice.

Sun has also built code into the OS that if for some reason the shell that is designated as the default is not accessible it will fall back to /sbin/sh. This resolves the problem of changing the default shell and still being able to sleep at night. Still experience says this is new and different, do I really want to rely on this new style?

If you are like me, a devout coward regarding such things, then you probably are reluctant to go this route. Because of my cowardice I have reached a compromise that works well, at least for me.

First I created a /root home directory and changed the home directory in /etc/passwd to reflect this. The directory mode is set to 700 and user/group ownership is set to root.

I then copied the contents of /etc/skel, including the hidden file .profile, into root’s home directory. After that I edited the .profile file so that it contains the following:

SHELL=/bin/ksh
export SHELL
HISTFILE=~/.history
HISTSIZE=1000

This gives me a login and working shell of ksh while leaving the default shell in /etc/passwd to /sbin/sh.

hth.

John

Feb 5 2009   5:18PM GMT

Setting the qualified and loghost name for Solaris 10



Posted by: John Little
solaris 10, loghost, unqualified name, qualified name

After installing Solaris 10 for the first time I noticed that I was getting messages on boot referring to the loghost and qualified host name as not resolvable.

After some digging around I came with the solutions to these messages. As so often happens the fix for the problem is quick and simple relative to the time it takes to find the answer

The loghost could not be resolved problem arises from the /etc/inet/hosts file. You simply need to append loghost to the ::1 localhost and 127.0.0.1 localhost entries.

The My unqualified host name (sol10) unknown; sleeping for retry message is resolved by putting the FQDN into the /etc/nodename file:

sol10.home.local

What puzzles me is why this is not setup during the install phase. They do ask for the hostname of the machine which would fix the sendmail problem. Apparently loghost is standard part of the Solaris 10 OS so why not put it in the hosts file when it is created?

You should also be aware that when you open the hosts file it will be read only even if you are root. If you are using vi to edit the file make your edits and close it with :wq!. That way it will be saved without changing the permissions.. Changing default permissions on these files is not a good idea.

-j