systemd Remote-fs.target 尝试挂载已从 fstab 中删除的远程文件系统

systemd Remote-fs.target 尝试挂载已从 fstab 中删除的远程文件系统

这是CentOS 7系统

这其实是从kafka服务开始的。由于依赖于remote-fs.target,Kafka 无法启动

当我尝试手动运行remote-fs.target时:

sudo systemctl start remote-fs.target
A dependency job for remote-fs.target failed. See 'journalctl -xe' for details.

所以我运行journalctl -xe,并得到:

Jun 09 15:33:10 lobo2 systemd[1]: Mounting /home/AAI33947/h...
-- Subject: Unit home-AAI33947-h.mount has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit home-AAI33947-h.mount has begun starting up.
Jun 09 15:33:10 lobo2 mount[118920]: error 2 (No such file or directory) opening credential file /home/AAI33947/.cifspwd
Jun 09 15:33:10 lobo2 systemd[1]: home-AAI33947-h.mount mount process exited, code=exited status=2
Jun 09 15:33:10 lobo2 systemd[1]: Failed to mount /home/AAI33947/h.
-- Subject: Unit home-AAI33947-h.mount has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit home-AAI33947-h.mount has failed.
-- 
-- The result is failed.
Jun 09 15:33:10 lobo2 systemd[1]: Dependency failed for Remote File Systems.
-- Subject: Unit remote-fs.target has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit remote-fs.target has failed.
-- 
-- The result is dependency.

于是我去查看fstab,发现/home/AAI33947/h确实有一个cifs挂载命令

但该用户不再与我们在一起,并且该挂载的远程目标和本地挂载点也不再存在。所以我从 fstab 中删除了该行

但是,当我尝试运行remote-fs.target时,我仍然遇到相同的错误。它仍在尝试挂载该远程文件系统,即使它不再位于 fstab 中。

这是怎么回事?我怎样才能让它认识到这个远程文件系统不再是它需要做的事情?我想重新启动可能会做到这一点,但我试图不破坏目前正在发生的其他事情。

谢谢!

答案1

如果你正在跑步系统,它将在/etc/fstab启动时创建安装单元。如果你fstab改变了,你需要运行sudo systemctl daemon-reload来刷新这些单元。mount -a如果在更改后运行该命令fstab而不重新加载守护程序,该命令实际上会显示有关此问题的警告。

相关内容