安装nfs 客户端后,nfs-common 服务状态显示inactive,启动显示服务is masked
背景:
master1主机安装了nfs-common客户端,过了一段时间后发现nfs-common.service 变为了inactive,
root@master1:~#sudo systemctl enable nfs-common.service
Failed to start nfs-common.service: Unit nfs-common.service is masked.
使用unmask命令也不起作用
root@master1:~# sudo systemctl unmask nfs-common.service
root@master1:~# sudo systemctl start nfs-common.service
Failed to start nfs-common.service: Unit nfs-common.service is masked.
root@master1:~# systemctl status nfs-common.service
○ nfs-common.service
Loaded: masked (Reason: Unit nfs-common.service is masked.)
Active: inactive (dead)
root@master1:~# sudo systemctl enable nfs-common.service
Synchronizing state of nfs-common.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable nfs-common
Failed to enable unit: Unit file /usr/lib/systemd/system/nfs-common.service is masked.
使用file 命令查看 失败的路径
root@master1:~# file /usr/lib/systemd/system/nfs-common.service
/usr/lib/systemd/system/nfs-common.service: symbolic link to /dev/null
删除符号链接
root@master1:~# sudo rm /usr/lib/systemd/system/nfs-common.service
重新加载systemd位置
root@master1:~# sudo systemctl daemon-reload
启动服务
root@master1:~# sudo systemctl start nfs-common.service
设置开机自启
root@master1:~# sudo systemctl enable nfs-common.service
nfs-common.service is not a native service, redirecting to systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable nfs-common
查看状态,成功解决!!!
root@master1:~# sudo systemctl status nfs-common.service
● nfs-common.service - LSB: NFS support files common to client and server
Loaded: loaded (/etc/init.d/nfs-common; generated)
Active: active (running) since Thu 2025-06-19 10:03:54 CST; 32s ago
Docs: man:systemd-sysv-generator(8)
Tasks: 2 (limit: 2237)
Memory: 5.0M (peak: 6.4M)
CPU: 100ms
CGroup: /system.slice/nfs-common.service
├─1228569 /usr/sbin/rpc.statd
└─1228594 /usr/sbin/rpc.idmapd
Jun 19 10:03:53 master1 systemd[1]: Starting nfs-common.service - LSB: NFS support files common to client and server...
Jun 19 10:03:53 master1 nfs-common[1228561]: * Starting NFS common utilities
Jun 19 10:03:53 master1 rpc.statd[1228569]: Version 2.6.4 starting
Jun 19 10:03:53 master1 rpc.statd[1228569]: Failed to read /var/lib/nfs/state: Success
Jun 19 10:03:53 master1 rpc.statd[1228569]: Initializing NSM state
Jun 19 10:03:54 master1 rpc.idmapd[1228594]: Setting log level to 0
Jun 19 10:03:54 master1 rpc.idmapd[1228594]: libnfsidmap: Unable to determine the NFSv4 domain; Using 'localdomain' as the NFSv4 domain which means UIDs will be mapped to the 'Nobody-User' user defined in /etc/idmapd.conf
Jun 19 10:03:54 master1 nfs-common[1228561]: ...done.
Jun 19 10:03:54 master1 systemd[1]: Started nfs-common.service - LSB: NFS support files common to client and server.
root@master1:~#

浙公网安备 33010602011771号