Tech Dreamz Initiative

Linux Reference


Linux – Quick referer Page (Not Man Pages)

Let this be a quick reference page for Linux, back to basics page. We will deal with flash of light on linux topics which are essential for users and Admin. Man pages are the best comprehensive reference. We provide a quick view covering bits which will guide you to recollect the features from your experience or try are understand on the possibilities of solving a Linux problem, however when implementation is required it will be serverd by Man’ual pages.
So No details,No flashy graphics but really a quick reference page

->Software Management

Software Applications provide us with Functionalities which are productive,easy to use and manageable. Productive Applications may be a controversial term,but whatever the application may be, a game or a social networking app delivers value to an entity and hence its productive. Easy to use is the second major identifiable attribute since any application level functionality finally resolves to instruction sets and binary, Applications work at a higher level provide an abstracted platform for users. We turn to x-windows or GUI of windows to click search,use utilities like aptitute,dselect but still the objective is to manage and manipulate the options and hence management of app is also seen as key.

-> Package Management
Software leveraging on shared libraries are key to reduce disk space and reduced memory. Packaged tar,bzib,zip,gzib,rpm etc are popular formats for these packaged applications or packages.
Package dependency and level, package database,checksum/signature ,upgrages, binary creation for processors

-Key Operations inclde
Install,refresh,unintall
Info, dependency maintenance,Library maintenance,verify,rebuild,rebuild db
-Options, force,hash,v,nodeps,test,all,file/pack/all verification,list,
-name may be package filename/package names depending on operation
-rpm
<package><version><built><Arch>.rpm
# rpm [mode/operation][options][file/packages]
To extract data from rpm without rpm1ing it – rpm2cpio
.spec file in rpm contains details of build within rpm
alien can also be used to extract data
-Yum -Yellow dog utility, update /manage Yum [options][command][package…]
Yum searches multiple repositories including the Internet and makes it easy to install,its popular with Yellow Dog,fedora etc
-Yumdownloader to just download but not install
-Livna -for downloading rpm of codec/video drivers
-Tweaks /usr/lib/rpm/rpmrc Dont change, Edit /etc/rpmrc file instead

-dpkg
Debian specific – (dpkg,dselect,apt-get),dpkg 2 in Debian 2011 release Squeeze
# dpkg [options][action][package file or name]
-Apt-cache                –
showpkg,apt-cache stats,(missing lib -apt-cache unmet,apt-cache depends ,apt-cache pkgnames
-apt-get (debian= of yum,easy updates over inet
#apt-get [options][commands][package name]
-aptitude – GUI based tool (primarily update,remove etc)
-deselect is GUI for apt-get
-synaptic
-dpkg-cache
-dpkg-reconfigure
-debian package signature in .dsc file.
-Configuration /etc/dpkg/dpkg.cfg , etc/apt/apt.conf or /sources.list

-Converting between rpm and dpkg
-Using Alien from debian, though RPM and Deb required to be installed (just install foreign package manager, dont use it)
# alien [options][file]
–to-deb,–to-rpm,–to-slp (stampede),–to-tgz (tarball)
-Dependencies and conflicts (problems usually encountered)
-best practice use higher level managers like Yum,APT
-unmet dependencies, different levels
-Incompatible libraries or versions /support programs/missing libraries
-Duplicate files/features : mixing packages from diff distro
-Mismatched names
-missing lib
->Workarounds
-Proper way to resolve is to install,update or remove the conflict/dependencies
-forcing with -i option, -nodeps option to load ignoring dependencies,-conflicts ignore
-dpkg with rpm –ignore-depends and with dpkg –force-depends,–force-conflicts
-Rebuilding from source
-dependencies may be from libraries or other required utilities, recompiling on same platform may change dependencies
– rpmbuild requires source rpm build
# rpmbuild –rebuild [packagename version]
-Locating another version of problem package
-Startup scripts (SYSV start up scripts /etc/rc.d/boot.local (hits servers/auto start at boot prgs)
->Library Management
-Library
-libc for c,GNU -glibc=/lib/libc.so.6,widgets
-windows .dll,= linux .so (shared lib), .a (static lib)
-routines in lib or libraries can be linked into the program but it will make programs large in size
-Shared libraries/dynamic libraries
-Multiple versions can be maintained side by side
-Prg looks for lib thru config files/env variables
lib failures due to lib file damage/disk errors (static lib for exotic prgs 😉
-Locating Lib files
-edit /etc/ld.so.conf to include lib path to something like this “”  include /etc/ld.so.conf.d/*.conf
-ldconfig to update or env-update
-other lib paths though not mentioned in above file – /usr/lib and /lib
->Temp change path
#export LD_LIBRARY_PATH=/usr/…../: /…./../
-Correcting Issues
-id lib not found or open shared file missing, know the dependency with ldd, ‘Find’ the file
and manually add the global/local path or create a symbolic link with ln -s <.so> <.so>, as root and ldconfig
->Lib Mgnt Commands
-ldd -v /bin/ls bring out all the dependent libraries
-reload the cache -ldconfig

———————————————————————————————————

-> Process Management
->Kernel
-uname -a
-> ps
->top
->Jobs (session only)
-fg
-bg (or use &)
->Priorities with Nice/Renice
-Processes in terminal are killed when we logout as that session are sent to SIGHUP signal.
-Nohup- -So run on nohup, it will continue even when we log out, it ignores SIGHUP
-kill/killall
killall -i vi will kill all vi sessions whereas kill -pid will kill one instance
-uptime

———————————————————————————————————–

–>>Hardware interaction
->BIOS and Core H/W
-IRQs
0 sys timer,1-kb, 6 floppy,7 parallel port,8 real time clock -> cat /proc/interrupts
-IO Devices like /dev/ttys0=com1, /dev/lp0=LPT1, /dev/fd0=A: -> cat/proc/ioports
-DMA -Direct Memory Address cat/proc/dma
-Boot Disk and Geometry
-Floppy,Hard Disk sector,Track,Platters LBA,CHS old disk issues
-Hot/Cold Plug devices
-Sysfs /sys
-HAL -hald
-D-Bus further Abstraction of H/W info access
-udev – a Virtual File system at /dev for dynamic files as drives for hot plug are loaded and unloaded, config in /etc/udev
-traditional plugin devices, better to power down
–> Most of the device config requires following to be set for configuration
-IRQ,-I/o Port, -DMA
-PCI cards
-Hotplug
-BIOS handling usually
-setpci, lspci
-Loadin Kernel Modules
-insmod,modprobe -v /etc/modprobe.conf
-Removing Kernel modules
-rmmod
->Config USG
-lsusb
-USB Manager Applications
-usbmgr,hotplug

———————————————————————————————————

Command Line tools
->Unix shell options
-bash -Bourne Again Shells
-bsh based on csh / link to bash
-tcsh – based on c shell
-csh original c shell
-ksk korn shell, small user group, planning to take over bsh and c
-zsh z shell, planned to evolve bsh,csh,ksh
/bin.sh is symbolic link to default shell

->Changing Dir cd and cd ~ for home dir
-pwd
-echo
-exec runs external prg
-time is command to know how long subsequent commands take to execute (time pwd)
-set -displays wide variety of options relating to bash operations
-Terminate exit/logout
-xterm/konsole
-internal vs external commands (symbolic link pwd eg)
-if typed comand is not internal command, os checks the path
– ./ myprogram executes my program in current directory
-minimum path for root to minimise security breaches
-> Shell key
-tab to complete a command after staring to type helps to prevent typo etc
-history ~/ .bash_history
-ctrl d – deletes the char , backspace delets char left to cursor
-esc u/l -convert case
-ctrl T – transposes 2 words immediately before or under cursor
-ctrl A or ctrl e to move cursor to start or end of line
-history

———————————————————————————————————————————–

Boot time options and Sequence (typical)

Sequence
1 Boot Manager GRUB
2 Option list – Base Linux kernel
3 UTC time setting
4 udev
5 Options for interactive bootup
6 setting hostname
7 setting logical volume
8 /dev/volgrp00/vol vlean, files,blocks
9 revover journal
10 remount root filesystem
11 mount local file system
12 enable local file system quotas
13 enable etc fstab quotas
14 Init to enter runlevel 5
15 Interactive startup
16 start service microcode_ctl
17 -apply CPU Intel/AMD/ARM micocode update
18 Start service lvm2 monitor
19 -for volume group00 /dev/hdc
20 -logical colume monitor
21 start service readahead_early (background)
22 kudzo start
23 hardware changes check
24 start service iscsid
25 iscsi demon start
26 start ip6tables
27 -apply ip6tables firewall rules
28 start iptables
29 -apply iptables firewall rules
30 start service mc5transstart isdn
31 start service network
32 bringup loopback interface
33 start service eth0
34 -bringup eth0
35 -determine IP info for eth0
36 Start service auditd
37 starting auditd
38 start service restorecond
39 starting restorecond
40 start service syslog
41 starting system logger
42 starting kernel logger
43 start service cpuspeed
44 irabalance
45 iscsi
46 -iscsid pid 1525 running
47 setting iscsi targets : iscsiadm
48 start service portmap
49 start nfslock
50 -nfs statd
51 start mdmonitor
52 start rpcidmapd
53 staring idmapd
54 start rpcgssd
55 start kdump
56 start cmirror
57 start message bus
58 start se troubleshoot
59 starting setroubleshootd
60 start bluetooth
61 start netfs
62 -mounting other filesystems
63 start pcscd – smart card demon
64 start service acpid
65 apmd
66 haldemon
67 hidd
68 lmsensors
69 autofs
70 -starting autofs,automount loading autofs4
71 hplip
72 – hpiod
73 – hpssd
74 start service sshd
75 cups
76 rawdevices
77 xinetd
78 sendmail
79 sendmail,sm-client
80 gpm
81 -staring console mouse services
82 crond
83 xfs
84 anacron
85 atd
86 readahead_later
87 libvirtd
88 rhnsd
89 yum-updatesd
90 Avahi-daemon
91 tog-pegasus
92 -CIM server
93 xend
94 firstboot
95 local
96 mod cluster
97 ricci

up and initial login GUI (as we are  at init 5)

————————————————————————————————————————————————-

Typical Processes after login

Level 1 2 3 4
1 init
2 -acpid
3 -anacron
4 -atd
5 -auditd
6 –audiospd –{auditspd}
7 –auditd
8 -automount —4*[{automount}]
9 -acahi-daemon –avahi-daemon
10 -bonobo-activati —3*[{brcm_iscsiuio}]
11 -bt-applet
12 -cimserver —-4*[{cimserver}]
13 -clock-appler
14 -crond
15 -cupsd
16 -2*[dbus-daemon–{dbus-daemon}]
17 -dbus-launch
18 -dhclient
19 -dnsmasq
20 -eggcups
21 -escd–{escd}
22 -events/0
23 -2*[gam_server]
24 -gconfd-2
25 -gdm-binary
26 —–gdm-binary- —-xorg
27 —gnome-session —-ssh-agent
28 -gdm-rh-security —-{gdm-rn-security}
29 -gnome-keyring-d
30 -gnome-panel
31 -gnome-power-man
32 -gnome-screensac
33 -gnome-settings —–{gnome-settings-}
34 -gnome-terminal
35 —-bash—pstree
36 –pnome-pty-helpe
37 –gnome-terminal
38 -gnome-vfs-daemo
39 -gnome-volume-ma
40 -gpm
41 -hald
42 —–hald-runner- —hald-addon-acpi
43 -hald-addon-keyb
44 -hald-addon-stro
45 -hcid
46 -hidd
47 -hpiod
48 -2*[iscsid]
49 -khelper
50 -klogd
51 -krfcommd
52 -ksoftirqd/0
53 -kthread
54 —aio/0
55 —ata/0
56 —ata_aux
57 –cqueue/0
58 –ib_addr
59 –ib_cm/0
60 –ib_mcast
61 –ISCSI_eh
62 –iw)cm_wq
63 –IW_cxgb3
64 –kacpid
65 –kauditd
66 –kblockd/0
67 –khubd
68 –khungtaskd
69 –2*[kjournald]
70 –kmpath_handlerd
71 –hmpathd/0
72 –kpsmoused
73 –kseriod
74 –ksnapd
75 –kstripped
76 –kswapd0
77 –local_sa
78 –2*[pdflush]
79 –rdma_cm
80 –rpciod/0
81 –scsi_eh_o
82 -libvirtd
83 —-5*[libvirtd]
84 -mapping-daemon
85 -msctransd
86 -metacity
87 -migration/0
88 -6*[mingetty]
89 -mixer_applet2
90 –{mixer_applet2}
91 -modclusterd
92 —2*[{modclusterd}]
93 -nautilus
94 -nm-applet
95 -nm-system-setti
96 -notification-ar
97 -oddjovd
98
99 -pam-panel-icon—–pan_timestamp_c
100 -pcscd
101 –3*[{pcssd}]
102 -portmap
103 -puplet
104 -python
105 -restorecond
106 -ricci
107 -rpc.idmapd
108 -rpc.statd
109 -saslauthd
110 —4*[saslauthd]
111 -sdpd
112 -2*[sendmail]
113 -setroubleshootd
114 —2*[{setroubleshootd}]
115 -smartd
116 -sshd
117 -syslogd
118 -trashapplet
119 -udevd
120 -watchdog/0
121 -wnck-applet
122 -xfs
123 -sinetd
124 -yum-updatesd

—————————————————————————————————————————————–

Now the process which deals with processor firmware or microcode of processor is microcode_ctl service (refer to boot sequence) Intel provides microcode for its processors at  http://downloadcenter.intel.com/default.aspx

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s