This Linux guide is my own notes on Linux, for stuff that I did not like to
documents that I have found on the internet. It is RedHat centric.
CentOS is supposed to be a "rebadged/un-commercialized" version of RHEL, keeping binary-level compatibilities at major release level, thus the discussion should apply equally to CentOS.
HOW-TO
Linux Admin 101
Linux init mode are not "cumulative". So, if default init is 5, script in run level 3 would not be run. If adding a Start script, may want to add them in both in rc3.d and rc5.d, unless it is really only wished to be available at one of the run level and not the other.
Kill script should be placed in rc6.d, which shutdown/reboot scan.
RHEL3 - binary compatible with FC2 (but FC2 is EOL)
RHEL4 - binary compatible with FC3 (and maybe FC4)
Single User Mode
To boot into single user mode for maintenance,
enter "linux single" or "linux emergency" at the LILO boot: prompt.
If using GRUB, then, at the menu for choosing kernel, do:
hit 'e'
then arrow down to the kernel line
hit 'e' again
add 'single' to the end of the line
hit enter
hit 'b' to boot
lather, rinse, repeat
Core dump
Linux kernel panic does not core dump to a file.
it will print output of the kernel core dump result to the stdout device:
a vga screen or a serial console.
To setup serial console, do:
console=ttyS0,115200 console=tty0
but this would mean console boot/shutdown/panic message will no longer
be send to the VGA, but to serial port. VGA may get a spawned
login prompt after OS is up.
Linux "deviation" from Solaris
Some of the most notable things that Linux does rather differently than
Solaris or traditional Unix.
- xinetd
- Gnome/KDE for Display Manager (see XDMCP).
-
64-bit Platforms
RHEL 3.0 and 4.0 maintains simultaneous relese/update levels for 64-bit platforms as their popular 32-bit x86 OS. Just need to get the "special" distro ISO to install on the 64-bit hardware and it will be good to go. Not all the AS/ES/WS flavor maybe available to all platform.
RHEL 4.0
rhel-ia64-as-4 Red Hat Enterprise Linux AS (v. 4 for 64-bit Intel Itanium)
rhel-x86_64-as-4 Red Hat Enterprise Linux AS (v. 4 for 64-bit AMD64/Intel EM64T)
rhel-ppc-as-4 Red Hat Enterprise Linux AS (v. 4 for 64-bit IBM POWER)
rhel-s390-as-4 Red Hat Enterprise Linux AS (v. 4 for 31-bit IBM S/390)
rhel-s390x-as-4 Red Hat Enterprise Linux AS (v. 4 for 64-bit IBM zSeries)
rhel-i386-as-4 Red Hat Enterprise Linux AS (v. 4 for 32-bit x86) [typical intel pentium 4/80x86 release]
rhel-i386-ws-4 Red Hat Enterprise Linux WS (v. 4 for 32-bit x86)
RHEL 3.0
rhel-ia64-as-3 Red Hat Enterprise Linux AS (v. 3 for Itanium)
rhel-x86_64-as-3 Red Hat Enterprise Linux AS (v. 3 for AMD64/Intel EM64T)
rhel-ppc-as-3 Red Hat Enterprise Linux AS (v. 3 for iSeries and pSeries)
Commands for 64-bit info:
ld -V # shows supported emulation for a given machine
# eg: elf_x86_64 elf_i386 i386linux
64-bit and rpm
AMD64 RedHat Linux utilize lots of rpm that has ARCH set to x86_64 (instead of
the traditional i386). rpm -q by default won't tell you. Use something like
rpm -q --qf '%{NAME} %{VERSION} %{RELEASE} (%{ARCH})\n' Package_Name
to see which one you have installed. In 64-bit machines, most of the packages
are x86_64. But quite often you will have a matching package of the same
name, but is i386 ARCH. Some apps don't understand 64bit libs, so these older
libs are sometime needed. There are also some compat libs. My friend Vic says:
* Compatibility Arch Support
Crapload of i386 binaries and libraries that run on x86_64 RedHat systems
* Compatibility Arch Development Support
You'll need some packages in Compatibility Arch Development Support to build
i386 RPMs or compile 32 bit binaries on an x86_64 system.
I find it annoying to install the Compatibility Arch Support group, though.
For instance, let's say you have an x86_64 arch server. You want some i386
compatibility for some random library. Let's say zlib.i386 for whatever
reason. Maybe some 3rd party application needs to run as a 32 bit binary and
requires zlib's /usr/lib/libz.so.1 instead of zlib.x86_64's
/usr/lib64/libz.so.1
You can just install Compatibility Arch Support and not worry about it, or go
back an install zlib.i386 specifically. If you install the whole
Compatibility Arch Support group, you are going to end up with all the
freakin' i386 packages designed to run on x86_64 systems. Which means, you'll
get a lot of crap you don't want to be living on a light weight server. For
instance, kdebase.i386, gnome-blah.i386 and such.
One thing that is very useful to have is firefox.i386 or mozilla.i386 on an
x86_64 system.
Most plugins don't play well with 64-bit browsers.
So, in short -- you can remove what you don't need :)
Initial Setup
Things to keep in mind when installing Linux.
For RHEL 3 and 4, once the OS is installed, additional international language support cannot be added (easily), RH recommends a reinstall. So, if you might need to support any given natural language, install it when you do the system install!
Starting with Fedora Core 4, additional language can be added from system-configure-packages.
Updating Machine
Binary Compatibility
The Linux community embraces the source code, and compatibility between different release is to recompile the code. Binary compatibility is not maintained between different (minor) releases of the glibc. So, be careful not to update the libraries, kernels, and gcc compiler unless you are ready to recompile everything in the system! (And if you have 3rd party libraries dependencies, then really think twice before changing the system library level).
If using up2date for RHEL, it would be safe as only compatible updates are listed in the channel. I would assume the same is true for yum.
(Add chart about system levels, see gmail).
XDMCP
enabling XDMCP will allow program like X Manager to use browser and login via virtual screen,
fully X Manager, Remote Display Manager style, rather than having to login
using ssh and start VNC first. However, VNC is nicer in that
the session stays on the server, XDMCP, if client is a laptop and disconnect,
session will be reset.
Note that botyh XDMCP and VNC are insecure by default!
vi /etc/X11/fs/config
# don't listen to TCP ports by default for security reasons
###no-listen = tcp
### commented out line above to enable XDMCP
service xfs restart
vi /etc/X11/xdm/xdm-config
! SECURITY: do not listen for XDMCP or Chooser requests
! Comment out this line if you want to manage X terminals with xdm
!!!DisplayManager.requestPort: 0
!!!Line above commented out to enable XDMCP
vi /etc/X11/xdm/Xaccess
# * #any host can get a login window
* # have start by itself will allow all host to get login window
vi /etc/X11/gdm/gdm.conf
[xdmcp]
###Enable=false
Enable=true
### XDMCP is enabled using the above clause
### this file need to be updated when GNOME is default windows manager/Display Manager
vi /etc/kde/kdm/kderc
[Xdmcp]
###Enable=false
Enable=true
### XDMCP is enabled using the above clause
### this file need to be updated when KDE is default windows manager/Display Manager
chmod 444 /etc/X11/xdm/Xservers # probably correct already
chmod 755 /etc/X11/xdm/Xsetup_0
older config need to update /etc/X11/XF86Config, but circa 2003
most distro use Xorg,
check /etc/X11/xorg.conf
and ensure FontPath uses Xserver:
FontPath "unix/:7100"
restart X:
- killall gdm-binary # if running GNOME by default
- ctrl+alt+bacckspace # if in front of maching/keyboard
- init 3; init 5 # This may work
- reboot # :)
LDAP
See the
LDAP doc for more details.
authconfig # TUI, select to use ldap, etc.
# upon completion, ldap should work for user login.
# multiple server can be listed using comma separation
# or space separated in /etc/sysconfig/authconfig
/etc/sysconfig/autofs # update BASEDN to define where autofs will look for maps. eg
# BASEDN="ou=us,dc=unixville,dc=com"
service autofs restart # restart autofs to effect the changes
/usr/lib/autofs/autofs-ldap-auto-master # list all known automount maps from ldap
Kickstart
A step-by-step command listing for setting up kickstart,
(hopefully easier to read than Red Hat kickstart instructions,
once it is working, tweaking it is much easier to comprehend).
...
Quick Ref
Connectivity (Network)
mii-tool -vv # determine NIC speed, duplex.
ethtool -i eth0 # list ethernet driver info
Spawn login session on serial port:
echo "7:2345:respawn:/sbin/agetty -h 9600 ttyS0" >> /etc/inittab
echo "8:2345:respawn:/sbin/agetty -h 9600 ttyS1" >> /etc/inittab
above does NOT redirect VGA to console, to do that, use
(nothing will show on VGA output at boot):
[check zambeel notes, TBA]
Hardware related command
lspci # list pci info
Package/Software management
rpm is a basic command to manage software packages, available in just about
every linux distro. up2date is a Red Hat Network moneyware to automatically
download updates and install them. YUM is the freeware version, used by
Fedora (from Yellow Dog distro) and actually better than up2date. But for
those paying money to RH for support, keep to their tool maybe advisible.
rpm -ivh [path/file.rpm] # install rpm, vh = verbose hash for progress monitor
--nodeps # install pkg even if fail dependencies check
--noorder #
for File in `ls -1`; do rpm -ivh --nodeps $File; done
# install all rpm in a dir eg cdrom
# it seems that already installed packages will be overwritten by default
# there is no "force" options needed to overwrite package to redo bad install.
rpm -qa # query for all installed rpm packages in the machine
rpm -qa arch=i386 # same as above, specifying 32-bit binaries
rpm -qa arch=x86_64 # same as above, specifying 64-bit binaries for AMD 64 / Intel EM64T
rpm -qa | grep glibc # query for glibc version
rpm -qpl [rpmfile] # list where are the files installed to.
rpm -ql [pck_name] # query installed package to see where files were send to
# (partial package name will work).
rpm -qi # query info of a specified package.
rpm -qf /path/file # query see which package installed the given file
rpm -e [pck_name] # erase pcka_name as listed in rpm -qa from computer. stop if it break deps
rpm -e [pck_name] --nodeps # forceful erase, even if it breaks dependencies.
-Uvh [pkgname] # Upgrade (erasing old packages, which install don't do)
# h= print hash sign as it goes,
# v = nicely formated output
rpm -Fvh *.rpm # Freshen/update all rpm if an older version is installed
# eg. Refresh from AS 4.0 Update 1 to Update 2 via -F of all the rpm from cd.
-V [pkgname] # Verify integrity of installed package.
rpm -qa --qf '%{NAME} \t\t %{VERSION} \t %{RELEASE} \t %{ARCH}\n'
# display whether a given package is 32-bit i386 or x86_64.
echo "%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}" >> ~/.rpmmacros
# to set the rpm query arch stuff permanently in the rpm query macro
# fedora does something like this by default.
up2date # GUI/CLI program to download patches, need RH registration.
up2date ypbind # ypdate ypbind client package to latest version
#up2date nis # update the nis package to latest version (??)
up2date libstdc++-3.2.3-42 # update a specific rpm
up2date -l # list available downloads
up2date -d # download patches (as per config)
up2date -i # install downloaded patches
up2date --config # run configuration (GUI or TUI), register machine, set exclusion, etc
yum # yellow dog update modified, better rpm updated than up2date
# run cmd by itself will do all update automatically.
# not installed by default in RHEL 4, only in FC.
yum update # can be added to cronjob for auto update
yum list # list avail pkg and version number
yum list autofs # list installed and avail pkg/ver for the pkg autofs
yum info [pkgname] # only display info of avail packages, opt followed by pkg name.
yum install yumex # donwload and install the Yum Extender (GUI) rpm
System Services
chkconfig # Easiest way to manipulate rc services,
# bettter than ntsysv or mangling xinetd file manually!
chkconfig --list xinetd # see if xinetd service is enabled
chkconfig --list rsh # see if specific xinetd service is running, eg rsh
chkconfig --list telnet # see if specific xinetd service is running, eg telnet
chkconfig --list autofs # see if specific xinetd service is running, eg autofs automount
chkconfig --list amd # see if specific xinetd service is running, eg amd automount
chkconfig --add ypbind # register ypbind into service db
chkconfig --level 345 ypbind on # enable ypbind on run level 3,4,5
chkconfig --level 345 rsh on # enable rsh on run level 3,4,5, starting the service now also.
chkconfig --level 35 httpd on # enable httpd in init 3 and 5
chkconfig vsftpd on # enable ftp as xinetd controlled service (level 2,3,4,5)
chkconfig talk off # disable talk as xinetd controlled service (all level)
service iptables stop # temporary stop firewall service (till reboot)
service iptables status # check running status
chkconfig --level 345 iptables stop # disable firewall service from starting on run level 3,4,5
# RHEL 2.1 use ipchains.
for SVC in `ls -1 /etc/xinetd.d`; do chkconfig --list $SVC; done
# see which xinetd service is on or off.
for SVC in `ls -1 /etc/init.d`; do chkconfig --list $SVC; done
# see which init service run when
# but some file are not actually service
serviceconf # GUI, see what service run at what run level.
redhat-config-services # same as above
ntsysv # TUI of serviceconf
iptables
system-config-authconfig # GUI tool to set firewall rules
/etc/sysconfig/iptables... # firewall rule config file
LVM
File System: FS: one ext3 fs on top of a given LV.
Logical: LV: many virtual/logical partitioins on top of a single VG.
Aggregation: VG: volume group, encapsulate many PVs.
Physical: PV: whole disk or partition
system-config-lvm # GUI for LVM. Pretty neat.
lvm # interactive shell for LVM, all cmd avail as stand alone.
pvdisplay # display info such as PV size, PE size, avail PE.
pvcreate /dev/sda2 # create pv on partition, def RHEL 4 setup
pvcreate /dev/sde
vgdisplay # display vol grp info such as lvm/lvm2.
-v # list all LV on the vol group, which PV it uses.
vgcreate VolGroup00 /dev/sda2 # create a new VG, this is the def in RHEL 4 setup.
vgextend
vgreduce
lvscan # brief list of LV and their size.
lvdisplay # show info of all LV: path, LV size, Status, which VG it resides in.
lvdisplay /dev/VolGroup00/LogVol01 # display specific info of a single LV (instead of all LV)
lvcreate -n LogVol00 --size 500M VolGroup00 # create a new LV called LogVol00 of size 100 MB
lvextend -L+100M /dev/VolGroup00/LogVol01 # extend existing LV (hosting swap of fs) by given size
# -L20G would set exact size of 20G
lvremove # remove unused LV
mkfs -j /dev/VolGroup00/LogVol02 # create fs on the LV (-j will use jounal, ie ext3)
# NOTE: old kernel may give error. 2.6.16-1.2069_FC4 works.
mkswap /dev/VolGroup00/LogVol02 # create swap partition on the LV
# Doesn't seems to work, actually confuses kernel to the point that
# all subsequent mkfs command will also be refused. BUG??!!
e2fsadm # extend or reduce fs and LVM1 at the same time
# but not avail with LVM2 (eg FC4, RHEL 4)
ext2online /dev/VolGroup00/LogVol00 # extend ext3 FS online (for LVM 1 or 2)
ext2online / # can use mount point instead of dev path
ext2resize # change ext2 FS after it has been UNMOUNTED. ?? does not exist??
resize2fs /dev/VolGroup00/lv101 1000000 # reduce ext2/ext3 FS to size to exactly 1,000,000 bytes.
# UMOUNT+FSCK FIRST
lvreduce -L1G /dev/VolGroup00/LogVol00 # reduce the LV the FS is on
# (Don't make it smaller than FS size!)
# After these procedure, there maybe some left over space,
# if using ext3, can use ext2online to reclaim the space.
# ext2 somehow can't be re-expanded, use ext3 !!
# use tunefs -j to convert to ext3 :)
/etc/fstab # typically list which LV dev used by which FS
?? # no cmd to display what LV is being used by which FS :(
http://www.redhat.com/magazine/009jul05/features/lvm2/
Kernel
Kernel Compilation
compiling linux kernel
(similar procedure for old 2.4, new 2.4, and 2.6)
download kernel source (srpm, rpm -ivh ...)
Get the version applicaple to the base OS (eg RH 8.0) and kernel similar to the one installed
(latest maybe okay, but then other support may not be available).
[
For ES2.1/RH7.2,
building custom kernel just req getting RPMS packages for:
kernel-headers-2.4.9-e.12 (disk1)
kernel-source-2.4.9-e.12 (disk2)
SRPMS are not needed! Though there are dependencies such as gcc, glibc-dev,
kernel dev, etc, which are RPMS, not Source RPMS!
Files from SRPMS/ are not really needed unless really do heavy dev,
and they do not show up in rpm -qa!
Note that RH does not provide support for customized kernel.
]
cd /usr/src/linux-2.4*
[ use /usr/src/kernels/2.6.11-* for FC4 ]
make menuconfig
this lauches a text menu program to createa config file.
* indicates compiled into kernel
M indicates loadable modules.
make xconfig
# GUI, an alnternate to the TUI menuconfig.
# RHEL 2.1 (RH 7.2) GUI is a big grid
# 2.6 kernel is a tree based GUI with lot of explanations; auto compile when done.
make dep; make bzImage; make modules
make modules_install
#make install # may not be avail.
cp vmlinux... ...
For old machines runing LiLo (RHEL 2.1 and older):
cp /etc/lilo.conf.anaconda /etc/lilo.conf
vi /etc/lilo.conf
/sbin/lilo -v -C /etc/lilo.conf
to install a new boot loader w/ new config into MBR.
For newer machines running Grub (RHEL 3.0/RH 8.0/Fedora):
grub
/etc/grub.conf (link to /boot/grub/grub.conf).
edit of such file doesn't require lilo install, but then need to reactivate grub...
---
From README
- make config : standard kernel compiling config.
- Alternate configuration commands are:
"make menuconfig" Text based color menus, radiolists & dialogs.
"make xconfig" X windows based configuration tool.
"make oldconfig" Default all questions based on the contents of
your existing ./.config file.
Then do:
make bzImage # create compressed kernel image
# files are placed in .../linux/arch/i386/boot/bzImage
make bzdisk # optional, make boot floppy disk.
make modules # needed if anything is in loadable module
make modules_install # suggested to do backup, but not sure where
Upgrading Kernel
Upgrading RH kernel, just need to get the later RPMS, package format kernel-VER.rpm, and install that.
No other packages are needed, and no recompiling needed. It insall a stock RH tested general kernel.
rpm -Uvh new-kernel-ref.rpm
Install stuff like /boot/vmlinux-... vmlinuz-... System.map-... initrd-...
plus lot of files with version number on filename into /lib, etc
The rpm has to be from RH. Changes to /boot/grub/grub.conf may be needed.
Easiest is just to use up2date and let it update kernel also,
then just reboot, it will do all the necesary update and changes.
Kernel Tuning
ipcs -l # display interprocess communication parameters
sysctl main tool to viewing kernel parameters
-a display parameter and its setting.
-w write new value for a given param
-n supress printing of key, just print value.
-p re-read /etc/sysctl.conf and make changes effective immediately
eg:
$ sysctl kernel.threads-max
kernel.threads-max = 20479
$ sysctl -n kernel.shmmax
33554432
$ sysctl -a
...
kernel.tainted = 0
kernel.core_name_format = core
kernel.core_uses_pid = 0
kernel.child-runs-first = 1
kernel.panic = 0
kernel.domainname = brio.com
kernel.hostname = lancer
kernel.version = #1 SMP Tue Feb 11 02:24:10 EST 2003
kernel.osrelease = 2.4.9-e.12smp
kernel.ostype = Linux
fs.aio-max-pinned = 163836
fs.aio-max-size = 131072
...
Alternatively, the kernel params are listed in /proc/sys
and they can be viewed or changed like all the other /proc parameters.
eg:
$ cat /proc/sys/kernel/sem # semaphore :: semmsl semmns semopm semmni
250 32000 32 128
$ cat /proc/sys/kernel/shmmax
33554432
$ cat /proc/sys/kernel/threads-max
20479
$
Changing kernel parameters:
Edit /etc/sysctl.conf for permanent changes that persist thru reboot.
Run sysctl -p to read this file and make changes effective immediately
eg, for ora10g R2 install, add the following to /etc/sysctl.conf
to modify equiv params in /proc/sys/kernel/shmmax and sem:
kernel.shmmax=1036870912
kernel.sem=250 32000 100 128
Or, for one time change:
echo VALUE > /proc/sys/kernel/file
eg:
echo "250 32000 100 128" > /proc/sys/kernel/sem
Kernel Tuning Links
http://www-106.ibm.com/developerworks/linux/library/l-adfly.html?ca=den-wud
describe the major /proc entries in Linux, what they do and stuff.
Oracle 10g install on linux params are described in:
http://www.puschitz.com/InstallingOracle10g.shtml
http://groups.google.com/groups?q=increase+thread+linux&start=10&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=jw98.77j.1%40gated-at.bofh.it&rnum=20
A thread where it seems linux kernel only support 1024 threads.
Changes would be in the config file and recompile kernel.
Info on 2.4
http://www.volano.com/linux.html
Older info, 2.2 kernel.
Info about source file to change to alter kernel param.
SE Linux
Red Hat Enterprise Linux 4.0 ships with an implementation of Security Enhanced Linux.
They use "targeted policy" which only limits functionality to a pre-defined set of deamon processes. The defined set will then have to obey the Mandatory Access Control (MAC) and become more secure even when exploited.
The rest of the process are monitored but are freely allowed to change state, and thus they will operate more like the traditional Discretionary Access Control (DAC).
Overall, enabling SELinux in RHEL 4 is largely safe and don't cause too much headache. A few known places are known to break, such as chroot, dhcp.
Some places it may cause lots of logging. Specific daemons (eg SNMPD) can be excempt from the
SELinux targeted policy via:
A1. Modify the /etc/selinux/targeted/booleans file.
A2. Change snmpd_disable_trans=0 to snmpd_disable_trans=1
A3. reboot your server
-or-
B1. echo "1 1" > /selinux/booleans/snmpd_disable_trans
B2. echo "1" > /selinux/commit_pending_bools
B3. Check that the value in /etc/selinux/targeted/booleans is changed to
snmpd_disable_trans=1
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide/rhlcommon-section-0010.html
Linux Desktop Progies
mtv mpegtv ($10 shareware req reg) for viewing mpeg video. mpegtv.com
mvtp cli of mtv, free.
-z = 2x2 zoom.
-G+10+10 = place window in specified +x+y geometry
mpeg_play bmrc.berkeley.edu mpeg video player. in old a.out (ZMAGIC) binary though.
avail for solaris, etc.
mpegplay mpeg video player found in Knoopix distro.
xine free video player (vcd, dvd, avi, but no mpeg?). http://xinehq.de.
totem alternate front end UI for xine.
mpg123 cli for playing mp3 audio
mpg321 drop in replacement for mpg123
xmms winamp like mp3 player (GUI for mpg123?)
kate KDE editor w/ many extras, like CLI window, mgnt tabs, somewhat like Visual Studio editor
lynx text based web browser
elinks a much better text based browser
BitchX a text based irc client
irssi a newer text based irc client, some cmd same as BitchX
---
fsview # A GUI to see directory/file space usage, kinda interesting.
redhat-logiviewer # GUI tool to parse many diff logs
ethereal is replaced by wireshark
but that only install text-based snooper called /usr/sbin/tshark
older ethereal comes with a gtk+, gnome, kde package.
But those are somehow no longer shipped (by up2date, rpmfind).
Links
Stress test program, to help diag nasty hardware problems:
TBD
# cmd.linux.ref
# some content formerly adapted from cmd.admin.ref.
************************************************************
Red Hat 4.0 (and not available in 3.0)
************************************************************
/usr/sbin/system-config-kickstart kickstart configurator.
system-config-netboot pxe, tftp boot setup
system-config-language GUI language config tooll for the machine
many of these system-config-* had been named redhat-config-* in RH 3.0
************************************************************
Red Hat 9.0 2003/07
Also for RH 3.0 (and presumably available in RH 4.0)
************************************************************
/etc/X11/XF86Config # config file read by X server.
redhat-config-xfree86 # config tool to create XF86Config, try system-config-display in ES 4.0 and later.
redhat-config-* # lot of red hat gui config tool.
nautilus # file explorer
gqview # acdsee like image viewer
hwbrowser # GUI hardware browser, in /usr/bin
************************************************************
Red Hat ES 2.1 (7.2 base)
************************************************************
/usr/sbin/setup # rh version of aix smitty, not all that.
gnorpm # GUI rpm manager, not in 3.0 or 4.0 (/usr/bin)
************************************************************
/etc/sendmail.cf
edit DS line to read
DSsv-smtp.hybridauto.com
and sv-smtp will become the smarthost that will be used to realy all the outbound mail.
linux adding route cmd:
route add default gw 192.168.1.1
route delete -net 172.16.16.0 netmask 255.255.255.0 eth3
route add -net 172.16.16.0 netmask 255.255.255.0 gw 172.16.0.1 eth2
(but going out from first interface)
route add -net 172.16.16.0 netmask 255.255.255.0 gw 172.16.0.1
metric 1 dev eth2
route add -net 172.16.16.0 netmask 255.255.255.0 dev eth3
ypcat (group, passwd)
ypstart # linux
ypbind
ypinit # client, specify machines to bind to
# server, specify whether master or slave
# Often messed up client, "up2date yp" to ensure running latest code with bug fixes.
ypwhich # tell what NIS server machine is bound to.
passwd
yppasswd (obsolete, for combatibility only)
ypcat -k auto.master (-k to display the key name too!)
ypcat -k auto.direct (the direct map, use /-)
/etc/init.d/autofs # most standard automount from auto.master, etc.
# /net need to be enabled by uncommenting entry in /etc/auto.master .
# Some version of autofs (eg RH 4.0) have nasty bug that stale NFS mount
# may result in autofs daemon wanting to erase all files on server,
# at the very least, seen it cause lot of errors in syslog.
/etc/init.d/amd # an alternate for automount for /net/HOST/... paths
# install as up2date am-utils, and enable always start via ntsysv
# amd maybe a bit older than autofs and performance may not be as good.
/etc/rc.d/init.d/
/etc/rc[35].d/ # newer RH system, note that links need exist in 3 and 5
runlevel # what init level machine currently in
who -r # RH 9 and AS 3.0 (cmd exist in Solaris)
/etc/inetd.conf
/etc/xinetd.conf, /etc/xinetd.d/
/etc/printcap or /etc/printer.conf
/etc/motd
/etc/release # see which os cd was used eg sol 8 01/00 for Jan 2000 build.
/etc/resolv.conf # dns setup
/etc/nsswitch.conf # order of search for files/dns/nis
/etc/fstab
du -kxS * = display space usage Summary for only (x) one file sys (ie local)
linux only
du -kl = local disk in solaris?
df -kl = report fs space usage of local fs, solaris and linux
dhclient = get dhcp address from server for current client.
ifconfig hme0 dhcp see purple book.
********************************************************************************
linux:
********************************************************************************
irouted
printtool (red hat print config)
e-conf enlightment configuration
linux-conf most essential config of linux in here
control-panel old red hat panel, configure network, printer, etc
mkswap /dev/hdd3 # def RHEL 2.1 swap dev
mkswap /dev/VolGroup00/LogVol01 # def RHEL 4 swap dev
swapon -s # list swap dev (eg, which LV is swap partion hosted on)
swapon -a # turn on all swap partitions/files
swapoff -a # turn off all swap partitions/files
fdisk /dev/hda
mkfs -t ext3 /dev/hdd2 # create a new fs on ide drive secondary slave.
# probably only create as ext2; then:
tune2fs -j /dev/hda3 # add journaling to it via tune2fs (manual for ext2 in 2.1)
# (probably automatic/default in ext3/as 3.0)
e2label /dev/hda3 [Partition-Label]
view/change label of a partition
used in /etc/fstab LABEL=/label-name for mounting
so that mapping does not have to be maintained in fstab
findfs LABEL=/boot # determine which disk host a given FS with the assigned label.
raven:/usr/local/bin/wshaper traffic shaping and throttle specific connection bandwidth usage.
ntsysv text based UI for enabling service such as telnet/rlogin/vsftp, etc.
Need to have ntsysv-1.3.13.2-0.3.rpm
xterm, use rxvt color scheme, grey on black. MiscFixed font, 8pt.
**************************************************
Linux on HP Intel
HP Smart array rpm eg: hpacucli-7.60-18
part of HP/Compaq ProLiant Support Pack (PSP)
More info:
http://www1.jpn.hp.com/products/software/oe/linux/mainstream/bin/support/doc/general/mgmt/acuxe/v731-1cli/hpacucli-7.31-1.linux.txt
/usr/sbin/hpacucli
=> ctrl all show # list all controller
=> ctrl all show status # show controller info
=> ctrl slot=0 array all show # list all array in a given controller
=> ctrl slot=0 array all show status # array status, an array is a mirror set.
=> ctrl slot=0 array A show # give info and config of a specific array
To find RAID config, simply:
cat /proc/driver/cciss/cciss0
HP System Health Application and Isight Management Agent - hpasm
For Proliant servers eg DL 585
rpm -ivh hpasm-7.6.0-111.rhel3.i386.rpm
hpasm activate # activate and configure SNMP strings, etc
/etc/init.d/hpasm reconfigure # change settings
it create a bunch of cma* process
For command usage, see http://gentoo-wiki.com/HOWTO_Use_Hpasm
"LYS on the outside, LKS in the inside"
"AUHAUH on the outside, LAPPLAPP in the inside"