我有一個符號鏈接
/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