# Test case services quick rough draft. Shows support for KDE, Gnome # and command line. I have not spell checked this or run it through a # grammar checker or done any proofing of any sort on it. Just a quick # example that took me about 15 minutes to write. The screenshots are # meant to be embedded in the document but will be attachments with # this email. Services/daemons are programs that perform useful functions on a system but are not normally started by the user. For example, MySQL runs normally as a service; it is not started every time another service needs to connect to the database. Instead, it is normally always running once configured, unless manually shut it down. Services can be started at other times than at system boot. They may be turned on, off, or restarted without restarting the machine. Services can be set to run only at certain /run levels/. Run levels are various states the machine can exist in. There are two main run levels most Linux users see. Run level 5 is usually the default for most systems, and presents a full graphical environment. The other is run level 3, which is typically used on servers that don't run a graphical environment, or for trouble shooting and low level system driver installation. Turn off any service not being used. Leaving a service running that is not used is leaves the system vulnerable to that software that is not being used. For example, Bluetooth in Fedora is enabled by default. If the system isn't actively connecting to a Bluetooth device, there is no reason to keep the service running. Until recently an ISDN service ran by default. If the system does not use ISDN to connect to the Internet, there is no reason to have it installed and always running. There are several ways to find out what a running system's purpose is. [[The GUI service menus often have descriptions.??]] On the command line, the command `man ` produces documentation about most services. The general rule is to leave it running unless it is known what the services does To configure services: In KDE (presumes the 'kde-admin' tools are installed): Click on the Fedora icon in the toolbar on the default desktop, then navigate to ''Administration > Server Settings > Services''. In Gnome, in the toolbar click on ''System > Server Settings > Services''. Give the root password when prompted In the KDE services application, clicking on a service produces a description of that service and its status. Services without a check mark are not started at run (boot) time. To prevent a service from running on system start up, uncheck the box next to it. To enable a service at start up, check the box. To stop a service select it, then click on the ''Stop'' button. The on demand services tab is for services that are loaded when a client program calls them. For example, the backup system Amanda only runs when an Amanda client talks to the system. To save the new configuration, click on the ''Save'' button. Failing to save changes means the services do not change start up behavior Clicking on the ''Revert'' button erases all the changes. Services can be configured to start/not startfrom the command line using {{{chkconfig}}}. The basic usage of {{{chkconfig}}} is to check the list services and what run level they start in: {{{chkconfig --list chkconfig --list NetworkManager 0:off 1:off 2:on 3:on 4:on 5:on 6:off NetworkManagerDispatcher 0:off 1:off 2:off 3:off 4:off 5:off 6:off acpid 0:off 1:off 2:off 3:off 4:off 5:off 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off apmd 0:off 1:off 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off auditd 0:off 1:off 2:on 3:on 4:on 5:on 6:off autofs 0:off 1:off 2:off 3:on 4:on 5:on 6:off avahi-daemon 0:off 1:off 2:off 3:on 4:on 5:on 6:off }}} 1. Open a terminal window (''Applications > Accessories > Terminal) 1. To disable a service such as {{{sendmail}}}: {{{su -c 'chkconfig --level 2345 sendmail off' }}} This stops {{{sendmail}}} from being started in run levels 2,3,4, and 5. To turn sendmail on for run levels 3 and 5: {{{su -c 'chkconfig --level 35 sendmail on' }}} A full list of {{{chkconfig}}} options is available on the manual page: {{{man chkconfig }}} To manually stop, restart, or start a service that wasn't already running, use the {{{service}}} command. This example starts the {{{sendmail}}} service: {{{su -c 'service sendmail restart' }}} [[[Show text of the following with descriptors instead of a screenshot.]]] In the screen capture you see an example of stopping a service that failed. In this case because the service was already stopped. You will also see an example of starting NFS. Notice that not just NFS started. 3 other services started automatically when NFS started. Many services are like this. There is one final way to edit services. || It is highly recomended to use {{{chkconfig}}} or the GUI tools to modify services, as well as using the {{{service}}} command.|| To stop a service, use {{{ps}}} to aquire its PID, then stop the PID using the {{{kill}}} command. To modify the stop/start of a service in a particular run time level, edit the `/etc/rc` files: {{{ rc rc1.d/ rc3.d/ rc5.d/ rc.d/ rc.sysinit rc0.d/ rc2.d/ rc4.d/ rc6.d/ rc.local }}} Each directry corresponds with the same numbered run time level. To start a service for run time level 5, add a link to the corresponding start script in `/etc/init.d` in to the `/etc/rc5.d/` dir. The `S` and `K` prefix with a number refers to the order in which that service is started or stopped when the system is starting up or shutting down. These last methods are recommended only for experienced users. On rare occasions it is necessary to modify these files to change default behavior. Generally, an administrator never has to directly touch these files.