= The init scripts, bootup == Init scripts and services In Frugalware, init is provided by systemd, its service files are always called something.service and they are located in /lib/systemd/system. They are used to setup the environment and manage system services. The services are UNIX daemons that provide various functionality. The spectrum of their actions is very large. Synchronizing your system clock, running your webserver, running the virus scanner, all of these are services and they offer much much more. In the following examples we will explain how to alter the running state of a given service. You will have to replace `$service_name$` with the wanted service name, for example `crond.service`. As you will see the syntax is simple, and you may get more help looking at the `systemctl` manual doing: ------------- $ man systemctl ------------- IMPORTANT: Later in this document you will see how to alter the configuration of these services so that they follow your needs. You should better learn how to control them, but don't be afraid, the syntax is really simple, and you will learn it in less then a minute. === Controlling a service execution Services can be started, restarted and stopped, so that you can control what your system has to offer. To start a service, simply do: ---- # systemctl start $service_name$ ---- To restart a service, simply do: ----- # systemctl restart $service_name$ ----- To stop a service, simply do: ---- # systemctl stop $service_name$ ---- As you can see, controlling a service execution is pretty simple. === Controlling a service execution on system boot Controlling the automatic execution of services on system startup is not much more difficult. To add a service for automatic execution on system startup, simply do: ---- # systemctl enable $service_name$ ---- To delete a service from automatic execution on system startup, simply do: ---- # systemctl disable $service_name$ ---- To check if the service is enabled, simply do: ----- # systemctl is-enabled $service_name$ ---- == System boot, targets If you don't pass any extra 'init=/path/to/init' parameters to it, the kernel will start /sbin/init as the final step of the kernel boot sequence. According to /etc/systemd/system/default.target, init will run: 1. each service file required by `basic.target` 2. each service file required by the default target. This is set to `graphical.target` by default. Here is the list of available targets: ---- halt.target = halt emergency.target = similar to 'init=/bin/sh' rescue.target = single user mode multi-user.target = multiuser mode (text mode) graphical.target = multiuser mode, X11 with KDM/GDM/XDM (default Frugalware target) reboot.target = reboot ---- NOTE: `emergency.target` has the advantage that you can boot the system without a reboot later.