You are not logged in.

#1 2019-11-24 11:35:15

FlashSystems
Member
Registered: 2019-11-24
Posts: 1

CheckUnits - A kind of systemd unit configuration lint

When configuring a new Linux server or client using systemd I found myself doing the same sanity checks on the systemd configuration over and over again. Like any lazy IT guy, I started writing myself a script that does these checks for me. After using this for quite a while I thought it might be useful to someone else, too. So here it is:

Description
This shell script checks the systemd configuration of a modern Linux system and makes suggestions to optimize the use of systemd. If an issue is found the script tries to tell you the commands to solve or further investigate the issue to get you started.

Features
The script does some tests to make sure your current system state matches the systemd configuration. For all non transient systemd units the following checks are performed:

  • If the unit has failed, an error is reported.

  • If the unit was automatically restarted, a warning is reported.

  • If the unit was created by the systemd-sysv-generator to start a legacy init-Script, an information is reported.

  • If the unit file could not be found because of a dangling wants or requires symlink, an error is reported.

  • If the unit is triggered by a timer unit...

    • and it is not static, a warning is reported.

    • and it is disabled by a condition, an information is reported (in verbose mode).

  • If the unit was stopped because it conflicted with an other unit, an information is reported. (Only if -c is used)

  • If the enabled/disabled state of the unit does not equal the preset state, an information is reported. (Only if -p is used)

  • If the unit is enabled but not active, a warning is reported unless...

    • the unit is a one-shot unit and RemainAfterExit is set to "no" or

    • it was disabled by a condition. (Shows an information message in verbose mode).

  • If the unit is disabled but active, a warning is reported unless...

    • the unit is triggered by another unit or

    • the unit is wanted by another active unit (shows an information message in verbose mode) or

    • the unit is a dbus-unit because these units can be triggered by dbus activation.

For usage information and command line switches see the accompanying README.md.

Notes
Because it's a simple, self contained shell script there is no AUR package at the moment. hmm

License
MIT

Download and Contribute
Download from github

Contribute by asking questions on this forum thread or by filing pull requests or bugs on github.

Last edited by FlashSystems (2019-11-24 11:35:52)

Offline

Board footer

Powered by FluxBB