系统单元文件linter
systemdlint的Python项目详细描述
systemd unitfile linter
用法
usage: systemdlint [-h][--nodropins][--rootpath ROOTPATH][--sversion SVERSION][--output OUTPUT] files [files ...] Systemd Unitfile Linter positional arguments: files Files to parse optional arguments: -h, --help show this help message and exit --nodropins Ignore Drop-Ins for parsing --rootpath ROOTPATH Root path --sversion SVERSION Version of Systemd to be used --output OUTPUT Where to flush the findings (default: stderr)
输出
工具将返回
{file}:{line}:{severity}\[{id}\] - {message}
示例:
/lib/systemd/system/console-shell.service:18:info [NoFailureCheck] - Return-code check is disabled. Errors are not reported /lib/systemd/system/plymouth-halt.service:11:info [NoFailureCheck] - Return-code check is disabled. Errors are not reported /lib/systemd/system/systemd-ask-password-console.service:12:warning [ReferencedUnitNotFound] - The Unit 'systemd-vconsole-setup.service' referenced was not found in filesystem /lib/systemd/system/basic.target:19:warning [ReferencedUnitNotFound] - The Unit 'tmp.mount' referenced was not found in filesystem
可检测错误
- 冲突选项-set选项与 另一个单位
- execnotfound-在系统上找不到引用的可执行文件
- full privileges-以完全权限运行可执行文件
- InvalidNumericBase-数值不匹配,因为它需要 是x的倍数
- InvalidSetting-选项与节不匹配
- invalidValue-设置的值无效
- mandatory option missing-文件中缺少强制选项
- 多重性-该选项对于给定数量的 此上下文中的选项
- noExecutable-引用的可执行文件不可执行
- nofailurecheck-运行可执行文件时不检查故障
- optionDeprected-已使用的选项在此中不再可用 版本
- optiontoonew-使用的选项将在更高版本中可用 超过使用量
- referencedUnitNotFound-在系统中找不到引用的单元
- 设置需要-该选项需要设置另一个选项
- 设置受限-由于另一个选项,无法设置该选项
- syntaxerror-文件不可解析
- unit section missing-文件中缺少unit节
- UnknownUnitType-文件的扩展名未知 系统一
- 错误的文件掩码-文件设置了有风险的文件模式
- errorCyclicDependency-单元创建循环依赖项