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 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...
  • Some useful ‘find’ commands

    The ‘find’ command is quite useful as it helps to identify files with specific permissions, users,groups, size, etc.  Also, it is quite helpful to as it allows to process its results...
  • How to List Which Apache 2 Modules are Enabled on CentOS 6.x

    View Loaded Apache Modules Just one command: apachectl -M Or, if you want to view the list in alphabetical order: apachectl -M | sort Or, if you want to view...
  • Scanning for rootkits and possible exploits – RKHunter

    Rootkits are malicious softwares that are installed by intruders to gain access to your server once the security of the server has been breached.  Intruders can leave some malicious softwares...