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

  • How to get rid of ^M characters.

    When you edit a file in Windows and then open in UNIX, you must have seen ^M characters getting appended in the content. How to get rid of it ?...
  • Patching The Ghost Vulnerability

    The Ghost vulnerability, also known as CVE-2015-0235, is an exploit in a library named glibc. This library is referenced by many applications which run on your server. The exploit is...
  • How to clear the YUM cache?

    What is yum? The Yellowdog Updater, Modified (yum) is an open-source command-line package-management utility for Linux operating systems using the RPM Package Manager. Yum allows automatic updates, package and dependency...
  • 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...