Professional Documents
Culture Documents
Network Service
Management 1
System services
Processes
Basic system configuration
System services
start, stop and restart services
[NSM I - 2015-2016]
2/29
System services
xinetd
[NSM I - 2015-2016]
3/29
System services
chkconfig
Chkconfig configure system services:
Chkconfig [--list] [--add] [--del] [--level
runlevel_list ] service [action]
[NSM I - 2015-2016]
4/29
System services
chkconfig usage example
$ echo "ndbd" > /etc/rc.d/init.d/ndbd
$ chmod +x /etc/rc.d/init.d/ndbd
$ cat ndbd
#!/bin/bash
# chkconfig: 345 98 50
#
| | |
#
| | | - priority for kill scripts
#
| |---- priority for start scripts
#
|-------- run levels at which to start service
# description: MySQL Cluster NDB daemon
ndbd
$ chkconfig --add ndbd
$ for i in 0 1 2 3 4 5 6; do ls rc$i.d/*ndb* ; done
rc0.d/K50ndbd
rc1.d/K50ndbd
rc2.d/K50ndbd
rc3.d/S98ndbd
rc4.d/S98ndbd
rc5.d/S98ndbd
rc6.d/K50ndbd
$ chkconfig --list ndbd
ndbd
0:off 1:off 2:off 3:on 4:on 5:on 6:off
[NSM I - 2015-2016]
5/29
[NSM I - 2015-2016]
6/29
Processes
Running mode
[NSM I - 2015-2016]
7/29
Processes
When user starts the program, the process itself and all
processes started by that process will be owned by that user
Processes permissions to access files and system resources are
determined by using permissions for that user.
Users can control only their processes (except root)
Access rights inherited from parent
[NSM I - 2015-2016]
8/29
Processes
a all processes
u extended format
x include daemon processes
w print long lines
[NSM I - 2015-2016]
9/29
Process priority
Processes
nice
n priority program
[NSM I - 2015-2016]
10/29
Interprocess communication
[NSM I - 2015-2016]
11/29
Interprocess communication
[NSM I - 2015-2016]
12/29
Processes
/proc
/proc filesystem is a virtual filesystem that
permits communication between the Linux
kernel and user space.
Allmos all files are read-only
Can be used to modify kernel parameters
(/proc/sys)
[NSM I - 2015-2016]
13/29
/proc
[NSM I - 2015-2016]
14/29
[NSM I - 2015-2016]
15/29
/proc
/proc/self/
/proc/bus/
/proc/fs
/proc/filesystems
Exported filesystems
/proc/ide/
[NSM I - 2015-2016]
16/29
/proc
/proc/net/
/proc/scsi/
/proc/sys/
/proc/sysvipc/
[NSM I - 2015-2016]
17/29
/sys
/sys
The sysfs filesystem is a special filesystem similar to /proc that is usually mounted on the /sys
directory
A goal of the sysfs filesystem is to expose the hierarchical relationships among the components
of the device driver model
starting with kernel 2.6 there's a new /sys directory for PnP configuration.
it's something like the /proc filesystem since the "files" represent information in the kernel
memory and are not on your harddrive.
each device which exists on your system has it's own directory which contains files showing the
resources allocated to it.
is also used for configuration using sysctl - interface for examining and dynamically
changing parameters in the BSD and Linux operating systems
In Linux, the sysctl is implemented as a wrapper around file system routines that access contents of files in the
/proc directory
The top level sysfs directory looks like:
block/
bus/
class/
dev/
devices/
firmware/
net/
fs/
[NSM I - 2015-2016]
18/29
/sys
/sys/devices/
/sys/bus/
contains a directory for each device driver that is loaded for devices on that particular
bus (this assumes that drivers do not span multiple bus types).
/sys/dev/
contains flat directory layout of the various bus types in the kernel.
/sys/drivers/
contains a filesystem representation of the device tree. It maps directly to the internal
kernel device tree, which is a hierarchy of struct device.
contains two directories char/ and block/. Inside these two directories there are
symlinks named <major>:<minor>. These symlinks point to the sysfs directory for the
given device
/sys/fs/
contains a directory for some filesystems. Currently each filesystem wanting to export
attributes must create its own hierarchy below fs/ (see ./fuse.txt)
[NSM I - 2015-2016]
19/29
Disk partitioning
Create filesystem
fdisk, parted
mkfs (mkfs.ext3, mkfs.vfat, ...)
[NSM I - 2015-2016]
20/29
Filesystem automount
6.
Device name
Mount point
Filesystem type
Options (coma separated)
command to determine which filesystems need to be dumped. If the field
is not present, a value of zero is returned and dump will assume that the
filesystem does not need to be dumped.
order in which filesystem checks are done at reboot time (1 for root, 0 for
swap and other filesystems)
defaults Use default options: rw, suid, dev, exec, auto, nouser, and
async.
ro readonly
nosuid Do not allow SUID or SGID bits to take effect.
noauto Can only be mounted explicitly
user Allow an ordinary user to mount the filesystem.
[NSM I - 2015-2016]
21/29
Fsck program
fsck device_name
[NSM I - 2015-2016]
22/29
[NSM I - 2015-2016]
23/29
Installing Packages
- package managers
RPM
[NSM I - 2015-2016]
24/29
Installing Packages
- package managers
RPM
[NSM I - 2015-2016]
25/29
Installing Packages
- package managers
[NSM I - 2015-2016]
26/29
[NSM I - 2015-2016]
27/29
Reading assignment
[NSM I - 2015-2016]
28/29
References
This presentation is intended for lecturing purposes only and it is based on the references
listed below. Therefore, the students are encouraged to (and they should) read
thoroughly the original documents listed below in order to improve their skills.
1.
Matthew West - The Linux System Administrator's Guide
http://www.learnlinux.org.za/courses/build/fundamentals/index.html
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
http://en.wikipedia.org/wiki/Procfs
http://linux.die.net/man/5/proc
http://linux.die.net/man/8/mount
sysfs - The filesystem for exporting kernel objects.
https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt
Daniel P. Bovet, Marco Cesati, Understanding the Linux Kernel - Third Edition, O'Reilly, 2005
[NSM I - 2015-2016]
29/29