The Linux system identifies hardware devices as special files, called device files. There are three
different classifications of device files:
? Character
? Block
? Network
Character device files are for devices that can only handle data one character at a time. Most types
of modems and terminals are created as character files. Block files are for devices that can handle
data in large blocks at a time, such as disk drives.
The network file types are used for devices that use packets to send and receive data. This includes network cards and a special loopback device that allows the Linux system to communicate with itself using common network programming protocols.
Tags: Devices, Files, Hardware, special
Init is the parent of all processes. Its primary role is to create processes from a script stored in the file /etc/inittab.
Some Linux implementations contain a table of processes to start automatically on bootup. On Linux systems this table is usually located in the special file /etc/inittab.
The Linux operating system uses an init system that utilizes run levels. A run level can be used to
direct the init process to run only certain types of processes, as defined in the /etc/inittab file. There are five init run levels in the Linux operating system.
At run level 1, only the basic system processes are started, along with one console terminal process. This is called single user mode. Single user mode is most often used for emergency filesystem maintenance when something is broken. Obviously, in this mode only one person (usually the
administrator) can log in to the system to manipulate data.
# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.
Tags: /etc/inittab, parent, processes
Shared Memory Pages
To facilitate data sharing, you can create shared memory pages. Multiple processes can read and write to and from a common shared memory area. The kernel maintains and administers the shared memory areas and allows individual processes access to the shared area.
The special ipcs command allows you to view the current shared memory pages on the system. Here’s the output from a sample ipcs command.
root@dell:~# ipcs -u
—— Shared Memory Status ——–
segments allocated 6
pages allocated 576
pages resident 528
pages swapped 0
Swap performance: 0 attempts 0 successes
—— Semaphore Status ——–
used arrays = 0
allocated semaphores = 0
—— Messages: Status ——–
allocated queues = 0
used headers = 0
used space = 0 bytes
Each shared memory segment has an owner that created the segment. Each segment also has a standard Linux permissions setting that sets the availability of the segment for other users. The key value is used to allow other users to gain access to the shared memory segment.
-m shared memory segments
root@dell:~# ipcs -m
—— Shared Memory Segments ——–
key shmid owner perms bytes nattch status
0×00000000 327680 buddy 600 393216 2 dest
0×00000000 360449 buddy 600 393216 2 dest
0×00000000 262146 buddy 600 393216 2 dest
0×00000000 294915 buddy 600 393216 2 dest
0×00000000 393220 buddy 600 393216 2 dest
0×00000000 425989 buddy 600 393216 2 dest
Tags: memory, Pages, Shared
Resizing Ext3
An ext3 filesystem can supposedly be expanded with resize2fs while mounted, but standalone would be safer.
A few ways you can do it:
resize2fs
parted
Partition Magic 7.x
In all cases, first convert ext3 –> ext2: [Note: resize2fs works with ext3.]
tune2fs -O ^has_journal /dev/hdax
e2fsck -v -f /dev/hdax
Resize the partitions with tool of choice.
Convert back to ext3
tune2fs -j /dev/hdax
e2fsck -v -f /dev/hdax
-j Add an ext3 journal to the filesystem.
Tags: ext3, Resizing
Installing the PEAR package manager and Checking if PEAR works
When using PHP >= 4.3.0, the PEAR Package Manager is already installed unless one has used the ./configure option –without-pear.
Verifying command line tool
Both pear and pecl tools should be available everywhere on command line. For that to work, pear’s binary (bin) directory should be in your PATH variable.
# apt-cache search php-pear
php-xml-util – a XML utility for php-pear
php-pear – PEAR – PHP Extension and Application Repository
To verify it works, simply type pear. A list of commands should be shown:
root@laptop:~# pear
Commands:
build Build an Extension From C Source
bundle Unpacks a Pecl Package
channel-add Add a Channel
You should further test that PEAR is up to date:
root@laptop:~# pear version
PEAR Version: 1.7.1
PHP Version: 5.2.6-3ubuntu4.5
Zend Engine Version: 2.2.0
Tags: Checking, installing, manager, package, PEAR