RHEL7 failed to enable service

Kiyor | Created: 10-26-17 18:03:37, Last Update: 10-26-17 18:04:04



发现centos7出现

Failed to execute operation: Too many levels of symbolic links

root@influxdb system $ systemctl enable kapacitor
Failed to execute operation: Too many levels of symbolic links
root@influxdb system $ ll /etc/systemd/system/kapacitor.service
lrwxrwxrwx 1 root root 41 Oct 27 08:47 /etc/systemd/system/kapacitor.service -> /usr/lib/systemd/system/kapacitor.service
root@influxdb system $ rm /etc/systemd/system/kapacitor.service
rm: remove symbolic link ‘/etc/systemd/system/kapacitor.service’? y
root@influxdb system $ systemctl enable kapacitor
Created symlink from /etc/systemd/system/kapacitor.service to /usr/lib/systemd/system/kapacitor.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/kapacitor.service to /usr/lib/systemd/system/kapacitor.service.

结论: systemctl 优先搜寻/etc/systemd/system/, 当里面存在service后会创建软链接到/etc/systemd/system/multi-user.target.wants/, 但如果/etc/systemd/system/内已经是软链接, 则软链接指向过长.


Category: none

Tags: centos7