Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sys Admin Course Service Management Fourie Joubert.

Similar presentations


Presentation on theme: "Sys Admin Course Service Management Fourie Joubert."— Presentation transcript:

1 Sys Admin Course Service Management Fourie Joubert

2 Sys Admin Course What are services? The system may be running many services, that control the hardware, listen for incoming network connections, etc. These services need to be controlled in terms of if they start, and when they start

3 Sys Admin Course Runlevels The system has different runlevels – 0 Used to halt the system. – 1 Used to run in a single-user mode. – 2 Not used by default. You are free to define it yourself – 3 Used to run in a full multi-user mode with a command-line user interface – 4 Not used by default. You are free to define it yourself – 5 Used to run in a full multi-user mode with a graphical user interface – 6 Used to reboot the system

4 Sys Admin Course Services start and stop at different runlevels – To check your current runlevel: runlevel – The default runlevel can be changed in /etc/inittab

5 Sys Admin Course To check if a service is running, you type the following: service name status For example: service irqbalance status

6 Sys Admin Course You can use a GUI tool to check services and configure them: system-config-services

7 Sys Admin Course If you do not have a GUI available, you an use a text-based menu interface: ntsysv This will affect the current runlevel If you want to edit a different runlevel, you can use: ntsysv –-level 3 ( this will edit runlevel 3)

8 Sys Admin Course For the command line, you can use the following utility: chkconfig To see your current config, do: chkconfig --list To see just one, do: chkconfig --list sshd

9 Sys Admin Course To turn the config for services on or off on the command line, use chkconfig For example, to turn off the config for httpd, use: chkconfig httpd off To enable a service for specific runlevels, use: chkconfig sshd on –level 35

10 Sys Admin Course The command we have used up to now, only affect services on start-up (boot, halt, reboot) If we want to immediately stop or start a service, we use: service name start or service name stop For example: service httpd stop

11 Sys Admin Course We can also restart a service using: service name restart

12 Sys Admin Course Where are the details for these services configured? /etc/init.d /etc/rc0.d /etc/rc1.d /etc/rc2.d /etc/rc3.d /etc/rc4.d /etc/rc5.d /etc/rc6.d

13 Sys Admin Course The config file is placed in /etc/init.d, and then it is linked to one of the other directories to set which runlevel it is accessed in The links are named Sn or Kn The S is to start a service, the K is to stop a service The number n determines the order For example: /etc/rc3.d/S23NetworkManager

14 Sys Admin Course What do these files look like? They have start, stop restart and status sections You can make your own service configurations, using existing services files as examples


Download ppt "Sys Admin Course Service Management Fourie Joubert."

Similar presentations


Ads by Google