我有一个符号链接
/lib/systemd/system/rc.local.service -> rc-local.service
我使用得到不同的输出
systemctl status rc.local.service
● rc.local.service - /etc/rc.local Compatibility
Loaded: loaded (/etc/systemd/system/rc.local.service; disabled; vendor preset: enabled)
Active: inactive (dead)
和
systemctl status rc-local.service
● rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/etc/systemd/system/rc-local.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/rc-local.service.d
└─debian.conf
Active: active (exited) since Do 2016-04-21 09:12:58 CEST; 1h 1min ago
Process: 1503 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
Apr 21 09:12:58 ubuntu systemd[1]: Starting /etc/rc.local Compatibility...
Apr 21 09:12:58 ubuntu systemd[1]: Started /etc/rc.local Compatibility.
这是正确的设置吗?调用符号链接服务有什么区别?
这样的话,文件 /etc/rc.local 难道不会被执行两次吗?
(在 Ubuntu 15.10 和 16.04 上测试)
编辑:
ls -lahi /etc/systemd/system/rc* /lib/systemd/system/rc*local.service
1980102 -rw-r--r-- 1 root root 650 Nov 10 2015 /etc/systemd/system/rc-local.service
1980094 -rw-r--r-- 1 root root 650 Nov 10 2015 /etc/systemd/system/rc.local.service
2891510 -rw-r--r-- 1 root root 612 Sep 7 11:32 /lib/systemd/system/rc-local.service
2906434 lrwxrwxrwx 1 root root 16 Sep 7 11:33 /lib/systemd/system/rc.local.service -> rc-local.service