RHCE study notes

2006年11月12日 23点37分 没有评论

Chkconfig: maintain /etc/rc.d directory structure, add, remove change serivce, list time stamp information. Check the state of particular service.
# chkconfig –list sendmail
# chkconfig –level 4 sendmail off

The “ntsysv” command takes the functionality of chkconfig and wraps it into an easy-to-use screen interface.

kdbconfig: set the type of keyboard, refer to “/etc/sysconfig/keyboard”
timeconfig: set time zone, refer to “/etc/sysconfig/clock”
mouseconfi: set mouse, refer to “/etc/sysconfig/mouse”
sndconfig: screen-oriented interface to make install sound card.

NT boot, NT’s loader installs to the master boot record(MBR) and relies on three major files: ntdetect.com, ntldr, boot.ini.

Once you have a working LILO boot disk, you can simply copy the boot sector from the disk instead of the harddriver,eg:
# dd if=/dev/fd0 of=/bootsect1n1 bs=512 count=1
I think the first 512 byte in /dev/fd0 may record the boot information.

RAID: Only three are implemented in Linux, linear,0,1,5
You can assign additional disks from failover, called spare disks within the RAID set, when one disk fails it is marked as bad and the data is reconstructed on the first space disk, which is used as replacement, resulting in litter or no downtime. When using fdisk to format RAID component disks, the Partition ID must be set as “FD”.
# mk2fs -b 4096 -R stride=8 /dev/md0

To check what interrupts you are using:
# cat /proc/interrrupts
i386 PC have up to 15 usable interrupts out of 16: 0-15

To get a list of IO address and DMA channels used:
# cat /proc/ioports

To check DMA resources:
# cat /proc/dma

To load modules into kernel:
# modprobe sb irq=5 io=0x220 dma=0
comment, here “sb” means sound device.

Laptops have a special peripheral interface bus called PCMCIA, that requires a special set of drivers and service to handle it. Whenever a card is loaded, you can check the “/var/run/stab”. To see waht setting your card is set to, you can issue the “cardctl” command.

Advanced Power Management(APM)
When the BIOS tells the daemon about a pending suspend or a standbycall, it immediately calls sync(and writes all cached file system information to disk immediatelly). It will then sleep for two seconds and tell BIOS to continute.

# runlevel
5 3
means, you were in level 5 last and are now in level 3.

LCD: Liquid Crystal Display

To have the kernel dynamically load and unload modules as needed, a special kernel thread, “kmod” is called upon to control the loading and unloading of modules. Refer to “/etc/modules.conf”.

To load modules on command line:
# depmod -a
# modproble eth0
Place modules in “modules.conf” to have them automatic loaded.

Two limits manage disk consumption:
1. Limit the number fo inodes a user may have;
2. Limit the number of disk blocks a user’s file may consume

Quota are enabled on a file system basis only, they CAN NOT be set on directories.

分类: 科技 标签:

NetVault

2006年11月7日 20点42分 没有评论

NetVault is used to backup data. The SNAZ system has been updated from NetVault 7.4 to latest NetVault 7.4.3. thus supports backup and restore ACL and Extended Attributes.I am verifing this new function these days.

First, in SNAZ operating system, start up backup service. Create a large volume as virtual harddisk for backup and restore. and then create other shares and files with assigning ACL and EAs. Second step, install NetVault GUI management software in Windows platform(or Linux), configure the SNAZ as NetVault server: Addministrator-Domain, select SNAZ; Device-Management-Server-Selection, select SNAZ, Add-Add Standalone Driver, and create virtual disk(right click) on precious large volume(Driver location-/exports/large_volume). Now, could run Backup and Restore.

Extended file attributes:
Permission, records of creation and modification times, author of a document, character encoding of a plain-text document, or a checksum. There are four name spaces: user,trusted,security and system.

Attr:(Add, remove and print)
set or add extended attribute to file/folder:
# attr -s attrname -V attr_value pathname(file/folder name)
print/show extended attribute of file/folder:
# attr -g attrname pathname(file/folder name)
remove identified attribute:
# attr -r attrname pathname(file/folder name)

getfattr -d: print file/folder’s EA entries.

According to NetVault supporting max 64KB EAs, how to create a pure 64K test file?
#!/bin/bash
# create 64KB EA file
for ((i=0;i<=524288;i++)) do printf "i"; done This script will create a 64KB test file, with 524288 "i" characters. But when I tried to used this output file in the following commands: # attr -s Club -V `cat 64KB_file_name` /exports/barcelona There will be an error messages: argument list too long. I had to assign EA one by one: # !/bin/bash # assign EA one by one for ((i=0;i<=524388;i++)) do attr -s Team_$i -V i /exports/barcelona done It would be added successful, but issue "getfattr -d /export/barcelona" still meet "Argument list too long" errors. I'll fixed this issue tomorrow.

分类: 科技 标签:

Preparing for RHCE

2006年11月6日 21点07分 没有评论

Keep on reading Study Guide.

分类: 科技 标签:

Summary (Three months in Plasmon)

2006年10月31日 21点32分 没有评论

I have been working in Plasmon for three months. During these days, I tried to know the SNAZ system and the architecture of Plasmon.com. The important jobs are building LAT, install Iplanet, install OpenLDAP+SSL and did some performance testing on these platforms. Though sometimes it was hardly time, keep on researching and looking up in Internet, query, or join email group. Everything would be resolved.

I feel I’ve learned much in this new team. The next target, for me, is RHCE. I plan to accomplish this certificated test in about January or Febrary,2007.

分类: 科技 标签:

/etc/fstab & mount options

2006年10月22日 15点59分 没有评论

Information about the local and remotely mounted file systems is stored in/etc/fstab. Each file system is described on a separate line. Each line is composed of multiple fields, each separated by spaces or tabs. When your system boots, it processes each file system in the order listed.

A sample /etc/fstab might look like the following:

/dev/hda1 / ext2 defaults 1 1
/dev/hda2 swap swap defaults 0 0
/dev/hda5 /usr ext2 defaults 1 2
/dev/hda7 /tmp ext2 defaults 1 2
/dev/hda8 /var ext2 defaults 1 2
/dev/hda9 /home ext2 defaults 1 2
/dev/hdc /cdrom iso9660 ro,noauto,user 0 0
none /proc proc defaults 0 0

Field Name Description
——————————-
fs_spec: Describes the block device or remote file system to be mounted.
fs_file: Describes the mount point (the directory the file system will be mounted as). For swap partitions, this should be “none.”
fs_vfstype: Describes the file system type. Valid file system types are minix, ext, ext2, xiafs, msdos, hpfs, iso9660, nfs, and swap. This field can also be set to “ignore,” which will cause the system to ignore the entry. Ignoring an entry is useful for marking unused partitions.
fs_mntops: Mount options. Specifies mounting options. Mount options are covered later in this section.
fs_freq: Used by the dump(8) command to determine which file systems need to be dumped. A value of 0 indicates that the file system does not need to bedumped.
fs_passno: Used by the fsck(8) program to determine the order in which filesystems are checked upon boot. The root file system should have an fs_passno setting of 1, and other local file systems should have an fs_passno of 2. Remote file systems should have an fs_passno of 0, which indicates they should not be checked on boot.

Mount Options

Although most file systems in /etc/fstab are given the mount option of Default, there are other options you can use. Options are listed in /etc/fstab, and are separated by commas (no spaces or tabs).

Mount Option Description
—————————-
async: I/O is done asynchronously to this file system.
atime: Timestamps for each inode are updated when accessed.
auto: Can be mounted with the -a option of the mount(8) command.
defaults: Use the default mount options: rw, suid, dev, exec, auto, nouser,and async.
dev: Interpret character or block special devices on the file system.
exec: Allow binaries (programs) to be executed on this file system.
noatime: Timestamps for each inode are not updated when accessed.
noauto: Cannot be mounted with the -a option of the mount(8) command (it must be mounted explicitly).
nodev: Do not interpret character or block special devices on the file system.
noexec: Do not allow binaries (programs) to be executed on this file system.
nosuid: Do not allow setuid or setgid permissions on programs to take effect.
nouser: Do not allow nonroot users to mount this file system.
remount: Attempt to remount a file system that has already been mounted. This is typically used to change mount options, and is only used by the mount(8) command (never used in /etc/mnttab).
ro: Mount the file system as read-only.
rw: Mount the file system as read-write.
suid: Allow setuid or setgid permissions on programs to take effect.
sync: I/O is done synchronously to this file system.
user: Allow nonroot users to mount this file system. This option also sets the noexec, nosuid, and nodev options, unless overridden.

分类: 科技 标签:

Fix P1 bug in AA system

2006年10月18日 20点50分 没有评论

It took me about two days on fixing a P1 bug in AA system. I did not debug programs before, especally the AA is a very large program. In the fixing process, I stared on the code, and asked for help from other engineers, try to add debug information into code. Though I failed again and again, but I feel it was more nearly to the success, because, at least I known what would happen and who could make effect through all the failure.

First, know the actual factor the debugs describes, you’d better do it by yourself, it would be very benifit for your understanding the trouble. Second, try to locate which program would be the target debuged, in this case, Bruce told me to focus on “/bin/SYS_INSTALLSTARTOS”, and thanks for Sam’s advice, I watch on the “/webui/software/update.cgi” as the target which is proved to be right choice. In the “update.cgi”. I put many “print” and “echo” lines to collect the returned values created by the program running.

The issue is, the GUI hang or has no information when the patch is installed. Using the original “update.cgi”, the patch would be installed successfully without error, but the last screen has not inforamtion said the operating status, as normaly, there would be some lines messages said the patch was installed successfully and reboot the system. Other way, if I comment some lines, the successfully information displayed. but in fact, the patch is not installed which is proved by issueing “rpm -qa | grep UDO”.

In the first way, I found the XML parser seemed hang, so I commented these XML lines and added the “reboot” and “pre_err_message” returned from the second way, yes, the program would run well, install the patch and display successfully information. But it could not be considered as the final resolution.

I watched the code again, very carefully, and found other XML function which executes without hang, How do I use this XML formation to instead the trouble one? Just modify the trouble ones as the precious, remove the strings “>>INSTALL_LOG”. Yeah! I got it! The update.cgi runs well as what I want.

Summary, partience is the most important thing, and more carefully debug tracing. Nothing is difficult if put all heart on it, or nothing is easy if always thinks it’s too hard to do it.

The following is some modified part of the “update.cgi”source code:
Precious XML:
my $xml_out = `$config{‘update_system_cmd’} $install_file 0 pre_install 2>/dev/null`;
# Get parameter from XML input
my $parser = new XML::DOM::Parser;
my $doc = $parser->parse($xml_out);
my $pre_msg = &xml_in($doc, “pre_msg”, 0);
my $force_install_flag = 0;

Second XML(also my target):
my $cmd_out = `$config{‘update_system_cmd’} $install_file $force_install install 2>/dev/null`;
# ori: my $cmd_out = `$config{‘update_system_cmd’} $install_file $forceinstall install >> INSTALL_LOG 2>/dev/null`
$errnum = $?;
# Get parameter from XML input
my $parser = new XML::DOM::Parser;
my $doc = $parser->parse($cmd_out); # even confuse here
$patch_extra_msg = &xml_in($doc, “err_msg”, 0);
$reboot = &xml_in($doc, “need_reboot”, 0);
Summary, the term “INSTALL_LOG” makes the code confused and XML parser not work.

分类: 科技 标签:

dos2unix

2006年10月17日 20点56分 没有评论

When use vi to open the text files created in Windows, I found there’s “^M” in the end of each line. Such file is not able to recognized by Linux, it is also why I could not import the Iplanet LDIF files created in Windows to OpenLDAP. There are two methods to resolve this issue.

First use vi edit this file to instead of “^M” string combination. Or second way maybe the more easier, use “dos2unix” command to convert.
# man dos2unix
Dos/MAC to Unix text file format converter.
“iconv” is a tools to convert big5 to UTF-8 character set.

分类: 科技 标签:

Linux boot

2006年10月17日 20点51分 没有评论

image=/boot/vmlinuz-2.2.15
This is the actual virtual memory compressed kernel of Linux

initrd=/boot/initd-2.2.15.img
This reveals the location of the second stage(RAM) load.

During the installation ,the RAM disk file system is started in Read-only mode. After the second stage is finished with a few tests, the RAM disk is unloaded from memory and the real root partition is mounted form the file system in Read/Write mode.

MBR: master boot recorder
# mkbootdisk /dev/fd0 `uname -r`

分类: 科技 标签:

PAM(Pluggable Authentication Modules)

2006年10月15日 23点05分 没有评论

PAM(Pluggable Authentication Modules), invented by MicroSun, is a mechanism for authentication. It provides some dynamic libraries and a integreted API in order to seprete the system services with their authentication procedures. To the benifit, the Adminstrator could configure every authentication more flexibly, because he/she need not to modify the original service program. New authentication modules are also able to be added,respectively.

分类: 科技 标签:

Verify the OpenLDAP server/Add Starting dn

2006年10月15日 22点35分 没有评论

After install OpenLDAP, use the following commands to check the LDAP service run well:
1. Start up LDAP service with specific port:
# sladp -h “ldap://:389”
2. Execute the “ldapsearch” utility,
# ldapsearch -x -b ” -s base ‘(objectclass=*)’ namingContexts
If return texts as:
dn:
namingContexts: dc=plasmon,dc=sit
It validate the LDAP is running well with correct setting.

Since the LDAP installed successfully, the next step is add root dn for all structure, in my case, “dc=plasmon,dc=sit” is the top node. Create an LDIF file named “phillip”by vi:
dn: dc=plasmon,dc=sit
objectclass: dcObject
objectclass: organization
o: Example Company
dc: plasmon
Then import this ldif to LDAP database:
# ldapadd -x -D “cn=root,dc=plasmon,dc=sit” -W -f phillip
The “dc=plamosn,dc=sit” will be added, note, if do not add this node, any operating to LDAP would meet frastrations.

分类: 科技 标签: