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

  • Disable SELinux

    Security-Enhanced Linux (SELinux) is a mandatory access control (MAC) security mechanism implemented in the Linux kernel. This mechanism adds an extra layer of access security to your files,directories,devices, ports and...
  • A Basic Overview of the Vim Text Editor

    Many articles in our Webair Community advise editing configuration files. We usually recommend using your preferred text editor. I personally prefer vim. Vim, or its older sibling vi, are installed...
  • Denial Of Service: iptables Defense

    Servers sometimes get hit with what are know as DOS attacks. The offending IP address is usually readily available in the logs for the server being hit. If your SSH...
  • Assign range of IP addresses to an interface.

    Sometimes you may need to assign a wide range of IP addresses to your network interface in Linux systems. Instead of manually creating aliases for the network interface, it is...