Quick Guide to Solaris
As an introduction, I must say that I know very little about Solaris, and what I saw so far doesn't make me feel like learning any more than necessary. And I thought Linux was often a bitch to work with on a daily basis... If you want to maintain some kind of sanity, the first thing to do is to download and install the GNU utilities you came to take for granted.
Installing GNU utilities
Aim at http://www.sunfreeware.com/, and download your favorite goodies. If gzip/gunzip is not available on the Solaris box, first unzip those utilities on a Linux box. Once done, download them through an FTP session.
To install those utilies, pkgadd -d myutility. The utilities I downloaded would install all their files in /usr/local/ .
DNS
By default, the Sparc Solaris 7 (2.7) had no /etc/resolv.conf. Here's a sample:
domain acme.com
nameserver 10.0.0.1
nameserver 10.0.0.2
Handling files
Deleting a file through its inode
- cd <directory>
- ls -li | pg
- find . -inum <inode number> -exec rm "{}" ";"
Routing
By default, no route is set up when booting, which means that you cannot connect to any host sitting in a different network. To add a default route, type
route add net 0.0.0.0 10.0.0.1 . To add a specific route, type
route add -net 192.168.1.0 10.0.0.1 -netmask 255.255.255.0 .
To view routes, type route -nr.
To delete any route, just replace add with delete, eg. route delete net 0.0.0.0 10.0.0.1.
Pkg
Summary of pkg* commands:
pkginfo <pkg> - test for presence of package.
pkgadd -d /<cdrom>/Solaris_2.3 <pkg ...>
- add missing packages
pkgrm <pkg ...> - remove packages.
pkgchk -q <pkg> - test for existence of package
pkgchk <options> [pkg] - check installed packages for
integrity.
User Settings
- To set a common PATH, edit /etc/default/login adding eg. PATH=/usr/bin:/usr/local/bin:/usr/local/mysql/bin:.
Note that the export is actually set in /etc/profile through eg. export
PATH
- To set CSH defaults, edit /etc/.login
Q&A
I compiled and installed Bash on a Solaris Sparc 2.6. Where should I add
command aliases?
I tried /etc/profile and /etc/bashrc, to no avail.
Resources
Troubleshooting
I cannot connect to Apache
I downloaded Apache from http://www.sunfreeware.com, installed and launched it, but I cannot connect. Is there some kind of protection?
Killall doesn't work like in Linux
If used with no parameters, it kills all active processes instead of prompting
you for a signal.
Temp stuff
As read in Kurt Seifried's
Solaris 8 - Good and Bad (Great OS, Terrible Defaults)
- Clean out /etc/inetd.conf
- Remove unnecessary scripts in /etc/rcX.d/
- Do not use the admin tool to edit /etc/inet/hosts; Edit this by hand
- Create /root, and edit /etc/passwd to make it root's home directory; Remove left over clutter from /
- /etc/nodename = hostname ; /etc/hostname.dnet0 = IP/hostname for that interface ; /etc/defaultrouter = default gateway IP or name ; /etc/inet/hosts = set it writeable by root (chmod u+w /etc/inet/hosts), and add the hostnames for your local machine and the gateway at a minimum ; /etc/inet/netmasks = local network(s) and netmasks
- Copy /etc/nsswitch.dns over /etc/nsswitch.conf ; Edit /etc/defaultdomain to put the default domainname ; Edit /etc/resolv.conf such as "nameserver 1.2.3.4domain example.orgsearch example.org"