我很难搞清楚如何删除不再有文件的systemd单元。 他们似乎仍然在某种程度上在系统中徘徊。
旧的破碎单位,我想删除:
core@ip-172-16-32-83 ~ $ systemctl list-units --all firehose-router* UNIT LOAD ACTIVE SUB DESCRIPTION <E2><97><8F> [email protected] not-found failed failed [email protected] <E2><97><8F> [email protected] not-found failed failed [email protected] LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, ie generalization of SUB. SUB = The low-level unit activation state, values depend on unit type. 2 loaded units listed. To show all installed unit files use 'systemctl list-unit-files'.
文件不存在,但重新加载仍然有这些单位挥之不去:
core@ip-172-16-32-83 ~ $ systemctl list-unit-files [email protected] core@ip-172-16-32-83 ~ $ sudo systemctl daemon-reload core@ip-172-16-32-83 ~ $ systemctl list-units --all firehose-router* UNIT LOAD ACTIVE SUB DESCRIPTION <E2><97><8F> [email protected] not-found failed failed [email protected] <E2><97><8F> [email protected] not-found failed failed [email protected] LOAD = Reflects whether the unit definition was properly loaded. ACTIVE = The high-level unit activation state, ie generalization of SUB. SUB = The low-level unit activation state, values depend on unit type. 2 loaded units listed. To show all installed unit files use 'systemctl list-unit-files'.
没有与他们有关的文件,我可以find:
core@ip-172-16-32-83 ~ $ sudo find /var/run/systemd -name "*firehose-router*" core@ip-172-16-32-83 ~ $ find /etc/systemd/ -name "*firehose-router*" core@ip-172-16-32-83 ~ $ find /usr/lib/systemd/ -name "*firehose-router*" core@ip-172-16-32-83 ~ $
那么我该如何摆脱这些?
你之后的命令是systemctl reset-failed