nathanbrock / exploring-systemd-start-order

Explore the various start order options in systemd and systemctl replacement.

Repository from Github https://github.comnathanbrock/exploring-systemd-start-orderRepository from Github https://github.comnathanbrock/exploring-systemd-start-order

Exploring SystemD Replacement Start Order

Repo aiming to explore the various start order options in SystemD and how they operate with SystemD replacement.

Table of contents

Prerequisite

  • Docker
  • CentOS7 with SystemD (Run ./build-centos7-systemd.sh)

Running tests

You can run a scenario by running the following command.

./test-scenario.sh {SCENARIO_PATH} eg ./test-scenario.sh scenarios/1-oneshot-a-before-b

The test scenario process is very manual as it stands. It expects you to tell it when you think the start-up process is complete and to move onto the next test step.

This command will;

  • Run the scenario four times;
    1. Run with pure SystemD with service A exit 0
    2. Run with replacement SystemD with service A exit 0
    3. Run with pure SystemD with service A exit 1
    4. Run with replacement SystemD with service A exit 1
  • Expect you to hit CMD+C when you deemed each run "finished".
  • After hitting CMD+C it'll take a screenshot, request the systemctl status of each service and screenshot that.
  • It'll then move onto the next scenario step.

Results

The screenshot results of each scenario can be found in the ./scenarios/**/results directory.

Summary table

Scenario # Description SystemD Service A exit code Expected B status Actual B status Pass
1 Loose dependency. A sets Before=b Pure 0 Running after start-up Running after start-up
Replacement 0 Running after start-up Running after start-up
Pure 1 Running after start-up Running after start-up
Replacement 1 Running after start-up Running after start-up
2 A sets Before=b. B sets BindsTo=a Pure 0 Running after start-up Running after start-up
Replacement 0 Running after start-up Running after start-up
Pure 1 Not running Not running
Replacement 1 Not running Running after start-up
3 Same as above but with a wait
4 A sets Before=b. B sets Requires=a Pure 0 Running after start-up Running after start-up
Replacement 0 Running after start-up Running after start-up
Pure 1 Not running Not running
Replacement 1 Not running Running after start-up
5 B sets After&Requires=a Pure 0 Running after start-up Running after start-up
Replacement 0 Running after start-up Running after start-up
Pure 1 Not running Not running
Replacement 1 Not running Running after start-up
6 B sets After&Requires&PartOf=a Pure 0 Running after start-up Running after start-up
Replacement 0 Running after start-up Running after start-up
Pure 1 Not running Not running
Replacement 1 Not running Running after start-up

Reading

About

Explore the various start order options in systemd and systemctl replacement.


Languages

Language:Python 99.0%Language:Shell 1.0%