Getting into systemd for RHEL 7

Latest response

One of my small claims to fame is that I was the first person to document how System V init scripts worked when they were created at AT&T Bell Laboratories. Now nearly 30 years later, System V init scripts, along with the traditional init process, are being replaced in RHEL 7 with the magnificent (and somewhat daunting) systemd service.

To help myself (and hopefully others) understand how systemd works to start up RHEL 7, and later manage the services and other units controlled by systemd, I wrote the following article:

Overview of systemd for RHEL 7

My main goals were to understand and explain how the new systemd boot process works, then provide examples of how tools (such as the systemctl command) are used to manage and query the different systemd components. I was hoping that this document could help spark some questions about systemd that we could discuss here.

Are there things you still don't understand about systemd? Do you have some of your own favorite features of systemd you would like to share? Please feel free to add your comments here.

Responses

Chris, this is awesome!

As a side node, systemd has changed the game around networking, and we have a good explanation from the Networking Team at Red Hat as to explaining the future of network initscripts vs. NetworkMangager:

https://access.redhat.com/site/solutions/783533

The moral of the story: because of the move to systemd, parallel processes now affect how networking starts up, runs, etc.

Gentlemen,

Great efforts.

I am allowed to copy these articles to our team wiki or am I only allowed to link to them?

Hi Jan Gerrit, as this information is the property of Red Hat I suggest that you simply link to these articles. That way you'll also have access to any updated content revisions.

Thanks Chris!

Thanks for the article Chris.

The current hole I have found the documentation for systemd is a tutorial or guide on migrating existing init scripts over (a task I am expecting to do as third party vendors lag).

ie.
What is required to migrate an init script to work natively with systemd (not just dragging it into RHEL 7 as is).

Is anyone able to point at a resource that provides these details?

I'm intending to migrate an initscript I develop to systemd. Here's some resources I've bookmarked as interesting:

It looks like I'll be creating a new unit file at /usr/lib/systemd/system/thing.service, then placing my script in /usr/lib/systemd/scripts/thing. That appears like it'll let me maintain one actual script for both systemd and SysV, and only add a new unit file for systemd-capable systems.

I want this particular script to be runnable by users, which could be achieved by symlinking /usr/lib/systemd/scripts/thing into /usr/local/bin/ or somewhere else in $PATH.

I'll report back if my experience differs much from that.

Thanks for the resources Jamie, will check them out.

Thanks Jamie!

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.