ITT420 - Lab 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

ITT420: NETWORK AND SYSTEM ADMINISTRATION

LAB EXERCISE 3

Name: Chelsea Evva & Sharifah Najwa Student No: 2022908061 & 2022901149

At the end of this lab exercise students should be able to:


● Study of Important LINUX Services.

Complete this lab exercise before the end of the lab session. Produce and submit three
pages of evidence of completion of this task.

Installation steps to be followed:

1. Common Linux Services and How to Control Them

Starting and Stopping Services at Boot Time Some common web related services
running on a Linux server are, but not limited to, include: httpd (Apache), mysqld
(MySQL), vsftpd (Very Secure FTP), named (BIND), iptables (packet filtering ruleset),
sshd (Secure Shell), network (network related services) and various others. Usually
these services are started at boot time. To check what services are installed on the
server, you can use the chkconfig tool. For example:

[root@server ~]# chkconfig --list

sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off


webmin 0:off 1:off 2:off 3:on 4:off 5:off 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
named 0:off 1:off 2:on 3:on 4:on 5:on 6:off
vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
httpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@server ~]#

You can also specify one service with chkconfig. For example, if you want to see if
mysqld is running, you can use this command:

[root@server ~]# chkconfig --list mysqld


mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@server ~]#
When specifying a service, chkconfig will only return the settings for the specific
service. Chkconfig reports the service name and the status of the service at each run
level. In the example above, mysqld is set to not start at boot for any run level. This
means that you will need to manually start the service. To control the start (or not
starting) at boot is also done with chkconfig. For example, you would like the mysqld
service to start when the system is booted in to run level 3:

[root@server ~]# chkconfig --level 3 mysqld on


[root@server ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:on 4:off 5:off 6:off
[root@server ~]#

Mysqld will now start if the system is booted in run level 3.

If you would like to stop the service from starting in run level 3:

[root@server ~]# chkconfig --level 3 mysqld off


[root@server ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@server ~]#

If you would like to simply ensure a service starts at the necessary run level, you can
run the following command:

[root@server ~]# chkconfigmysqld on


[root@server ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
Alternatively, you can run this command to ensure the service does not start at any
run level:

[root@server ~]# chkconfigmysqld off


[root@server ~]# chkconfig --list mysqld
mysqld 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@server ~]#

You can use the chkconfig command to stop or start a service when booting into
specific run levels. Use:

[root@server ~]# chkconfig –list

To see which services are available to the chkconfig command.

3. Using the Service Command to Start and Stop Services

You can easily stop, start and restart services with a simple command line tool. The
service command can be used with any of the services listed with chkconfig --list. You
must be logged in as root to use the service command. For example, mysqld is not
set to start at boot but you wish to start it now. You can use the service command:

[root@server ~]# servicemysqld start


Starting MySQL: [ OK ]
[root@server ~]#

The service command can also be used to stop services. For example, you want to
stop the mysqld service. Use the following command:

[root@server ~]# servicemysqld stop


Stopping MySQL: [ OK ]
[root@server ~]#

If you want to check to see if a service is running (or not running), you can also use
the
service command. For example:

[root@server ~]# servicemysqld status


mysqld is stopped
[root@server ~]#

4. Important Linux Daemons and Startup Services


These are programs or processes which are run at boot time. Some remain in
memory to execute various tasks when required (daemons). Most are started and
stopped with scripts in the /etc/rc.d/init.d directory. The exact contents of this directory
will depend on which packages from a particular distribution are installed. For
example, installing the Apache package will cause an httpd script to be placed in
/etc/rc.d/init.d.

 amd - runs the automount daemon for remote filesystem mounting such as nfs
 anacron - checks delayed `cron' tasks (see below) at boot time and executes
them.

Useful if you have cron jobs scheduled but don't run your machine all the time.
 apmd - Advanced Power Management BIOS daemon. For use on machines,
especially laptops, that support apm. Monitors battery status and can shut down
the system if power is too low.
 arpwatch - keeps watch for ethernet IP address pairings that are resolved using
the ARP protocol.
 atd - runs jobs queued by `at'
 autofs - control the operation of automount daemons, used to mount and unmount
devices on demand
 bootparamd - allows computers to boot from a Linux machine using the BOOTP
network protocol. A server process that provides information to diskless clients
necessary for booting
 crond - automatic task scheduler. Manages the execution of tasks that are
executed at regular but infrequent intervals, such as rotating log files, cleaning up
/tmp directories, etc.
 cups - daemon for print services under the Common Unix Printer System, a
replacement for lpd
 dhcpd - implements the Dynamic Host Configuration Protocol (DHCP) and the
Internet Bootstrap Protocol (BOOTP). Used to lease out IP addresses to remote
machines.
 drakfont - font server in Mandrake
 fetchmail - daemon to fetch mail at regular intervals from mail servers
 ftpd - ftp server daemon.

OUTCOME: To understand the important services provided by LINUX.

You might also like