[root@wx-local01 ~]# cd /etc/rc.d/ [root@wx-local01 rc.d]# ls -l /etc/rc.d/ 总用量 4 drwxr-xr-x. 2 root root 107 9月 5 10:40 init.d drwxr-xr-x. 2 root root 45 11月 17 2020 rc0.d drwxr-xr-x. 2 root root 45 11月 17 2020 rc1.d drwxr-xr-x. 2 root root 45 11月 17 2020 rc2.d drwxr-xr-x. 2 root root 72 5月 26 14:02 rc3.d drwxr-xr-x. 2 root root 72 5月 26 14:02 rc4.d drwxr-xr-x. 2 root root 72 5月 26 14:02 rc5.d drwxr-xr-x. 2 root root 45 11月 17 2020 rc6.d -rwxr-xr-x. 1 root root 881 5月 27 16:06 rc.local
[root@wx-local01 rc.d]# tree /etc/rc.d/ /etc/rc.d/ ├── init.d │ ├── functions │ ├── mysql -> /home/wx/mysql/support-files/mysql.server │ ├── netconsole │ ├── network │ ├── README │ └── syschronzed_date ├── rc0.d │ ├── K50netconsole -> ../init.d/netconsole │ └── K90network -> ../init.d/network ├── rc1.d │ ├── K50netconsole -> ../init.d/netconsole │ └── K90network -> ../init.d/network ├── rc2.d │ ├── K50netconsole -> ../init.d/netconsole │ └── S10network -> ../init.d/network ├── rc3.d │ ├── K50netconsole -> ../init.d/netconsole │ ├── S10network -> ../init.d/network │ └── S63syschronzed_date -> ../init.d/syschronzed_date ├── rc4.d │ ├── K50netconsole -> ../init.d/netconsole │ ├── S10network -> ../init.d/network │ └── S63syschronzed_date -> ../init.d/syschronzed_date ├── rc5.d │ ├── K50netconsole -> ../init.d/netconsole │ ├── S10network -> ../init.d/network │ └── S63syschronzed_date -> ../init.d/syschronzed_date ├── rc6.d │ ├── K50netconsole -> ../init.d/netconsole │ └── K90network -> ../init.d/network └── rc.local 8 directories, 24 files
[root@wx-local01 rc.d]# vim /etc/rc.d/rc.local #!/bin/bash # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES # # It is highly advisable to create own systemd services or udev rules # to run scripts during boot instead of using this file. # # In contrast to previous versions due to parallel execution during boot # this script will NOT be run after all other services. # # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure # that this script will be executed during boot. touch /var/lock/subsys/local #开机执行脚本启动harbor sh /scripts/shell/start_harbor/power_on_self_starting_harbor.sh
[root@wx-local01 rc.d]# chmod +x /etc/rc.d/rc.local
如:
脚本执行权限要打开:
执行命令 chmod +x /etc/rc.d/rc.local
在rc.local 开机脚本的文件加入
sh /etc/init.d/rinetd start
然后保存即可
Powered by rrcnzz.com
©2019 - 2024 人人站长网
您的IP:13.58.188.166,2024-11-21 14:36:27,Processed in 0.05072 second(s).