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

  • 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...
  • 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...
  • Identify the process that is using some specific port

    Sometimes, you may encounter a situation where you see some ports being used by some service, but you cannot exactly determine which application/service is using it. This article talks about how...
  • Prevent hot linking of images.

    Hot linking is displaying an image on a website by linking to the same image on another website, rather than saving a copy of it on the website on which...