Administration CentOS Debian Fedora Linux Tips and Tricks Ubuntu

How to Manage a Linux Server with systemd

What Operating Systems Have Adopted systemd?

  • CentOS: Yes, by default since CentOS 7
  • Fedora: Yes, since the release of Fedora 15
  • RedHat: Yes
  • Debian: Yes, shipped since Debian 7 as a technology preview
  • Arch: Yes
  • Ubuntu: Available
  • Gentoo: Available
  • OpenSUSE: Available
  • Slackware: No

 

What About chkconfig and Other Legacy Commands?

With systemd it is still possible to use the chkconfig and service commands to manage services that haven’t moved their management to systemd. However, in some cases you will get warning messages from the commands.

On Fedora, RedHat, and CentOS, for example:

chkconfig

returns:

Note: This output shows SysV services only and does not include native
 systemd services. SysV configuration data might be overridden by native
 systemd configuration.

If you want to list systemd services use ‘systemctl list-unit-files’.
 To see services enabled on particular target use
 ’systemctl list-dependencies [target]‘.

 

Summary and Key Commands

The arguments systemctl uses are very similar to the legacy arguments for chkconfig and service. For example, instead of:

service sshd start

you would use:

systemctl start sshd.service

Or instead of:

chkconfig sshd on

you would use:

systemctl enable sshd.service

If you want to see all services that are using systemd and their status, use:

systemctl list-unit-files --type=service

Related Articles

  • Simple Stateful Load Balancer with iptables and NAT

    NOTE: To demonstrate how iptables can perform network address translation this how-to shows how to use it to implement a over-simplified load balancer. In practice we would use a daemon...
  • Verify RPM package integrity

    In the case of Centos/RedHat OS, RPM tool can be used to verify the integrity of the installed package and check if any of the package has been compromised or not....
  • LAMP STACK

    What is a LAMP Stack? “LAMP stack is a popular open source web platform commonly used to run dynamic web sites and servers. It includes Linux, Apache, MySQL, and PHP/Python/Perl...
  • How to List Compiled PHP Modules from the Command Line

    The general command is php -m; this command will give you the full list of extensions: php -m This command will give you an output like: bz2 calendar Core ctype...