移除rc.local (已棄用)

This commit is contained in:
BoHung Chiu 2022-02-15 12:33:27 +08:00
parent 11d7237112
commit 600e9ed153
1 changed files with 0 additions and 50 deletions

View File

@ -307,11 +307,6 @@ $ sudo /usr/sbin/logrotate -f /etc/logrotate.conf #測試執行log壓縮程序
$ sudo vim /etc/init.d/orbit # 內容見附註 orbit
$ sudo chmod 755 /etc/init.d/orbit
$ update-rc.d orbit defaults
$ sudo vim /etc/init.d/rc.local #內容見附註 rc.local1
$ sudo chmod 755 /etc/init.d/rc.local
$ sudo vim /etc/rc.local #內容見附註 rc.local
$ sudo chmod 755 /etc/rc.local
$ update-rc.d rc.local defaults
$ sudo systemctl start orbit
$ sudo systemctl enable mongod.service #ubuntu18.04以上適用(可在系統boot時自動開啟mongo)
$ sudo mv /etc/init.d/mongod /etc/systemd/system/ && sudo systemctl enable mongod.service
@ -553,51 +548,6 @@ setup)
esac
```
```txt
# 附註 rc.local1
#! /bin/sh
### BEGIN INIT INFO
# Provides: rc.local
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Run /etc/rc.local if it exist
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh
. /lib/lsb/init-functions
do_start() {
if [ -x /etc/rc.local ]; then
[ "$VERBOSE" != no ] && log_begin_msg "Running local boot scripts (/etc/rc.local)"
/etc/rc.local
ES=$?
[ "$VERBOSE" != no ] && log_end_msg $ES
return $ES
fi
}
case "$1" in
start)
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
```
```
### 五、網路設定