Loading
0

Centos8 自启The unit files have no installation config (WantedBy, RequiredBy, Also, Alias处理方法

再一次处理问题中,执行了命令: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


本文由技术小学生原创,转载请注明出处:https://blog.tag.gg/showinfo-3-35829-0.html 否则追究法律责任。

声明:站长码字很辛苦啊,转载时请保留本声明及附带文章链接:http://blog.tag.gg/showinfo-3-35829-0.html
上一篇:Centos下基于Nginx环境部署SLB负载均衡的详细步骤
下一篇:宝塔面板升级卡死通过命令升级解决方法