问题现象:
Kylin10 sp3 中删除的服务DmASMSvrServiceDmdscAsm、DmCSSServiceDmdscCss 还能看到
[root@dm196 root]# systemctl status Dm
DmAgentService.service DmAPService.service DmASMSvrServiceDmdscAsm.service DmCSSServiceDmdscCss.service
测试过的方法:
原因分析:
这是 systemd 的“单元缓存(unit cache)”和“残留 unit 引用”现象,不一定是真正还有服务文件存在。
不影响使用,重启系统或刷新缓存可解决。
解决过程:
-- 查看这两个服务的配置文件不在系统目录中;
[root@dm196 system]# pwd
/usr/lib/systemd/system
[root@dm196 system]# ll Dm*
-rw-r--r-- 1 root root 528 5月 14 18:39 DmAgentService.service
-rw-r--r-- 1 root root 431 5月 12 18:58 DmAPService.service
-- 查看unit文件是否存在;
find /etc/systemd /usr/lib/systemd /run/systemd -name "*Dm*"
-- 查看 failed 状态缓存
[root@dm195 ~]# systemctl list-units --failed
UNIT LOAD ACTIVE SUB DESCRIPTION
● DmASMSvrServiceDmdscAsm.service not-found failed failed DmASMSvrServiceDmdscAsm.service
● DmCSSServiceDmdscCss.service not-found failed failed DmCSSServiceDmdscCss.service
● iscsi.service loaded failed failed Login and scanning of iSCSI devices
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.
3 loaded units listed.
-- 清理缓存
systemctl reset-failed
-- 查看当前能看到的服务
[root@dm195 ~]# systemctl status DmA
DmAgentService.service DmAPService.service
-- 查看当前systemd是否加载unit
[root@dm195 ~]# systemctl list-unit-files --all | grep Dm
DmAgentService.service enabled
DmAPService.service enabled
--如果还能看到:not-found、failed、inactive说明 unit 对象仍在内存。