Sie sind auf Seite 1von 4

Module 10 Library files

Two types of library files

Static libraries (.a) – library of object code which is linked with and becomes part of the application

Shared libraries (.so) – can be linked to any program at run-time

Name used by linker (‘lib’ followed by the library name followed by .so)

Ex. libpthread.so

Fully qualified name or ‘soname’ (‘lib’ followed by the library name, followed by .so, followed by ‘.’ And
a version number)

Ex. libpthread.so.1

Real name (‘lib’ followed by the library name, followed by .so, followed by ‘.’ And a version number or
minor number, followed by ‘.’ Then release number )

Ex. libpthread.so.1.1

Version number – major changes. Have to change something in order to run

changes for a shared library when the changes done in the code make the sahred library incompatible
with the previous version

Minor number – simple modifications that does not affect the system. Does not need to change the
requirements to run

Placement in file system

/lib – libraries loaded at start up and running in the root filesystem

/usr/lib – used by the system internally

/usr/local/lib – if it exists, it contains all the libraries that are not part of standard distribution

Widget sets

.so – shared library – compiled, dynamically linked, not human readable

.ko – module

/lib/module

.d – configuration file

/etc

.h – header file -not compiled, not linked, human readable

/lib

.c – source code -not compiled, not linked, human readable


.o – object file -compiled, not linked, not human readable

.a – static file – compiled, statically linked, not human readable

gcc – GNU C compiler – compiler of C programs

ld – the GNU linker – if you want to link library files (link editor)

combines a number of object and archive files. Usually last step in compiling, run ld

ldd – list library dependencies – depends on library files

ldconfig – configure dynamic linker run time binding (update cache /etc/ld.so.cache) – if you want to
configure while the file is running

creates the necessary links and cache to the most recent shared libraries found in the directories
specified on the command line. In the file /etc/ld.so.conf

checks the header and filenames of the libraries

/etc/ld.so.cache – a file created by ldconfig and used to speed linking. Its structure is private to the suite

/etc/ld.so.conf – simple list of directories to scan for libraries, in addition to ‘/usr/lib’ and ‘/lib’, which
are hardwired. It may contain comments started with a ‘#’

cat /etc/ld.so.conf.d/*.conf

libc.conf and x86_64

/etc/ld.so.preload – a list of libraries to preload

Environment variables

LD_LIBRARY_PATH – these variables supply a library

PROC Directory

- Contains a hierarchy of special files which represent the current state of the Kernel – allowing
applications and users to peer into the kernel’s view of the system

/proc/cdmlin – kernel command line information

/proc/console – information about currect consoled including tty

/proc/devices – device drives currently configured fot eh running kernel

cat /proc/devices – character devices and block devices

/proc/dma – info about current DMA channels

/proc/fb – framebuffer devices


/proc/filesystems – current filesystems supported by the kernel

/proc/iomem – current system memory map for devices

/proc/ioports – registered port regions for input output communication with device

/proc/loadavg – system load average

/proc/locks – files currently lock by the kernel

/proc/meminfo – info about system memory

/proc/misc

/proc/mount

/proc/partitions – detailed info about partitions available to the system

/proc/pci – info about every PCI device

/proc/stat – record or various statistics

/proc/swap

/proc/uptime

/proc/version

CRON FACILITY

crontab – is a list of commands that you want to run on a regular schedule, and also the name of the
command used to manage that list

stands for cron table because it uses the job scheduler cron to execute tasks

cron tab located in /var/spool

/var/spool/cron/crontabs – configuration file

/etc/cron.allow and /etc/cron.deny – file use in order for a user use crontab

-u apped the name of the user whose crontab

-e to edit the crontab

crontab -l

crontab -e

export EDITOR=vi

min| hour| day of month |month| day of week| command to be executed

0-59| 0-23|1-31|1-12|0-6 0 is Sunday or use names


0 5 * * 1 tar -zcf /var/backups/home.tgz /home/

* - all possible values

/ - interval

5/5, 5 10 15 20 25

‘-‘ range

‘,’ sperate two values

@yearly (or @annually) – run once a year, midnight Jan 1 – 0 0 1 1*

@monthly – run once a month, midnight, first of month – 0 0 1 * *

@weekly – run once a week, midnight Sunday – 0 0 * * 0

@daily – run once a day, midnight – 0 0 * * *

@hourly – run once an hour, beginning of hour – 0 * * * *

@reboot – run at start

1. Run mycommand at 5:09am on Jan 1st plus every Monday in January

9 5 1 1 1 mycommand

2. Run mycommand at 05 and 35 past the hours of 2:00am and 8:00am on the 1st through the 28th
of Jan and July

5,35 2,8 1-28 1,7 * mycommand

3. Trim down system log file every after 15 minutes starting at 4:16pm on a Sunday afternoon of
September 23

16/15 16 23 9 0 >/var/log/syslog

4. Perform a full backup of /dev/sda1 every sept 23 and every Friday of the same month

* * 23 9 * dump -0w -f /dev/sda1

* * * 9 5 dump -0w -f /dev/sda1

* * * * * echo “I love unix”>/dev/tty1

Display I love unix every minute

Das könnte Ihnen auch gefallen