Академический Документы
Профессиональный Документы
Культура Документы
Linux internals
Michael MacIsaac
mikemac@us.ibm.com
ITSO
Agenda
ITSO
1-2
Linux for S/390
Agenda for the day
Introduction
Linux for S/390 history
Linux distributions
VIF
Positioning Linux for S/390
Linux for S/390 installation
Linux internals
Enterprise solutions, summary, demo
ITSO
Architecture
Shells, environment
Important commands, directories and files
Basic
Help
Networking
File systems
Software installation and maintenance
Startup, shutdown, daemons
Process management
Users, groups, passwords
Archiving, backup, restore
Searching
Application development
ITSO
3-4
Linux for S/390
Internals: Linux block structure
Linux applications
common,
network protocols filesystems
management
management
architecture
memory
process
agnostic code
common, generic drivers
arh
layer
ITSO
I/O request
hardware device
ITSO
5-6
Linux for S/390
Internals: S/390 modifications
S/390 dependent,
architecture-independent
IBM-contributed
Linux applications
GNU GNU
debugger compiler GNU C runtime library
GNU
(gdb, (gcc) binutils
also
strace) Linux kernel, including
some device drivers
ITSO
linux
ITSO
7-8
Linux for S/390
Internals: Linux for S/390 native drivers
Console
Integrated Console
3215
DASD
ECKD (3380, 3390)
Expanded memory
XPRAM
Network (OCO)
LCS (OSA, 2216, 3172)
CTCA
QDIO (new)
OSA-express (new)
ITSO
ITSO
9-10
Linux for S/390
Internals: Run levels
scripts in
runlevel 0: prepare the machine for turning off
/etc/inittab,
power, if the machine can turn the power off tell it
linuxconf as
to do so
tool
runlevel 1: system administrator mode, all file
systems mounted, only small set of kernel
processes running, single user mode
telnet
runlevel 5: X11
ITSO
ITSO
11-12
Linux for S/390
Internals: Command search order
qualified
pathname
path reserved
variable word
function alias
built in command
ITSO
ITSO
13-14
Linux for S/390
Internals: Functions and aliases
ITSO
Alias: ls example
[mikem@linux390 /usr]$ alias ls='ls -tF'
[mikem@linux390 /usr]$ ls
bin/ sbin/ local/ lib/ info/ src/ man/ X11R6/ ...
[mikem@linux390 /usr]$ unalias ls
[mikem@linux390 /usr]$ ls
X11R6 dict etc include lib local s390-ibm-linux ...
ITSO
15-16
Linux for S/390
Internals: Bash built-ins, reserved words
Built-ins
bash, :, ., alias, bg, bind, break, builtin, cd, command,
continue, declare, dirs, disown, bash-echo, enable, eval, exec,
exit, bash-export, fc, fg, getopts, hash, help, history, jobs,
bash-kill, let, local, logout, popd, pushd, bash-pwd, read,
readonly, return, set, shift, shopt, source, suspend,
bash-test, times, trap, type, typeset, ulimit, umask, unalias,
unset, wait
Reserved words
case do done elif else esac fi for function if in select then until
while
ITSO
Basic commands
ls : list files
ls -l : directory (detailed) listing
ls -a : list hidden files
ls -F : trail file names with helpful characters
cd, pwd : change, show directories
cd .. : move up a directory
cd - : return to previous directory
cd : return to home directory
cp : copy files/directories
cp files directory : copy one or more files to a directory
cp -r files directory : copy recursively
rm : remove (delete) files/directories
rm -f : don't prompt
rm -r : remove files recursively
ITSO
17-18
Linux for S/390
Internals: Basics (cont'd)
mv : move (rename) files
mv files... directory : move a file to a directory
mkdir : make a new directory
rmdir : remove an empty directory
chmod : change permission bits
chmod octal-val files... : change to a specific value
chmod mode files... : change relative (ex: chmod +x file)
chown : change ownership of a file
chown owner.group files... : change owner and group
cat files ... : concatenate (type) files to stdout
more, less: pagers
echo: print to stdout
ITSO
ITSO
19-20
Linux for S/390
Internals: Help
Commands
man - heavily used, expected to be present
info - full screen man
apropos command - not used much
HOW-TOs
documents which describe in detail a certain aspect of
configuring or using Linux
http://metalab.unc.edu/pub/Linux/docs/HOWTO/
ITSO
Commands
ifconfig
netstat -n -r
arp -a
ITSO
21-22
Linux for S/390
Internals: File systems
Types
local (ext2, reiserfs, etc)
in memory
NFS
AFS
Commands
df
du
mount
mke2fs, e2fsck, dumpe2fs
dasdfmt (specific to S/390)
mkswap, swapon
ITSO
ITSO
23-24
Linux for S/390
Internals: Filesystems Hierarchy Standard
ITSO
news/
ITSO
25-26
Linux for S/390
Internals: Software installation
ITSO
Commands
runlevel - query the current level
init - set the current level
dmesg - display boot up messages
shutdown -h now: shutdown the system now
reboot: shutdown the system and bring it backup
ITSO
27-28
Linux for S/390
Internals: Startup, shutdown (cont'd)
ITSO
ITSO
29-30
Linux for S/390
Internals: Startup, shutdown (cont'd)
/etc/rc.d directory
[root@linux390 rc.d]# ls -l init.d
-rwxr-xr-x 1 root root 1031 May 18 03:26 crond
-rwxr-xr-x 1 root root 7386 Sep 20 1999 functions
-rwxr-xr-x 1 root root 3129 Sep 20 1999 halt
-rwxr-xr-x 1 root root 865 May 18 09:05 httpd
-rwxr-xr-x 1 root root 1509 May 17 23:15 inet
-rwxr-xr-x 1 root root 449 Sep 11 1999 killall
-rwxr-xr-x 1 root root 3217 Sep 20 1999 netfs
-rwxr-xr-x 1 root root 6573 Sep 21 1999 network
-rwxr-xr-x 1 root root 1603 May 18 13:04 nscd
-rwxr-xr-x 1 root root 986 May 17 23:44 portmap
-rwxr-xr-x 1 root root 1532 Feb 4 1999 random
...
[root@linux390 rc.d]# ls -l rc1.d
lrwxrwxrwx 1 root 13 Aug 18 08:42 K10xfs -> ../init.d/xfs
lrwxrwxrwx 1 root 15 Aug 18 08:42 K15httpd -> ../init.d/httpd
lrwxrwxrwx 1 root 14 Aug 18 08:42 K50inet -> ../init.d/inet
...
ITSO
ITSO
31-32
Linux for S/390
Internals: Daemon master - ntsysv
ITSO
Commands
ps - list processes
ps -ef
ps aux
jobs - list jobs/process started by current shell
kill - sends SIGTERM signal
kill -9 sends SIGKILL signal
Ctrl-Z - sends suspend character - suspend current process
bg, fg - send process to background, foreground
nohup - don't kill process on "hangup" signal
ITSO
33-34
Linux for S/390
Internals: Users, groups, passwords
Commands
passwd - set passwords
adduser - add a user
useradd, usermod, userdel
groupadd, groupdel
whoami - display user name
id - display user and group IDs
ITSO
Commands
tar - archival
tar -xf file.tar - extract from tarball
tar -cf file.tar files - create tarball
tar -tf file.tar - list files in tarball
gzip, gunzip - GNU compression
compress, uncompress - LZW compression
cpio - old archival command
iconv - translation
dump, restore - ext2 file system backup
ITSO
35-36
Linux for S/390
Internals: Searching
Commands
grep - search through files
find - find files or directories by name
locate - find files using an indexed DB - FAST!
updatedb - update the find database
ITSO
ITSO
37-38
Linux for S/390
Desktop
KDE - A desktop
Gnome - The other desktop
xdm - X display manager
Files & directories
/usr/X11R6/lib/X11/xdm/
Xservers
Xaccess
xdm-config
/usr/X11R6/lib/X11/xinit
ITSO
ITSO
39-40
Linux for S/390
Internals: Application dev'nt, debugging
Shell, command language
Perl
sed, awk, getopts
C/C++
make (gmake)
rcs, cvs - source code control
gcc, g++ (cc, c89, c++) - compilers
flex, bison
cflow
Library processing
ar
Java
ITSO
optional
optional
config.h .C executable
files files
.h files
libraries
ITSO
41-42