Loading
0

Centos8 自启The unit files have no installation config (WantedBy, RequiredBy, Also, Alias处理方法
被墙跳转TG:@qianhenetwork QQ 851617266

301免备案跳转微信公众号
腾讯云服务器大促销。
华为服务器
再一次处理问题中,执行了命令:systemctl enable /usr/lib/systemd/system/nfs-idmapd.service 报如 The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).错误,完整报错如下:


[root@ebs-73760 ~]# systemctl enable /usr/lib/systemd/system/nfs-idmapd.service
The unit files have no installation config (WantedBy, RequiredBy, Also, Alias
settings in the [Install] section, and DefaultInstance for template units).

This means they are not meant to be enabled using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
4) In case of template units, the unit is meant to be enabled with some
   instance name specified.

解决方法:
编辑文件 /usr/lib/systemd/system/nfs-idmapd.service 在结尾增加install单元节点后再重新执行命令即可正常。


[Install]
WantedBy=multi-user.target

增加后完整内容如下:


[Unit]
Description=NFSv4 ID-name mapping service
DefaultDependencies=no
Requires=rpc_pipefs.target
After=rpc_pipefs.target local-fs.target

BindsTo=nfs-server.service

[Service]
Type=forking
ExecStart=/usr/sbin/rpc.idmapd

[Install]
WantedBy=multi-user.target

如果该文章解决了您的问题,可不可以留个评论呢?
本文由301免备案跳转原创,转载请注明出处:https://www.zfcdn.xyz/showinfo-3-35829-0.html 否则追究法律责任。
301免备案跳转微信公众号
华为服务器
腾讯云服务器大促销。

声明:站长码字很辛苦啊,转载时请保留本声明及附带文章链接:https://www.zfcdn.xyz/showinfo-3-35829-0.html
亲爱的:被墙域名跳转TG:@qianhenetwork QQ:851617266,可否收藏+评论+分享呢?
上一篇:Centos下基于Nginx环境部署SLB负载均衡的详细步骤
下一篇:宝塔面板升级卡死通过命令升级解决方法