RHEL 7 and new systemd component

systemd is the new component in RHEL 7 for managing services. In fact, it not only controls services but also sockets, mounts, devices etc..


systemd was firstly planned to take init's place. As you already know, init is the first process (with PID 1) which starts all other services. Normally service start/stop scripts are located under /etc/init.d directory. We have runlevels which mainly specifies which services will run. Run levels are very similar to windows startup boot options. Run level services are specified under /etc/rc?.d directories. ? specifies the run level. It may be 0 to 6. Here, we have only S (start) or K (kill/stop) scripts which are just symbolic links (or shortcuts) to services.  Default runlevel has been specified in /etc/inittab file. We have "initdefault" for this. If we have 


id:5:initdefault:

then linux will arrive to runlevel 5 which is GUI, multi-user level


init starts services according to their start/stop script numbers. So services are serialized and start up takes too much time. 


Then Upstart has come from Ubuntu side. Upstart has specified dependencies between services. So that some form of parallelism happens.


Now you can say goodbye to both Upstart and init. because systemd has replaced both of them. Ubuntu, debian Redhat and SuSe has accepted systemd as their system managers.


systemd has control on 11 units which are service, socket, device, mount, automount, swap, target, path, timer, snapshot, slice, scope. These units can have unit configuration files. 
  • Instead of runlevels, we have targets. We may in graphical.target runlevel which is equivalent to runlevel 5
  • /etc/inittab has no functionality anymore
  • /etc/init.d directory exists for backward compatibility. You can find almost nothing there
  • /etc/systemd/system is the place for configuration now

sytemctl is the main tool for managing systemd units.


new forms of doing administration tasks are specified below. Old forms are in parentheses. 
  • systemctl: shows all units and their statuses
  • systemctl list-unit-files --type service: list all services and their statuses (chkconfig --list and service --status-all)
  • systemctl start http.service (service httpd start)
  • systemctl enable http.service : enable  httpd service on startup (chkconfig httpd on) 
  • systemctl disable http.service 
  • systemctl status httpd.service: status of a service (service httpd status)
  • systemctl get-default: gets current target/runlevel (runlevel)



Yorumlar

Bu blogdaki popüler yayınlar

create Virtual Machines in VMware with ansible

Yüksek Hizmet Sürekliliği (High Availability)