我在弄清楚如何删除不再具有文件的systemd单元时遇到了麻烦。他们似乎仍然以某种方式徘徊在系统中。
我要删除的旧的损坏的单元:
core@ip-172-16-32-83 ~ $ systemctl list-units --all firehose-router*
UNIT LOAD ACTIVE SUB DESCRIPTION
<E2><97><8F> firehose-router@02.service not-found failed failed firehose-router@02.service
<E2><97><8F> firehose-router@03.service not-found failed failed firehose-router@03.service
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. 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 firehose-router@02.service
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> firehose-router@02.service not-found failed failed firehose-router@02.service
<E2><97><8F> firehose-router@03.service not-found failed failed firehose-router@03.service
LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. 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 ~ $ 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 ~ $
那么如何摆脱这些呢?
它只存在0。没有要禁用的内容(它已经丢失/已禁用)。
—
Andy Shinn 2014年
我尝试了此处(以及到目前为止)所建议的所有解决方案,然后重新启动,但没有任何效果。我尝试删除的单元曾经安装或尝试安装,然后后来被清除。因此,很显然,apt purge不会删除为systemd提供的配置。对于这些“找不到”的单元是否会引起任何问题,我仍然不清楚。
—
椭圆视图
我怀疑我也许可以删除/ var / lib / systemd / deb-systemd-helper-enabled /中的文件,但不确定是否要弄乱它。我在那里似乎有两个已知的死角:mariadb.service.dsh-also和mysql.service.dsh-also
—
椭圆视图
@Elipticalview对这些文件进行备份,以防万一,然后将其删除?
—
gf_
systemctl disable
它们,它会失败,对吗?