{"id":25018011,"url":"https://github.com/flashsystems/checkunits","last_synced_at":"2025-07-19T04:04:59.130Z","repository":{"id":90243261,"uuid":"167816921","full_name":"FlashSystems/CheckUnits","owner":"FlashSystems","description":"Shell script that checks your systemd configuration and tries to make usefull suggestions.","archived":false,"fork":false,"pushed_at":"2025-04-26T09:03:21.000Z","size":50,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-26T10:18:52.615Z","etag":null,"topics":["administration","bash","shell-script","systemd"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FlashSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-01-27T14:17:31.000Z","updated_at":"2025-04-26T09:03:24.000Z","dependencies_parsed_at":"2023-03-17T21:01:06.630Z","dependency_job_id":null,"html_url":"https://github.com/FlashSystems/CheckUnits","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/FlashSystems/CheckUnits","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlashSystems%2FCheckUnits","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlashSystems%2FCheckUnits/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlashSystems%2FCheckUnits/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlashSystems%2FCheckUnits/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FlashSystems","download_url":"https://codeload.github.com/FlashSystems/CheckUnits/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FlashSystems%2FCheckUnits/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265887471,"owners_count":23844409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["administration","bash","shell-script","systemd"],"created_at":"2025-02-05T10:19:20.935Z","updated_at":"2025-07-19T04:04:59.122Z","avatar_url":"https://github.com/FlashSystems.png","language":"Shell","readme":"# CheckUnits\n\nThis 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.\n\n## Dependencies\n\nThis script does not have any dependencies besides `bash` and `systemd`.\nIt was tested with the following `bash` versions:\n\n* 4.4\n* 5.0\n\nAnd the following `systemd` versions (a warning is shown if a version older that 239 is detected):\n\n* 239 to 257\n\nThe script should work with newer versions of `bash` and `systemd` also. If not, please file a bug.\n\n## Usage\n\nJust clone or export the repository and call `checkunits.sh`.\n\n## Command line options\n\n`checkunits.sh` supports some command line options:\n\n### -p\n\nShows a warning if the enabled/disabled state of the unit does not equal the preset state.\n\n### -c\n\nReport units that where stopped because they are in conflict with an other unit.\n\n### -r *Restarts*\n\nAllows to specify the number of restarts after which a warning is issued for a unit.\n\n### -i *Unit*\n\nIgnores the given unit. This option can be passed multiple times to ignore multiple units.\n\n### -s\n\nDisables the version warning and the summary output if no remarks where shown.\n\n### -e\n\nShows errors only. This also enables `-s`. This option is usefull, if `checkunits.sh` is used for monitoring your system for unit failures. See chapter *Monitoring* for more details.\n\n### -v\n\nVerbose mode shows some additional information messages that are useful to clarify why specific warnings or errors are not shown. For example: An information message is shown if a unit is enabled but not running because it was disabled by a condition. These warnings are normally suppressed because conditions are legitimated to stop a unit from running.\n\n### -h\n\nDisplay usage info.\n\n## Exit codes\n\n`checkunits.sh` uses the following exit codes to convey the final result of its operation:\n\n| Exit Code |                      Description                       |\n|-----------|--------------------------------------------------------|\n|         0 | The script completed successfully and without remarks. |\n|       127 | The script completed successfully, but with remarks.   |\n|         1 | Invalid command line option.                           |\n|         2 | Unsupported bash version. Use bash 4.0 or newer.       |\n\n# How it works\n\nThe 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:\n\n* If the unit has failed, an error is reported.\n* If the unit was automatically restarted, a warning is reported.\n* If the unit was created by the systemd-sysv-generator to start a legacy init-Script, an information is reported.\n* If the unit file could not be found because of a dangling wants or requires symlink, an error is reported.\n* If the unit is triggered by a timer unit...\n  * and it is not static, a warning is reported.\n  * and it is disabled by a condition, an information is reported (in verbose mode).\n* If the unit was stopped because it conflicted with an other unit, an information is reported. (Only if `-c` is used)\n* If the enabled/disabled state of the unit does not equal the preset state, an information is reported. (Only if `-p` is used)\n* If the unit is enabled but not active, a warning is reported unless...\n  * the unit is a one-shot unit and RemainAfterExit is set to \"no\" or\n  * it was disabled by a condition. (Shows an information message in verbose mode).\n* If the unit is disabled but active, a warning is reported unless...\n  * the unit is triggered by another unit or\n  * the unit is wanted by another active unit (shows an information message in verbose mode) or\n  * the unit is a dbus-unit because these units can be triggered by dbus activation.\n\n# Monitoring\n\nCheckUnits can be used for a simple form of monitoring. The following oneliner sends an e-mail containing the output of the script if the return code is not 0:\n\n```bash\nmailbody=$(mktemp)\ncheckunits -e \u003e \"${mailbody?}\"||mail -q \"${mailbody?}\" -s \"Failed units\" -r \"MyHost \u003cmyhost@mydomain.example\" \"administrator@mydomain.example\"\nrm \"${mailbody?}\"\n```\n\n# Known issues\n\n## disabled dbus units\n\nFor dbus-units, it is not checked if there really is a dbus service that activates the given systemd unit. Talking to the dbus service for this check is beyond the scope of this script. For disabled dbus units that are active, it is assumed that they where activated via dbus.\n\n## simple services as oneshot replacements\n\nSometimes a simple service is enabled, runs once and stops. This is done to speed up the boot process. When using a oneshot service, systemd waits for the unit to finish, before starting dependencies. If this is not desired, a self terminating simple service is an alternative. RemainAfterExit should be used on this services to prevent `checkunits.sh` from reporting them as enabled, but not active.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashsystems%2Fcheckunits","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashsystems%2Fcheckunits","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashsystems%2Fcheckunits/lists"}